

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

If isn\textquotesingle{}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}{0}
\DoxyCodeLine{\ \ \ 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}{0}
\DoxyCodeLine{\textcolor{preprocessor}{\#define\ SECS\_DAY\ 86400}}

\end{DoxyCodeInclude}
 Now let\textquotesingle{}s select two days from current day\+: 
\begin{DoxyCodeInclude}{0}
\DoxyCodeLine{\ \ \ current\_time\ =\ time(NULL)\ +\ 2\ *\ SECS\_DAY;}
\DoxyCodeLine{\ \ \ localtime\_r(\&current\_time,\ \&selected\_time);}
\DoxyCodeLine{\ \ \ elm\_calendar\_selected\_time\_set(cal2,\ \&selected\_time);}

\end{DoxyCodeInclude}
 Our example will look like this\+:

 
\begin{DoxyImageNoCaption}
  \mbox{\includegraphics[width=\textwidth]{screenshots/calendar_example_04}}
\end{DoxyImageNoCaption}


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