\section{Datetime}
\label{group__Datetime}\index{Datetime@{Datetime}}
\subsection*{Functions}
\begin{DoxyCompactItemize}
\item 
Evas\+\_\+\+Object $\ast$ \hyperlink{group__Datetime_ga3dac2d32e2137fac111d91dc15fcc270}{elm\+\_\+datetime\+\_\+add} (Evas\+\_\+\+Object $\ast$parent)
\begin{DoxyCompactList}\small\item\em Adds a new datetime Widget. \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
 
\begin{DoxyImageNoCaption}
  \mbox{\includegraphics[width=\textwidth,height=\textheight/2,keepaspectratio=true]{datetime_inheritance_tree}}
\end{DoxyImageNoCaption}


 
\begin{DoxyImageNoCaption}
  \mbox{\includegraphics[width=\textwidth,height=\textheight/2,keepaspectratio=true]{img/widget/datetime/preview-00}}
\end{DoxyImageNoCaption}


 
\begin{DoxyImageNoCaption}
  \mbox{\includegraphics[width=\textwidth,height=\textheight/2,keepaspectratio=true]{img/widget/datetime/preview-01}}
\end{DoxyImageNoCaption}


 
\begin{DoxyImageNoCaption}
  \mbox{\includegraphics[width=\textwidth,height=\textheight/2,keepaspectratio=true]{img/widget/datetime/preview-02}}
\end{DoxyImageNoCaption}


Datetime widget is used to display and input date \& time values. This widget displays date and time as per the {\bfseries system\textquotesingle{}s locale} settings (Date includes Day, Month \& Year along with the defined separators and Time includes Hour, Minute \& A\+M/\+PM fields. Separator for A\+M/\+PM field is ignored.

The corresponding Month, A\+M/\+PM strings are displayed according to the system’s language settings.

Datetime format is a combination of L\+I\+BC standard characters like “\%d \%b \%Y \%I \+: \%M \%p” which, as a whole represents both Date as well as Time format.

Elm\+\_\+datetime supports only the following sub set of libc date format specifiers\+:

{\bfseries \%Y} \+: The year as a decimal number including the century (example\+: 2011).

{\bfseries \%y} \+: The year as a decimal number without a century (range 00 to 99)

{\bfseries \%m} \+: The month as a decimal number (range 01 to 12).

{\bfseries \%b} \+: The abbreviated month name according to the current locale.

{\bfseries \%B} \+: The full month name according to the current locale.

{\bfseries \%h} \+: The abbreviated month name according to the current locale(same as \%b).

{\bfseries \%d} \+: The day of the month as a decimal number (range 01 to 31).

{\bfseries \%e} \+: The day of the month as a decimal number (range 1 to 31). single digits are preceded by a blank.

{\bfseries \%I} \+: The hour as a decimal number using a 12-\/hour clock (range 01 to 12).

{\bfseries \%H} \+: The hour as a decimal number using a 24-\/hour clock (range 00 to 23).

{\bfseries \%k} \+: The hour (24-\/hour clock) as a decimal number (range 0 to 23). single digits are preceded by a blank.

{\bfseries \%l} \+: The hour (12-\/hour clock) as a decimal number (range 1 to 12); single digits are preceded by a blank.

{\bfseries \%M} \+: The minute as a decimal number (range 00 to 59).

{\bfseries \%p} \+: Either \textquotesingle{}AM\textquotesingle{} or \textquotesingle{}PM\textquotesingle{} according to the given time value, or the corresponding strings for the current locale. Noon is treated as \textquotesingle{}PM\textquotesingle{} and midnight as \textquotesingle{}AM\textquotesingle{}

{\bfseries \%P} \+: Like p but in lower case\+: \textquotesingle{}am\textquotesingle{} or \textquotesingle{}pm\textquotesingle{} or a corresponding string for the current locale.

{\bfseries \%c} \+: The preferred date and time representation for the current locale.

{\bfseries \%x} \+: The preferred date representation for the current locale without the time.

{\bfseries \%X} \+: The preferred time representation for the current locale without the date.

{\bfseries \%r} \+: The complete calendar time using the A\+M/\+PM format of the current locale.

{\bfseries \%R} \+: The hour and minute in decimal numbers using the format H\+:M.

{\bfseries \%T} \+: The time of day in decimal numbers using the format H\+:M\+:S.

{\bfseries \%D} \+: The date using the format \%m/\%d/\%y.

{\bfseries \%F} \+: The date using the format \%Y-\/\%m-\/\%d.

(For more reference on the available {\bfseries L\+I\+BC date format specifiers}, please visit the link\+: \href{http://www.gnu.org/s/hello/manual/libc.html#Formatting-Calendar-Time}{\tt http\+://www.\+gnu.\+org/s/hello/manual/libc.\+html\#\+Formatting-\/\+Calendar-\/\+Time} )

Datetime widget can provide Unicode {\bfseries separators} in between its fields except for A\+M/\+PM field. A separator can be any {\bfseries Unicode character} other than the L\+I\+BC standard date format specifiers.( Example\+: In the format \%b \%d {\bfseries }, \%y \%H {\bfseries }\+: \%M comma(,) is separator for date field \%d and colon(\+:) is separator for hour field \%H ).

The default format is a predefined one, based on the system Locale.

Hour format 12hr(1-\/12) or 24hr(0-\/23) display can be selected by setting the corresponding user format.

Datetime supports six fields\+: Year, Month, Date, Hour, Minute, A\+M/\+PM. Depending on the Datetime module that is loaded, the user can see different UI to select the individual field values.

The individual fields of Datetime can be arranged in any order according to the format set by application.

There is a provision to set the visibility of a particular field as T\+R\+U\+E/ F\+A\+L\+SE so that {\bfseries only time/ only date / only required fields} will be displayed.

Each field is having a default minimum and maximum values just like the daily calendar information. These min/max values can be modified as per the application usage.

User can enter the values only in between the range of maximum and minimum. Apart from these A\+P\+Is, there is a provision to display only a limited set of values out of the possible values. A\+P\+Is to select the individual field limits are intended for this purpose.

The whole widget is left aligned and its size grows horizontally depending on the current format and each field\textquotesingle{}s visible/disabled state.

Datetime individual field selection is implemented in a modular style. Module can be implemented as a Ctxpopup based selection or an I\+SE based selection or even a spinner like selection etc.

{\bfseries Datetime Module design\+:}

The following functions are expected to be implemented in a Datetime module\+:

{\bfseries Field creation\+:} 
\begin{DoxyPre}\end{DoxyPre}



\begin{DoxyPre} \_\_\_\_\_\_\_\_\_\_                                            \_\_\_\_\_\_\_\_\_\_
|          |----- obj\_hook() ---------------------->>>|          |
|          |<<<----------------returns Mod\_data ------|          |
| Datetime |\_\_\_\_\_\_\_                                   |          |
|  widget  |       |Assign module call backs          |  Module  |
|   base   |<<<\_\_\_\_|                                  |          |
|          |                                          |          |
|          |----- field\_create() ------------------>>>|          |
|\_\_\_\_\_\_\_\_\_\_|<<<----------------returns field\_obj -----|\_\_\_\_\_\_\_\_\_\_|\end{DoxyPre}



\begin{DoxyPre}\end{DoxyPre}


{\bfseries Field value setting\+:} 
\begin{DoxyPre}\end{DoxyPre}



\begin{DoxyPre} \_\_\_\_\_\_\_\_\_\_                                          \_\_\_\_\_\_\_\_\_\_
|          |                                        |          |
| Datetime |<<<----------elm\_datetime\_value\_set()---|          |
|  widget  |                                        |  Module  |
|   base   |----display\_field\_value()------------>>>|          |
|\_\_\_\_\_\_\_\_\_\_|                                        |\_\_\_\_\_\_\_\_\_\_|\end{DoxyPre}



\begin{DoxyPre}\end{DoxyPre}


{\bfseries del\+\_\+hook\+:} 
\begin{DoxyPre}
 \_\_\_\_\_\_\_\_\_\_                                          \_\_\_\_\_\_\_\_\_\_
|          |                                        |          |
| Datetime |----obj\_unhook()-------------------->>>>|          |
|  widget  |                                        |  Module  |
|   base   |         <<<-----frees mod\_data---------|          |
|\_\_\_\_\_\_\_\_\_\_|                                        |\_\_\_\_\_\_\_\_\_\_|\end{DoxyPre}



\begin{DoxyPre}\end{DoxyPre}


Any module can use the following shared functions that are implemented in elm\+\_\+datetime.\+c \+:

{\bfseries field\+\_\+format\+\_\+get()} -\/ gives the field format.

{\bfseries field\+\_\+limit\+\_\+get()} -\/ gives the field minimum, maximum limits.

To enable a module, set the E\+L\+M\+\_\+\+M\+O\+D\+U\+L\+ES environment variable as shown\+:

{\bfseries export E\+L\+M\+\_\+\+M\+O\+D\+U\+L\+ES=\char`\"{}datetime\+\_\+input\+\_\+ctxpopup$>$datetime/api\char`\"{}}

This widget inherits from the \hyperlink{group__Layout}{Layout} one, so that all the functions acting on it also work for datetime objects.

This widget emits the following signals, besides the ones sent from Layout\+: \begin{DoxyItemize}
\item {\bfseries \char`\"{}changed\char`\"{}} -\/ whenever Datetime field value is changed, this signal is sent. \item {\bfseries \char`\"{}language,changed\char`\"{}} -\/ whenever system locale changes, this signal is sent. \item {\ttfamily \char`\"{}focused\char`\"{}} -\/ When the datetime has received focus. (since 1.\+8) \item {\ttfamily \char`\"{}unfocused\char`\"{}} -\/ When the datetime has lost focus. (since 1.\+8)\end{DoxyItemize}
Here is an example on its usage\+: \begin{DoxyItemize}
\item \hyperlink{datetime_example}{Datetime widget example} \end{DoxyItemize}


\subsection{Function Documentation}
\index{Datetime@{Datetime}!elm\+\_\+datetime\+\_\+add@{elm\+\_\+datetime\+\_\+add}}
\index{elm\+\_\+datetime\+\_\+add@{elm\+\_\+datetime\+\_\+add}!Datetime@{Datetime}}
\subsubsection[{\texorpdfstring{elm\+\_\+datetime\+\_\+add(\+Evas\+\_\+\+Object $\ast$parent)}{elm_datetime_add(Evas_Object *parent)}}]{\setlength{\rightskip}{0pt plus 5cm}Evas\+\_\+\+Object$\ast$ elm\+\_\+datetime\+\_\+add (
\begin{DoxyParamCaption}
\item[{Evas\+\_\+\+Object $\ast$}]{parent}
\end{DoxyParamCaption}
)}\label{group__Datetime_ga3dac2d32e2137fac111d91dc15fcc270}


Adds a new datetime Widget. 

The default datetime format and corresponding strings are based on current locale.


\begin{DoxyParams}{Parameters}
{\em parent} & The parent object \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
The new object or N\+U\+LL if it cannot be created
\end{DoxyReturn}
This function inserts a new datetime widget on the canvas. 

References elm\+\_\+layout\+\_\+content\+\_\+set(), and elm\+\_\+layout\+\_\+content\+\_\+unset().

