

It's possible to disable date selection and to select a date from your program, and that's what we'll see on this example.

If isn't required that users could select a day on calendar, only interacting going through months, disabling days selection could be a good idea to avoid confusion. For that\-: 
\begin{DoxyCodeInclude}
   elm_calendar_select_mode_set(cal, ELM\_CALENDAR\_SELECT\_MODE\_NONE);

\end{DoxyCodeInclude}


Also, regarding days selection, you could be interested to set a date to be highlighted on calendar from your code, maybe when a specific event happens, or after calendar creation. As {\ttfamily time} output is in seconds, we define the number of seconds contained within a day as a constant\-:  
\begin{DoxyCodeInclude}
\textcolor{preprocessor}{#define SECS\_DAY 86400}

\end{DoxyCodeInclude}


Now let's select two days from current day\-: 
\begin{DoxyCodeInclude}
   current\_time = time(NULL) + 2 * SECS\_DAY;
   localtime\_r(&current\_time, &selected\_time);
   elm_calendar_selected_time_set(cal2, &selected\_time);

\end{DoxyCodeInclude}


Our example will look like this\-:

 
\begin{DoxyImage}
\includegraphics{screenshots/calendar_example_04}
\caption{width=}
\end{DoxyImage}


See the full source code \hyperlink{calendar_example_04_8c-example}{calendar\-\_\-example\-\_\-04.\-c} here. 