From bb942f0b2931d774d4d0b40292fb4865b9a14229 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 4 Apr 2000 01:28:46 +0000 Subject: [PATCH] 1. wxDateTime almost finished 2. wxCalendarCtrl documented git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_2_BRANCH@7059 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- docs/latex/wx/calctrl.tex | 431 ++++++++++++++- docs/latex/wx/category.tex | 5 + docs/latex/wx/classes.tex | 2 + docs/latex/wx/datespan.tex | 14 + docs/latex/wx/datetime.tex | 1069 +++++++++++++++++++++++++++++++++++- docs/latex/wx/tdate.tex | 11 +- docs/latex/wx/timespan.tex | 15 + docs/latex/wx/topics.tex | 1 + docs/latex/wx/window.tex | 2 +- 9 files changed, 1540 insertions(+), 10 deletions(-) create mode 100644 docs/latex/wx/datespan.tex create mode 100644 docs/latex/wx/timespan.tex diff --git a/docs/latex/wx/calctrl.tex b/docs/latex/wx/calctrl.tex index c3d68b7d47..561c71991f 100644 --- a/docs/latex/wx/calctrl.tex +++ b/docs/latex/wx/calctrl.tex @@ -11,13 +11,438 @@ \section{\class{wxCalendarCtrl}}\label{wxcalendarctrl} -The calendar control allows the user to pick a date interactively. +The calendar control allows the user to pick a date interactively. For this, +it displays a window containing several parts: the control to pick the month +and the year at the top (either or both of them may be disabled) and a month +area below them which shows all the days in the month. The user can move the +current selection using the keyboard and select the date (generating +{\tt EVT\_CALENDAR} event) by pressing {\tt } or double clicking it. + +It has advanced possibilities for the customization of its display. All global +settings (such as colours and fonts used) can, of course, be changed. But +also, the display style for each day in the month can be set independently +using \helpref{wxCalendarDateAttr}{wxcalendardateattr} class. + +An item without custom attributes is drawn with the default colours and +font and without border, but setting custom attributes with +\helpref{SetAttr}{wxcalendarctrlsetattr} allows to modify its appearance. Just +create a custom attribute object and set it for the day you want to be +displayed specially (note that the control will take ownership of the pointer, +i.e. it will delete it itself). A day may be marked as being a holiday, even +if it is not reckognized as oen by \helpref{wxDateTime}{tdateholidays} using +\helpref{SetHoliday}{wxcalendardateattrsetholiday} method. + +As the attributes are specified for each day, they may change when the month +is changed, so you will often want to update them in +{\tt EVT\_CALENDAR\_MONTH} event handler. + +\wxheading{Derived from} + +\helpref{wxControl}{wxcontrol}\\ +\helpref{wxWindow}{wxwindow}\\ +\helpref{wxEvtHandler}{wxevthandler}\\ +\helpref{wxObject}{wxobject} \wxheading{Include files} -\wxheading{See also:} +\wxheading{Window styles} -\helpref{Calendar sample}{samplecalendar} +\twocolwidtha{5cm} +\begin{twocollist}\itemsep=0pt +\twocolitem{\windowstyle{wxCAL\_SUNDAY\_FIRST}}{Show Sunday as the first day in the week} +\twocolitem{\windowstyle{wxCAL\_MONDAY\_FIRST}}{Show Monday as the first day in the week} +\twocolitem{\windowstyle{wxCAL\_SHOW\_HOLIDAYS}}{Highlight holidays in the calendar} +\twocolitem{\windowstyle{wxCAL\_NO\_YEAR\_CHANGE}}{Disable the year changing} +\twocolitem{\windowstyle{wxCAL\_NO\_MONTH\_CHANGE}}{Disable the month (and, implicitly, the year) changing} +\end{twocollist} +The default calendar style is {\tt wxCAL\_SHOW\_HOLIDAYS}. + +\wxheading{Event table macros} + +To process input from a calendar control, use these event handler macros to +direct input to member functions that take a +\helpref{wxCalendarEvent}{wxcalendarevent} argument. + +\twocolwidtha{7cm} +\begin{twocollist}\itemsep=0pt +\twocolitem{{\bf EVT\_CALENDAR(id, func)}}{A day was double clickedi n the calendar.} +\twocolitem{{\bf EVT\_CALENDAR\_SEL\_CHANGED(id, func)}}{The selected date changed.} +\twocolitem{{\bf EVT\_CALENDAR\_DAY(id, func)}}{The selected day changed.} +\twocolitem{{\bf EVT\_CALENDAR\_MONTH(id, func)}}{The selected month changed.} +\twocolitem{{\bf EVT\_CALENDAR\_YEAR(id, func)}}{The selected year changed.} +\twocolitem{{\bf EVT\_CALENDAR\_WEEKDAY\_CLICKED(id, func)}}{User clicked on the week day header} +\end{twocollist}% + +Note that changing the selected date will result in either of +{\tt EVT\_CALENDAR\_DAY}, {\tt MONTH} or {\tt YEAR} events and +{\tt EVT\_CALENDAR\_SEL\_CHANGED} one. + +\wxheading{Constants}\label{wxcalendarctrlconstants} + +The following are the possible return values for +\helpref{HitTest}{wxcalendarctrlhittest} method: + +{\small \begin{verbatim} +enum wxCalendarHitTestResult +{ + wxCAL_HITTEST_NOWHERE, // outside of anything + wxCAL_HITTEST_HEADER, // on the header (weekdays) + wxCAL_HITTEST_DAY // on a day in the calendar +}; +\end{verbatim}} + +\wxheading{See also} + +\helpref{Calendar sample}{samplecalendar}\\ +\helpref{wxCalendarDateAttr}{wxcalendardateattr} +\helpref{wxCalendarEvent}{wxcalendarevent} + +\latexignore{\rtfignore{\wxheading{Members}}} + +\membersection{wxCalendarCtrl::wxCalendarCtrl}\label{wxcalendarctrlwxcalendarctrldef} + +\func{}{wxCalendarCtrl}{\void} + +Default constructor, use \helpref{Create}{wxcalendarctrlcreate} after it. + +\membersection{wxCalendarCtrl::wxCalendarCtrl}\label{wxcalendarctrlwxcalendarctrl} + +\func{}{wxCalendarCtrl}{\param{wxWindow* }{parent}, \param{wxWindowID }{id}, \param{const wxDateTime\& }{date = wxDefaultDateTime}, \param{const wxPoint\& }{pos = wxDefaultPosition}, \param{const wxSize\& }{size = wxDefaultSize}, \param{long }{style = wxCAL\_SHOW\_HOLIDAYS}, \param{const wxString\& }{name = wxCalendarNameStr}} + +Does the same as \helpref{Create}{wxcalendarctrlcreate} method. + +\membersection{wxCalendarCtrl::Create}\label{wxcalendarctrlcreate} + +\func{bool}{Create}{\param{wxWindow* }{parent}, \param{wxWindowID }{id}, \param{const wxDateTime\& }{date = wxDefaultDateTime}, \param{const wxPoint\& }{pos = wxDefaultPosition}, \param{const wxSize\& }{size = wxDefaultSize}, \param{long }{style = wxCAL\_SHOW\_HOLIDAYS}, \param{const wxString\& }{name = wxCalendarNameStr}} + +Creates the control. See \helpref{wxWindow}{wxwindowctor} for the meaning of +the parameters and the control overview for the possible styles. + +\membersection{wxCalendarCtrl::\destruct{wxCalendarCtrl}}\label{wxcalendarctrldtor} + +\func{}{\destruct{wxCalendarCtrl}}{\void} + +Destroys the control. + +\membersection{wxCalendarCtrl::SetDate}\label{wxcalendarctrlsetdate} + +\func{void}{SetDate}{\param{const wxDateTime\& }{date}} + +Sets the current date. + +\membersection{wxCalendarCtrl::GetDate}\label{wxcalendarctrlgetdate} + +\constfunc{const wxDateTime\&}{GetDate}{\void} + +Gets the currently selected date. + +\membersection{wxCalendarCtrl::EnableYearChange}\label{wxcalendarctrlenableyearchange} + +\func{void}{EnableYearChange}{\param{bool }{enable = TRUE}} + +This function should be used instead of changing {\tt wxCAL\_NO\_YEAR\_CHANGE} +style bit directly. It allows or disallows the user to chaneg the year +interactively. + +\membersection{wxCalendarCtrl::EnableMonthChange}\label{wxcalendarctrlenablemonthchange} + +\func{void}{EnableMonthChange}{\param{bool }{enable = TRUE}} + +This function should be used instead of changing +{\tt wxCAL\_NO\_MONTH\_CHANGE} style bit. It allows or disallows the user to +change the month interactively. Note that if the month can not be changed, the +year can not be changed neither. + +\membersection{wxCalendarCtrl::EnableHolidayDisplay}\label{wxcalendarctrlenableholidaydisplay} + +\func{void}{EnableHolidayDisplay}{\param{bool }{display = TRUE}} + +This function should be used instead of changing {\tt wxCAL\_SHOW\_HOLIDAYS} +style bit directly. It enables or disables the special highlighting of the +holidays. + +\membersection{wxCalendarCtrl::SetHeaderColours}\label{wxcalendarctrlsetheadercolours} + +\func{void}{SetHeaderColours}{\param{const wxColour\& }{colFg}, \param{const wxColour\& }{colBg}} + +Set the colours used for painting the weekdays at the top of the control. + +\membersection{wxCalendarCtrl::GetHeaderColourFg}\label{wxcalendarctrlgetheadercolourfg} + +\constfunc{const wxColour\&}{GetHeaderColourFg}{\void} + +Gets the foreground colour of the header part of the calendar window. + +\wxheading{See also} + +\helpref{SetHeaderColours}{wxcalendarctrlsetheadercolours} + +\membersection{wxCalendarCtrl::GetHeaderColourBg}\label{wxcalendarctrlgetheadercolourbg} + +\constfunc{const wxColour\&}{GetHeaderColourBg}{\void} + +Gets the background colour of the header part of the calendar window. + +\wxheading{See also} + +\helpref{SetHeaderColours}{wxcalendarctrlsetheadercolours} + +\membersection{wxCalendarCtrl::SetHighlightColours}\label{wxcalendarctrlsethighlightcolours} + +\func{void}{SetHighlightColours}{\param{const wxColour\& }{colFg}, \param{const wxColour\& }{colBg}} + +Set the colours to be used for highlighting the currently selected date. + +\membersection{wxCalendarCtrl::GetHighlightColourFg}\label{wxcalendarctrlgethighlightcolourfg} + +\constfunc{const wxColour\&}{GetHighlightColourFg}{\void} + +Gets the foreground highlight colour. + +\wxheading{See also} + +\helpref{SetHighlightColours}{wxcalendarctrlsethighlightcolours} + +\membersection{wxCalendarCtrl::GetHighlightColourBg}\label{wxcalendarctrlgethighlightcolourbg} + +\constfunc{const wxColour\&}{GetHighlightColourBg}{\void} + +Gets the background highlight colour. + +\wxheading{See also} + +\helpref{SetHighlightColours}{wxcalendarctrlsethighlightcolours} + +\membersection{wxCalendarCtrl::SetHolidayColours}\label{wxcalendarctrlsetholidaycolours} + +\func{void}{SetHolidayColours}{\param{const wxColour\& }{colFg}, \param{const wxColour\& }{colBg}} + +Sets the colours to be used for the holidays highlighting (only used if the +window style includes {\tt wxCAL\_SHOW\_HOLIDAYS} flag). + +\membersection{wxCalendarCtrl::GetHolidayColourFg}\label{wxcalendarctrlgetholidaycolourfg} + +\constfunc{const wxColour\&}{GetHolidayColourFg}{\void} + +Return the foregound colour currently used for holiday highlighting. + +\wxheading{See also} + +\helpref{SetHolidayColours}{wxcalendarctrlsetholidaycolours} + +\membersection{wxCalendarCtrl::GetHolidayColourBg}\label{wxcalendarctrlgetholidaycolourbg} + +\constfunc{const wxColour\&}{GetHolidayColourBg}{\void} + +Return the background colour currently used for holiday highlighting. + +\wxheading{See also} + +\helpref{SetHolidayColours}{wxcalendarctrlsetholidaycolours} + +\membersection{wxCalendarCtrl::GetAttr}\label{wxcalendarctrlgetattr} + +\constfunc{wxCalendarDateAttr *}{GetAttr}{\param{size\_t }{day}} + +Returns the attribute for the given date (should be in the range $1\ldots31$). + +The returned pointer may be {\tt NULL}. + +\membersection{wxCalendarCtrl::SetAttr}\label{wxcalendarctrlsetattr} + +\func{void}{SetAttr}{\param{size\_t }{day}, \param{wxCalendarDateAttr* }{attr}} + +Associates the attribute with the specified date (in the range $1\ldots31$). + +If the pointer is {\tt NULL}, the items attribute is cleared. + +\membersection{wxCalendarCtrl::SetHoliday}\label{wxcalendarctrlsetholiday} + +\func{void}{SetHoliday}{\param{size\_t }{day}} + +Marks the specified day as being a holiday in the current month. + +\membersection{wxCalendarCtrl::ResetAttr}\label{wxcalendarctrlresetattr} + +\func{void}{ResetAttr}{\param{size\_t }{day}} + +Clears any attributes associated with the given day (in the range +$1\ldots31$). + +\membersection{wxCalendarCtrl::HitTest}\label{wxcalendarctrlhittest} + +\func{wxCalendarHitTestResult}{HitTest}{\param{const wxPoint\& }{pos}, \param{wxDateTime* }{date = NULL}, \param{wxDateTime::WeekDay* }{wd = NULL}} + +Returns one of {\tt wxCAL\_HITTEST\_XXX} +\helpref{constants}{wxcalendarctrlconstants} and fills either {\it date} or +{\it wd} pointer with the corresponding value depending on the hit test code. + +\section{\class{wxCalendarDateAttr}}\label{wxcalendardateattr} + +wxCalendarDateAttr is a custom attributes for a calendar date. The objects of +this class are used with \helpref{wxCalendarCtrl}{wxcalendarctrl}. + +\wxheading{Derived from} + +No base class + +\wxheading{Constants}\label{wxcalendardateattrborderkind} + +Here are the possible kinds of borders which may be used to decorate a date: + +{\small \begin{verbatim} +enum wxCalendarDateBorder +{ + wxCAL\_BORDER\_NONE, // no border (default) + wxCAL\_BORDER\_SQUARE, // a rectangular border + wxCAL\_BORDER\_ROUND // a round border +} +\end{verbatim}} + +\wxheading{See also} + +\helpref{wxCalendarCtrl}{wxcalendarctrl} + +\latexignore{\rtfignore{\wxheading{Members}}} + +\membersection{wxCalendarDateAttr::wxCalendarDateAttr}\label{wxcalendardateattrwxcalendardateattr} + +\func{}{wxCalendarDateAttr}{\void} + +\func{}{wxCalendarDateAttr}{\param{const wxColour\& }{colText}, \param{const wxColour\& }{colBack = wxNullColour}, \param{const wxColour\& }{colBorder = wxNullColour}, \param{const wxFont\& }{font = wxNullFont}, \param{wxCalendarDateBorder }{border = wxCAL\_BORDER\_NONE}} + +\func{}{wxCalendarDateAttr}{\param{wxCalendarDateBorder }{border}, \param{const wxColour\& }{colBorder = wxNullColour}} + +The constructors. + +\membersection{wxCalendarDateAttr::SetTextColour}\label{wxcalendardateattrsettextcolour} + +\func{void}{SetTextColour}{\param{const wxColour\& }{colText}} + +Sets the text (foreground) colour to use. + +\membersection{wxCalendarDateAttr::SetBackgroundColour}\label{wxcalendardateattrsetbackgroundcolour} + +\func{void}{SetBackgroundColour}{\param{const wxColour\& }{colBack}} + +Sets the text background colour to use. + +\membersection{wxCalendarDateAttr::SetBorderColour}\label{wxcalendardateattrsetbordercolour} + +\func{void}{SetBorderColour}{\param{const wxColour\& }{col}} + +Sets the border colour to use. + +\membersection{wxCalendarDateAttr::SetFont}\label{wxcalendardateattrsetfont} + +\func{void}{SetFont}{\param{const wxFont\& }{font}} + +Sets the font to use. + +\membersection{wxCalendarDateAttr::SetBorder}\label{wxcalendardateattrsetborder} + +\func{void}{SetBorder}{\param{wxCalendarDateBorder }{border}} + +Sets the \helpref{border kind}{wxcalendardateattrborderkind} + +\membersection{wxCalendarDateAttr::SetHoliday}\label{wxcalendardateattrsetholiday} + +\func{void}{SetHoliday}{\param{bool }{holiday}} + +Display the date with this attribute as a holiday. + +\membersection{wxCalendarDateAttr::HasTextColour}\label{wxcalendardateattrhastextcolour} + +\constfunc{bool}{HasTextColour}{\void} + +Returns {\tt TRUE} if this item has a non default text foreground colour. + +\membersection{wxCalendarDateAttr::HasBackgroundColour}\label{wxcalendardateattrhasbackgroundcolour} + +\constfunc{bool}{HasBackgroundColour}{\void} + +Returns {\tt TRUE} if this attribute specifies a non default text background colour. + +\membersection{wxCalendarDateAttr::HasBorderColour}\label{wxcalendardateattrhasbordercolour} + +\constfunc{bool}{HasBorderColour}{\void} + +Returns {\tt TRUE} if this attribute specifies a non default border colour. + +\membersection{wxCalendarDateAttr::HasFont}\label{wxcalendardateattrhasfont} + +\constfunc{bool}{HasFont}{\void} + +Returns {\tt TRUE} if this attribute specifies a non default font. + +\membersection{wxCalendarDateAttr::HasBorder}\label{wxcalendardateattrhasborder} + +\constfunc{bool}{HasBorder}{\void} + +Returns {\tt TRUE} if this attribute specifies a non default (i.e. any) border. + +\membersection{wxCalendarDateAttr::IsHoliday}\label{wxcalendardateattrisholiday} + +\constfunc{bool}{IsHoliday}{\void} + +Returns {\tt TRUE} if this attribute specifies that this item should be +displayed as a holiday. + +\membersection{wxCalendarDateAttr::GetTextColour}\label{wxcalendardateattrgettextcolour} + +\constfunc{const wxColour\&}{GetTextColour}{\void} + +Returns the text colour to use for the item with this attribute. + +\membersection{wxCalendarDateAttr::GetBackgroundColour}\label{wxcalendardateattrgetbackgroundcolour} + +\constfunc{const wxColour\&}{GetBackgroundColour}{\void} + +Returns the background colour to use for the item with this attribute. + +\membersection{wxCalendarDateAttr::GetBorderColour}\label{wxcalendardateattrgetbordercolour} + +\constfunc{const wxColour\&}{GetBorderColour}{\void} + +Returns the border colour to use for the item with this attribute. + +\membersection{wxCalendarDateAttr::GetFont}\label{wxcalendardateattrgetfont} + +\constfunc{const wxFont\&}{GetFont}{\void} + +Returns the font to use for the item with this attribute. + +\membersection{wxCalendarDateAttr::GetBorder}\label{wxcalendardateattrgetborder} + +\constfunc{wxCalendarDateBorder}{GetBorder}{\void} + +Returns the \helpref{border}{wxcalendardateattrborderkind} to use for the item with this attribute. + +\section{\class{wxCalendarEvent}}\label{wxcalendarevent} + +The wxCalendarEvent class is used together with +\helpref{wxCalendarCtrl}{wxcalendarctrl}. + +\wxheading{See also} + +\helpref{wxCalendarCtrl}{wxcalendarctrl} + +\latexignore{\rtfignore{\wxheading{Members}}} + +\membersection{wxCalendarEvent::GetDate}{wxcalendareventgetdate} + +\constfunc{const wxDateTime&}{GetDate}{\void} + +Returns the date. This function may be called for all event types except +{\tt EVT\_CALENDAR\_WEEKDAY\_CLICKED} one for which it doesn't make sense. + +\membersection{wxCalendarEvent::GetWeekDay}{wxcalendareventgetweekday} + +\constfunc{wxDateTime::WeekDay}{GetWeekDay}{\void} + +Returns the week day on which the user clicked in +{\tt EVT\_CALENDAR\_WEEKDAY\_CLICKED} handler. It doesn't make sense to call +this function in other handlers. diff --git a/docs/latex/wx/category.tex b/docs/latex/wx/category.tex index 74fab2a04d..c2a59f66d6 100644 --- a/docs/latex/wx/category.tex +++ b/docs/latex/wx/category.tex @@ -76,6 +76,7 @@ that are not static can have \helpref{validators}{wxvalidator} associated with t \twocolitem{\helpref{wxControl}{wxcontrol}}{The base class for controls} \twocolitem{\helpref{wxButton}{wxbutton}}{Push button control, displaying text} \twocolitem{\helpref{wxBitmapButton}{wxbitmapbutton}}{Push button control, displaying a bitmap} +\twocolitem{\helpref{wxCalendarCtrl}{wxcalendarctrl}}{Date picker control} \twocolitem{\helpref{wxCheckBox}{wxcheckbox}}{Checkbox control} \twocolitem{\helpref{wxCheckListBox}{wxchecklistbox}}{A listbox with a checkbox to the left of each item} \twocolitem{\helpref{wxChoice}{wxchoice}}{Choice control (a combobox without the editable area)} @@ -183,6 +184,7 @@ An event object contains information about a specific event. Event handlers \begin{twocollist}\itemsep=0pt \twocolitem{\helpref{wxActivateEvent}{wxactivateevent}}{A window or application activation event} +\twocolitem{\helpref{wxCalendarEvent}{wxcalendarevent}}{Used with \helpref{wxCalendarCtrl}{wxcalendarctrl}} \twocolitem{\helpref{wxCalculateLayoutEvent}{wxcalculatelayoutevent}}{Used to calculate window layout} \twocolitem{\helpref{wxCloseEvent}{wxcloseevent}}{A close window or end session event} \twocolitem{\helpref{wxCommandEvent}{wxcommandevent}}{An event from a variety of standard controls} @@ -235,6 +237,7 @@ These are the data structure classes supported by wxWindows. \begin{twocollist}\itemsep=0pt \twocolitem{\helpref{wxCmdLineParser}{wxcmdlineparser}}{Command line parser class} \twocolitem{\helpref{wxDate}{wxdate}}{A class for date manipulation (deprecated in favour of wxDateTime)} +\twocolitem{\helpref{wxDateSpan}{wxdatespan}}{A logical time interval.} \twocolitem{\helpref{wxDateTime}{wxdatetime}}{A class for date/time manipulations} \twocolitem{\helpref{wxExpr}{wxexpr}}{A class for flexible I/O} \twocolitem{\helpref{wxExprDatabase}{wxexprdatabase}}{A class for flexible I/O} @@ -254,6 +257,7 @@ These are the data structure classes supported by wxWindows. \twocolitem{\helpref{wxRealPoint}{wxrealpoint}}{Representation of a point using floating point numbers} \twocolitem{\helpref{wxSize}{wxsize}}{Representation of a size} \twocolitem{\helpref{wxTime}{wxtime}}{A class for time manipulation (deprecated in favour of wxDateTime)} +\twocolitem{\helpref{wxTimeSpan}{wxtimespan}}{A time interval.} \twocolitem{\helpref{wxVariant}{wxvariant}}{A class for storing arbitrary types that may change at run-time} \end{twocollist} @@ -488,6 +492,7 @@ used internally by the HTML classes. \twocolitem{\helpref{wxAutomationObject}{wxautomationobject}}{OLE automation class} \twocolitem{\helpref{wxFontMapper}{wxfontmapper}}{Font mapping, finding suitable font for given encoding} \twocolitem{\helpref{wxEncodingConverter}{wxencodingconverter}}{Encoding conversions} +\twocolitem{\helpref{wxCalendarDateAttr}{wxcalendardateattr}}{Used with \helpref{wxCalendarCtrl}{wxcalendarctrl}} \end{twocollist} {\large {\bf Database classes}} diff --git a/docs/latex/wx/classes.tex b/docs/latex/wx/classes.tex index bf60e15cd2..34d7868d31 100644 --- a/docs/latex/wx/classes.tex +++ b/docs/latex/wx/classes.tex @@ -52,6 +52,7 @@ \input dobjsmpl.tex \input datstrm.tex \input date.tex +\input datespan.tex \input datetime.tex \input dc.tex \input ddeclint.tex @@ -273,6 +274,7 @@ \input txtstrm.tex \input textdlg.tex \input txtdrptg.tex +\input timespan.tex \input valtext.tex \input table.tex \input textfile.tex diff --git a/docs/latex/wx/datespan.tex b/docs/latex/wx/datespan.tex new file mode 100644 index 0000000000..0b684d01d9 --- /dev/null +++ b/docs/latex/wx/datespan.tex @@ -0,0 +1,14 @@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% Name: datespan.tex +%% Purpose: wxDateSpan documentation +%% Author: Vadim Zeitlin +%% Modified by: +%% Created: 04.04.00 +%% RCS-ID: $Id$ +%% Copyright: (c) Vadim Zeitlin +%% License: wxWindows license +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\section{\class{wxDateSpan}}\label{wxdatespan} + +TODO diff --git a/docs/latex/wx/datetime.tex b/docs/latex/wx/datetime.tex index b96948c37f..995f1469dd 100644 --- a/docs/latex/wx/datetime.tex +++ b/docs/latex/wx/datetime.tex @@ -96,6 +96,77 @@ Likely, Sun, Mon, Tue, Wed, Thu, Fri, Sat, and Inv\_WeekDay are the values in Finally, Inv\_Year is defined to be an invalid value for year parameter. +\helpref{GetMonthName()}{wxdatetimegetmonthname} and +\helpref{GetWeekDayName}{wxdatetimegetweekdayname} functions use the followign +flags: + +\begin{verbatim} + enum NameFlags + { + Name_Full = 0x01, // return full name + Name_Abbr = 0x02 // return abbreviated name + }; +\end{verbatim} + +\label{wxdatetimecalendar} +Several functions accept an extra parameter specifying the calendar to use +(although most of them only support now the Gregorian calendar). This +parameters is one of the following values: + +\begin{verbatim} + enum Calendar + { + Gregorian, // calendar currently in use in Western countries + Julian // calendar in use since -45 until the 1582 (or later) + }; +\end{verbatim} + +\label{wxdatetimecountry} +Date calculatiosn often depend on the country adn wxDateTime allows to set the +country which conventions should be used using +\helpref{SetCountry}{wxdatetimesetcountry}. It takes one of the following +values as parameter: + +\begin{verbatim} + enum Country + { + Country_Unknown, // no special information for this country + Country_Default, // set the default country with SetCountry() method + // or use the default country with any other + + Country_WesternEurope_Start, + Country_EEC = Country_WesternEurope_Start, + France, + Germany, + UK, + Country_WesternEurope_End = UK, + + Russia, + + USA + }; +\end{verbatim} + +\label{wxdatetimeweekstart} +Differnet parst of the world use different conventions for the week start. +In some countries, the week starts on Sunday, while in others - on Monday. +The ISO standard doesn't address this issue, so we support both conventions in +the fucntions whose result depends on it ( +\helpref{GetWeekOfYear}{wxdatetimegetweekofyear} and +\helpref{GetWeekOfMonth}{wxdatetimegetweekofmonth}). + +The desired behvaiour may be specified by giving one of the following +constants as argument to these functions: + +\begin{verbatim} + enum WeekFlags + { + Default_First, // Sunday_First for US, Monday_First for the rest + Monday_First, // week starts with a Monday + Sunday_First // week starts with a Sunday + }; +\end{verbatim} + \wxheading{Derived from} No base class @@ -106,7 +177,7 @@ No base class \wxheading{See also} -%\helpref{Date classes overview}{wxdatetimeoverview},\rtfsp +\helpref{Date classes overview}{wxdatetimeoverview},\rtfsp wxTimeSpan,\rtfsp wxDateSpan,\rtfsp \helpref{wxCalendarCtrl}{wxcalendarctrl} @@ -120,6 +191,10 @@ either set or return the static variables of wxDateSpan (the country), return the current moment, year, month or number of days in it, or do some general calendar-related actions. +Please note that although several function accept an extra {\it Calendar} +parameter, it is currently ignored as only the Gregorian calendar is +supported. Future versions will support other calendars. + \helpref{SetCountry}{wxdatetimesetcountry}\\ \helpref{GetCountry}{wxdatetimegetcountry}\\ \helpref{IsWestEuropeanCountry}{wxdatetimeiswesteuropeancountry}\\ @@ -141,19 +216,193 @@ calendar-related actions. \membersection{Constructors, assignment operators and setters} +Constructors and various {\tt Set()} methods are collected here. If you +construct a date object from separate values for day, month and year, you +should use \helpref{IsValid}{wxdatetimeisvalid} method to check that the +values were correct as constructors can not return an error code. + +\helpref{wxDateTime()}{wxdatetimewxdatetimedef}\\ +\helpref{wxDateTime(time\_t)}{wxdatetimewxdatetimetimet}\\ +\helpref{wxDateTime(struct tm)}{wxdatetimewxdatetimetm}\\ +%\helpref{wxDateTime(struct Tm)}{wxdatetimewxdatetimetm} - Tm not documented yet\\ +\helpref{wxDateTime(double jdn)}{wxdatetimewxdatetimejdn}\\ +\helpref{wxDateTime(h, m, s, ms)}{wxdatetimewxdatetimetime}\\ +\helpref{wxDateTime(day, mon, year, h, m, s, ms)}{wxdatetimewxdatetimedate}\\ +\helpref{SetToCurrent}{wxdatetimesettocurrent}\\ +\helpref{Set(time\_t)}{wxdatetimesettimet}\\ +\helpref{Set(struct tm)}{wxdatetimesettm}\\ +%\helpref{Set(struct Tm)}{wxdatetimesettm} - Tm not documented yet\\ +\helpref{Set(double jdn)}{wxdatetimesetjdn}\\ +\helpref{Set(h, m, s, ms)}{wxdatetimesettime}\\ +\helpref{Set(day, mon, year, h, m, s, ms)}{wxdatetimesetdate}\\ +\helpref{ResetTime}{wxdatetimeresettime}\\ +\helpref{SetYear}{wxdatetimesetyear}\\ +\helpref{SetMonth}{wxdatetimesetmonth}\\ +\helpref{SetDay}{wxdatetimesetdate}\\ +\helpref{SetHour}{wxdatetimesethour}\\ +\helpref{SetMinute}{wxdatetimesetminute}\\ +\helpref{SetSecond}{wxdatetimesetsecond}\\ +\helpref{SetMillisecond}{wxdatetimesetmillisecond}\\ +\helpref{operator$=$(time\_t)}{wxdatetimeoperatoreqtimet}\\ +\helpref{operator$=$(struct tm)}{wxdatetimeoperatoreqtm} +%\helpref{operator$=$(struct Tm)}{wxdatetimeoperatortm2} + \membersection{Accessors} +Here are the trivial accessors. Other functions, which might have to perform +some more complicated calculations to find the answer are under +\helpref{Calendar calculations}{wxdatetimecalculations} section. + +\helpref{IsValid}{wxdatetimeisvalid}\\ +\helpref{GetTicks}{wxdatetimegetticks}\\ +\helpref{GetYear}{wxdatetimegetyear}\\ +\helpref{GetMonth}{wxdatetimegetmonth}\\ +\helpref{GetDay}{wxdatetimegetday}\\ +\helpref{GetWeekDay}{wxdatetimegetweekday}\\ +\helpref{GetHour}{wxdatetimegethour}\\ +\helpref{GeTMinute}{wxdatetimegetminute}\\ +\helpref{GetSecond}{wxdatetimegetsecond}\\ +\helpref{GetMillisecond}{wxdatetimegetmillisecond}\\ +\helpref{GetDayOfYear}{wxdatetimegetdayofyear}\\ +\helpref{GetWeekOfYear}{wxdatetimegetweekofyear}\\ +\helpref{GetWeekOfMonth}{wxdatetimegetweekofmonth}\\ +\helpref{GetYearDay}{wxdatetimegetyearday}\\ +\helpref{IsWorkDay}{wxdatetimeisworkday}\\ +\helpref{IsGregorianDate}{wxdatetimeisgregoriandate} + \membersection{Date comparison} +There are several function to allow date comparison. To supplement them, a few +global operators $>$, $<$ etc taking wxDateTime are defined. + +\helpref{IsEqualTo}{wxdatetimeisequalto}\\ +\helpref{IsEarlierThan}{wxdatetimeisearlierthan}\\ +\helpref{IsLaterThan}{wxdatetimeislaterthan}\\ +\helpref{IsStrictlyBetween}{wxdatetimeisstrictlybetween}\\ +\helpref{IsBetween}{wxdatetimeisbetween}\\ +\helpref{IsSameDate}{wxdatetimeissamedate}\\ +\helpref{IsSameTime}{wxdatetimeissametime}\\ +\helpref{IsEqualUpTo}{wxdatetimeisequalupto} + \membersection{Date arithmetics} +These functions carry out \helpref{arithmetics}{tdatearithm} on the wxDateTime +objects. As explained in the overview, either wxTimeSpan or wxDateSpan may be +added to wxDateTime, hence all functions are overloaded to accept both +arguments. + +Also, both {\tt Add()} and {\tt Substract()} have both const and non-const +version. The first one returns a new obejct which represents the +sum/difference of the original one with the argument while the second form +modifies the object to which it is applied. The operators $-=$ and $+=$ are +defined to be equivalent to the second forms of these functions. + +\helpref{Add(wxTimeSpan)}{wxdatetimeaddts}\\ +\helpref{Add(wxDateSpan)}{wxdatetimeaddds}\\ +\helpref{Substract(wxTimeSpan)}{wxdatetimesubstractts}\\ +\helpref{Substract(wxDateSpan)}{wxdatetimesubstractds}\\ +\helpref{Substract(wxDateTime)}{wxdatetimesubstractdt}\\ +\helpref{oparator$+=$(wxTimeSpan)}{wxdatetimeaddts}\\ +\helpref{oparator$+=$(wxDateSpan)}{wxdatetimeaddds}\\ +\helpref{oparator$-=$(wxTimeSpan)}{wxdatetimesubstractts}\\ +\helpref{oparator$-=$(wxDateSpan)}{wxdatetimesubstractds} + \membersection{Parsing and formatting dates} -\membersection{Calendar calculations} +These functions perform convert wxDateTime obejcts to and from text. The +conversions to text are mostly trivial: you can either do it using the default +date and time representations for the current locale ( +\helpref{FormatDate}{wxdatetimeformatdate} and +\helpref{FormatTime}{wxdatetimeformattime}), using the international standard +representation defined by ISO 8601 ( +\helpref{FormatISODate}{wxdatetimeformatisodate} and +\helpref{FormatISOTime}{wxdatetimeformatisotime}) or by specifying any format +at all and using \helpref{Format}{wxdatetimeformat} directly. + +The conversions from text are more interesting, as there are much more +possibilities to care about. The simples cases can be taken care of with +\helpref{ParseFormat}{wxdatetimeparseformat} which can parse any date in the +given (rigid) format. \helpref{ParseRfc822Date}{wxdatetimeparserfc822date} is +another function for parsing dates in predefined format - the one of RFC 822 +which (still...) defines the format of email messages on the Internet. This +format can not be described with {\tt strptime(3)}-like format strings used by +\helpref{Format}{wxdatetimeformat}, hence the need for a separate function. + +But the most interesting functions are +\helpref{ParseDateTime}{wxdatetimeparsedatetime} and +\helpref{ParseDate}{wxdatetimeparsedate} and +\helpref{ParseTime}{wxdatetimeparsetime}. They try to parse the date ans time +(or only one of them) in `free' format, i.e. allow them to be specified in any +of possible ways. These functions will usually be used to parse the +(interactive) user input which is not bound to be in any predefined format. As +an example, \helpref{ParseDateTime}{wxdatetimeparsedatetime} can parse the +strings such as {\tt "tomorrow"}, {\tt "March first"}, {\tt "next Sunday"}. + +\helpref{ParseRfc822Date}{wxdatetimeparserfc822date}\\ +\helpref{ParseFormat}{wxdatetimeparseformat}\\ +\helpref{ParseDateTime}{wxdatetimeparsedatetime}\\ +\helpref{ParseDate}{wxdatetimeparsedate}\\ +\helpref{ParseTime}{wxdatetimeparsetime}\\ +\helpref{Format}{wxdatetimeformat}\\ +\helpref{FormatDate}{wxdatetimeformatdate}\\ +\helpref{FormatTime}{wxdatetimeformattime}\\ +\helpref{FormatISODate}{wxdatetimeformatisodate}\\ +\helpref{FormatISOTime}{wxdatetimeformatisotime} + +\membersection{Calendar calculations}\label{wxdatetimecalculations} + +The functions in this section perform the basic calendar calculations, mostly +related to the week days. They allow to find the given week day in the +week with given number (either in the month or in the year) and so on. + +All (non-const) functions in this section don't modify the time part of the +wxDateTime - they only work with the date part of it. + +\helpref{SetToWeekDayInSameWeek}{wxdatetimesettoweekdayinsameweek}\\ +\helpref{GetWeekDayInSameWeek}{wxdatetimegetweekdayinsameweek}\\ +\helpref{SetToNextWeekDay}{wxdatetimesettonextweekday}\\ +\helpref{GetNextWeekDay}{wxdatetimegetnextweekday}\\ +\helpref{SetToPrevWeekDay}{wxdatetimesettoprevweekday}\\ +\helpref{GetPrevWeekDay}{wxdatetimegetprevweekday}\\ +\helpref{SetToWeekDay}{wxdatetimesettoweekday}\\ +\helpref{GetWeekDay}{wxdatetimegetweekday}\\ +\helpref{SetToLastWeekDay}{wxdatetimesettolastweekday}\\ +\helpref{GetLastWeekDay}{wxdatetimegetlastweekday}\\ +\helpref{SetToTheWeek}{wxdatetimesettotheweek}\\ +\helpref{GetWeek}{wxdatetimegetweek}\\ +\helpref{SetToLastMonthDay}{wxdatetimesettolastmonthday}\\ +\helpref{GetLastMonthDay}{wxdatetimegetlastmonthday}\\ +\helpref{SetToYearDay}{wxdatetimesettoyearday}\\ +\helpref{GetYearDay}{wxdatetimegetyearday} \membersection{Astronomical/historical functions} -\membersection{Time zone support} +Some degree of support for the date units used in astronomy and/or history is +provided. You can construct a wxDateTime object from a +\helpref{JDN}{wxdatetimesetjdn} and you may also get its JDN, +\helpref{MJD}{wxdatetimegetmodifiedjuliandaynumber} or +\helpref{Rata Die number}{wxdatetimegetratadie} from it. + +\helpref{wxDateTime(double jdn)}{wxdatetimewxdatetimejdn}\\ +\helpref{Set(double jdn)}{wxdatetimesetjdn} +\helpref{GetJulianDayNumber}{wxdatetimegetjuliandaynumber}\\ +\helpref{GetJDN}{wxdatetimegetjdn}\\ +\helpref{GetModifiedJulianDayNumber}{wxdatetimegetmodifiedjuliandaynumber}\\ +\helpref{GetMJD}{wxdatetimegetmjd}\\ +\helpref{GetRataDie}{wxdatetimegetratadie} + +\membersection{Time zone and DST support} + +Please see the \helpref{time zone overview}{tdatetimezones} for more +information about time zones. ormally, these functions should be rarely used. + +\helpref{ToTimezone}{wxdatetimetotimezone}\\ +\helpref{MakeTimezone}{wxdatetimemaketimezone}\\ +\helpref{ToGMT}{wxdatetimetogmt}\\ +\helpref{MakeGMT}{wxdatetimemakegmt}\\ +\helpref{GetBeginDST}{wxdatetimegetbegindst}\\ +\helpref{GetEndDST}{wxdatetimegetenddst}\\ +\helpref{IsDST}{wxdatetimeisdst} \helponly{\insertatlevel{2}{ @@ -161,6 +410,8 @@ calendar-related actions. }} +%%%%%%%%%%%%%%%%%%%%%%%%%%% static functions %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + \membersection{wxDateTime::ConvertYearToBC}\label{wxdatetimeconvertyeartobc} \func{static int}{ConvertYearToBC}{\param{int }{year}} @@ -182,65 +433,877 @@ This function should be used like this: \func{static void}{GetAmPmStrings}{\param{wxString *}{am}, \param{wxString *}{pm}} +Returns the translations of the strings {\tt AM} and {\tt PM} used for time +formatting for the current locale. Either of the pointers may be {\tt NULL} if +the corresponding value is not needed. + \membersection{wxDateTime::GetBeginDST}\label{wxdatetimegetbegindst} \func{static wxDateTime}{GetBeginDST}{\param{int }{year = Inv\_Year}, \param{Country }{country = Country\_Default}} +Get the beginning of DST for the given country in the given year (current one +by default). This function suffers from limitations described in +\helpref{DST overview}{tdatedst}. + +\wxheading{See also} + +\helpref{GetEndDST}{wxdatetimegetenddst} + \membersection{wxDateTime::GetCountry}\label{wxdatetimegetcountry} \func{static Country}{GetCountry}{\void} +Returns the current default country. The default country is used for DST +calculations, for example. + +\wxheading{See also} + +\helpref{SetCountry}{wxdatetimesetcountry} + \membersection{wxDateTime::GetCurrentYear}\label{wxdatetimegetcurrentyear} \func{static int}{GetCurrentYear}{\param{Calendar }{cal = Gregorian}} +Get the current year in given calendar (only Gregorian is currently supported). + \membersection{wxDateTime::GetCurrentMonth}\label{wxdatetimegetcurrentmonth} \func{static Month}{GetCurrentMonth}{\param{Calendar }{cal = Gregorian}} +Get the current month in given calendar (only Gregorian is currently supported). + \membersection{wxDateTime::GetCentury}\label{wxdatetimegetcentury} \func{static int}{GetCentury}{\param{int }{year = Inv\_Year}} +Get the current century, i.e. first two digits of the year, in given calendar +(only Gregorian is currently supported). + \membersection{wxDateTime::GetEndDST}\label{wxdatetimegetenddst} \func{static wxDateTime}{GetEndDST}{\param{int }{year = Inv\_Year}, \param{Country }{country = Country\_Default}} +Returns the end of DST for the given country in the given year (current one by +default). + +\wxheading{See also} + +\helpref{GetBeginDST}{wxdatetimegetbegindst} + \membersection{wxDateTime::GetMonthName}\label{wxdatetimegetmonthname} \func{static wxString}{GetMonthName}{\param{Month }{month}, \param{NameFlags }{flags = Name\_Full}} +Gets the full (default) or abbreviated (specify {\tt Name\_Abbr} name of the +given month. + +\wxheading{See also} + +\helpref{GetWeekDayName}{wxdatetimegetweekdayname} + \membersection{wxDateTime::GetNumberOfDays}\label{wxdatetimegetnumberofdays} \func{static wxDateTime\_t}{GetNumberOfDays}{\param{int }{year}, \param{Calendar }{cal = Gregorian}} \func{static wxDateTime\_t}{GetNumberOfDays}{\param{Month }{month}, \param{int }{year = Inv\_Year}, \param{Calendar }{cal = Gregorian}} +Returns the number of days in the given year or in the given month of the +year. + +The only supported value for {\it cal} parameter is currently {\tt Gregorian}. + \membersection{wxDateTime::GetWeekDayName}\label{wxdatetimegetweekdayname} \func{static wxString}{GetWeekDayName}{\param{WeekDay }{weekday}, \param{NameFlags }{flags = Name\_Full}} +Gets the full (default) or abbreviated (specify {\tt Name\_Abbr} name of the +given week day. + +\wxheading{See also} + +\helpref{GetMonthName}{wxdatetimegetmonthname} + \membersection{wxDateTime::IsLeapYear}\label{wxdatetimeisleapyear} \func{static bool}{IsLeapYear}{\param{int }{year = Inv\_Year}, \param{Calendar }{cal = Gregorian}} +Returns {\tt TRUE} if the {\it year} is a leap one in the specified calendar. + +This functions supports Gregorian and Julian calendars. + \membersection{wxDateTime::IsWestEuropeanCountry}\label{wxdatetimeiswesteuropeancountry} \func{static bool}{IsWestEuropeanCountry}{\param{Country }{country = Country\_Default}} +This function returns {\tt TRUE} if the specified (or default) country is one +of Western European ones. It is used internally by wxDateTime to determine the +DST convention and date and time formatting rules. + \membersection{wxDateTime::IsDSTApplicable}\label{wxdatetimeisdstapplicable} \func{static bool}{IsDSTApplicable}{\param{int }{year = Inv\_Year}, \param{Country }{country = Country\_Default}} +Returns {\tt TRUE} if DST was usedi n the given year (the current one by +default) in the given country. + \membersection{wxDateTime::Now}\label{wxdatetimenow} \func{static wxDateTime}{Now}{\void} +Returns the object corresopnding to the current time. + +Example: + +\begin{verbatim} + wxDateTime now = wxDateTime::Now(); + printf("Current time in Paris:\t%s\n", now.Format("%c", wxDateTime::CET).c_str()); +\end{verbatim} + +\wxheading{See also} + +\helpref{Today}{wxdatetimetoday} + \membersection{wxDateTime::SetCountry}\label{wxdatetimesetcountry} \func{static void}{SetCountry}{\param{Country }{country}} +Sets the country to use by default. This setting influences the DST +calculations, date formatting and other things. + +The possible values for {\it country} parameter are enumerated +\helpref{here}{wxdatetimecountry}. + +\wxheading{See also} + +\helpref{GetCountry}{wxdatetimegetcountry} + \membersection{wxDateTime::Today}\label{wxdatetimetoday} \func{static wxDateTime}{Today}{\void} +Returns the object corresponding to the midnight of the current day (i.e. the +same as \helpref{Now()}{wxdatetimenow}, but the time part is set to $0$). + +\wxheading{See also} + +\helpref{Now}{wxdatetimenow} + +%%%%%%%%%%%%%%%%%%%%%%%%%%% constructors &c %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\membersection{wxDateTime::wxDateTime}\label{wxdatetimewxdatetimedef} + +\func{}{wxDateTime}{\void} + +Default constructor. Use one of {\tt Set()} functions to initialize the object +later. + +\membersection{wxDateTime::wxDateTime}{wxdatetimewxdatetime} + +\func{wxDateTime\&}{wxDateTime}{\param{time\_t }{timet}} + +Same as \helpref{Set}{wxdatetimewxdatetimetimet}. + +\membersection{wxDateTime::wxDateTime}{wxdatetimewxdatetimetm} + +\func{wxDateTime\&}{wxDateTime}{\param{const struct tm\& }{tm}} + +Same as \helpref{Set}{wxdatetimewxdatetimetm} + +\membersection{wxDateTime::wxDateTime}{wxdatetimewxdatetimejdn} + +\func{wxDateTime\&}{wxDateTime}{\param{double }{jdn}} + +Same as \helpref{Set}{wxdatetimewxdatetimejdn} + +\membersection{wxDateTime::wxDateTime}{wxdatetimewxdatetimetime} + +\func{wxDateTime\&}{wxDateTime}{\param{wxDateTime\_t }{hour}, \param{wxDateTime\_t }{minute = 0}, \param{wxDateTime\_t }{second = 0}, \param{wxDateTime\_t }{millisec = 0}} + +Same as \helpref{Set}{wxdatetimewxdatetimetime} + +\membersection{wxDateTime::wxDateTime}{wxdatetimewxdatetimedate} + +\func{wxDateTime\&}{wxDateTime}{\param{wxDateTime\_t }{day}, \param{Month }{month = Inv\_Month}, \param{wxDateTime\_t }{hour = 0}, \param{wxDateTime\_t }{minute = 0}, \param{wxDateTime\_t }{second = 0}, \param{wxDateTime\_t }{millisec = 0}} + +Same as \helpref{Set}{wxdatetimesetdate} + +\membersection{wxDateTime::SetToCurrent}{wxdatetimesettocurrent} + +\func{wxDateTime&}{SetToCurrent}{\void} + +Sets the date and time of to the current values. Same as assigning the result +of \helpref{Now()}{wxdatetimenow} to this object. + +\membersection{wxDateTime::Set}{wxdatetimesettimet} + +\func{wxDateTime\&}{Set}{\param{time\_t }{timet}} + +Constructs the object from {\it timet} value holding the number of seconds +since Jan 1, 1970. + +\membersection{wxDateTime::Set}{wxdatetimesettm} + +\func{wxDateTime\&}{Set}{\param{const struct tm\& }{tm}} + +Sets the date and tiem from the broken down representation in the standard +{\tt tm} structure. + +\membersection{wxDateTime::Set}{wxdatetimesetjdn} + +\func{wxDateTime\&}{Set}{\param{double }{jdn}} + +Sets the date from the so-called {\it Julian Day Number}. + +By definition, the Julian Day Number, usually abbreviated as JDN, of a +particular instant is the fractional number of days since 12 hours Universal +Coordinated Time (Greenwhich mean noon) on January 1 of the year -4712 in the +Julian proleptic calendar. + +\membersection{wxDateTime::Set}{wxdatetimesettime} + +\func{wxDateTime\&}{Set}{\param{wxDateTime\_t }{hour}, \param{wxDateTime\_t }{minute = 0}, \param{wxDateTime\_t }{second = 0}, \param{wxDateTime\_t }{millisec = 0}} + +Sets the date to be equal to \helpref{Today}{wxdatetimetoday} and the time +from supplied parameters. + +\membersection{wxDateTime::Set}{wxdatetimesetdate} + +\func{wxDateTime\&}{Set}{\param{wxDateTime\_t }{day}, \param{Month }{month = Inv\_Month}, \param{wxDateTime\_t }{hour = 0}, \param{wxDateTime\_t }{minute = 0}, \param{wxDateTime\_t }{second = 0}, \param{wxDateTime\_t }{millisec = 0}} + +Sets the date and time from the parameters. + +\membersection{wxDateTime::ResetTime}{wxdatetimeresettime} + +\func{wxDateTime\&}{ResetTime}{\void} + +Reset time to midnight (00:00:00) without changing the date. + +\membersection{wxDateTime::SetYear}{wxdatetimesetyear} + +\func{wxDateTime\&}{SetYear}{\param{int }{year}} + +Sets the year without changing other date components. + +\membersection{wxDateTime::SetMonth}{wxdatetimesetmonth} + +\func{wxDateTime\&}{SetMonth}{\param{Month }{month}} + +Sets the month without changing other date components. + +\membersection{wxDateTime::SetDay}{wxdatetimesetday} + +\func{wxDateTime\&}{SetDay}{\param{wxDateTime\_t }{day}} + +Sets the day without changing other date components. + +\membersection{wxDateTime::SetHour}{wxdatetimesethour} + +\func{wxDateTime\&}{SetHour}{\param{wxDateTime\_t }{hour}} + +Sets the hour without changing other date components. + +\membersection{wxDateTime::SetMinute}{wxdatetimesetminute} + +\func{wxDateTime\&}{SetMinute}{\param{wxDateTime\_t }{minute}} + +Sets the minute without changing other date components. + +\membersection{wxDateTime::SetSecond}{wxdatetimesetsecond} + +\func{wxDateTime\&}{SetSecond}{\param{wxDateTime\_t }{second}} + +Sets the second without changing other date components. + +\membersection{wxDateTime::SetMillisecond}{wxdatetimesetmillisecond} + +\func{wxDateTime\&}{SetMillisecond}{\param{wxDateTime\_t }{millisecond}} + +Sets the millisecond without changing other date components. + +\membersection{wxDateTime::operator$=$}{wxdatetimeoperatoreqtimet} + +\func{wxDateTime\&}{operator}{\param{time\_t }{timet}} + +Same as \helpref{Set}{wxdatetimesettimet}. + +\membersection{wxDateTime::operator$=$}{wxdatetimeoperatoreqtm} + +\func{wxDateTime\&}{operator}{\param{const struct tm\& }{tm}} + +Same as \helpref{Set}{wxdatetimesettm}. + +%%%%%%%%%%%%%%%%%%%%%%%%%%% accessors %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\membersection{wxDateTime::IsValid}{wxdatetimeisvalid} + +\constfunc{bool}{IsValid}{\void} + +Returns {\tt TRUE} if the object represents a valid time moment. + +\membersection{wxDateTime::GetTm}{wxdatetimegettm} + +\constfunc{Tm}{GetTm}{\param{const TimeZone\& }{tz = Local}} + +Returns broken down representation of the date and time. + +\membersection{wxDateTime::GetTicks}{wxdatetimegetticks} + +\constfunc{time\_t}{GetTicks}{\void} + +Returns the number of seconds since Jan 1, 1970. An assert failure will occur +if the date is not in the range covered by {\tt time\_t} type. + +\membersection{wxDateTime::GetYear}{wxdatetimegetyear} + +\constfunc{int}{GetYear}{\param{const TimeZone\& }{tz = Local}} + +Returns the year in the given timezone (local one by default). + +\membersection{wxDateTime::GetMonth}{wxdatetimegetmonth} + +\constfunc{Month}{GetMonth}{\param{const TimeZone\& }{tz = Local}} + +Returns the month in the given timezone (local one by default). + +\membersection{wxDateTime::GetDay}{wxdatetimegetday} + +\constfunc{wxDateTime\_t}{GetDay}{\param{const TimeZone\& }{tz = Local}} + +Returns the day in the given timezone (local one by default). + +\membersection{wxDateTime::GetWeekDay}{wxdatetimegetweekday} + +\constfunc{WeekDay}{GetWeekDay}{\param{const TimeZone\& }{tz = Local}} + +Returns the week day in the given timezone (local one by default). + +\membersection{wxDateTime::GetHour}{wxdatetimegethour} + +\constfunc{wxDateTime\_t}{GetHour}{\param{const TimeZone\& }{tz = Local}} + +Returns the hour in the given timezone (local one by default). + +\membersection{wxDateTime::GetMinute}{wxdatetimegetminute} + +\constfunc{wxDateTime\_t}{GetMinute}{\param{const TimeZone\& }{tz = Local}} + +Returns the minute in the given timezone (local one by default). + +\membersection{wxDateTime::GetSecond}{wxdatetimegetsecond} + +\constfunc{wxDateTime\_t}{GetSecond}{\param{const TimeZone\& }{tz = Local}} + +Returns the seconds in the given timezone (local one by default). + +\membersection{wxDateTime::GetMillisecond}{wxdatetimegetmillisecond} + +\constfunc{wxDateTime\_t}{GetMillisecond}{\param{const TimeZone\& }{tz = Local}} + +Returns the milliseconds in the given timezone (local one by default). + +\membersection{wxDateTime::GetDayOfYear}{wxdatetimegetdayofyear} + +\constfunc{wxDateTime\_t}{GetDayOfYear}{\param{const TimeZone\& }{tz = Local}} + +Returns the day of the year (in $1\ldots366$ range) in the given timezone +(local one by default). + +\membersection{wxDateTime::GetWeekOfYear}{wxdatetimegetweekofyear} + +\constfunc{wxDateTime\_t}{GetWeekOfYear}{\param{WeekFlags }{flags = Monday\_First}, \param{const TimeZone\& }{tz = Local}} + +Returns the number of the week of the year this date is in. The first week of +the year is, according to international standards, the one containing Jan 4. +The week number is in $1\ldots53$ range ($52$ for non leap years). + +The function depends on the \helpref{week start}{wxdatetimeweekstart} convention +specified by the {\it flags} argument. + +\membersection{wxDateTime::GetWeekOfMonth}{wxdatetimegetweekofmonth} + +\constfunc{wxDateTime\_t}{GetWeekOfMonth}{\param{WeekFlags }{flags = Monday\_First}, \param{const TimeZone\& }{tz = Local}} + +Returns the ordinal number of the week in the month (in $1\ldots5$ range). + +As \helpref{GetWeekOfYear}{wxdatetimegetweekofyear}, this function supports +both conventions for the week start. See the description of these +\helpref{week start}{wxdatetimeweekstart} conventions. + +\membersection{wxDateTime::IsWorkDay}{wxdatetimeisworkday} + +\constfunc{bool}{IsWorkDay}{\param{Country }{country = Country\_Default}} + +Returns {\tt TRUE} is this day is not a holiday in the given country. + +\membersection{wxDateTime::IsGregorianDate}{wxdatetimeisgregoriandate} + +\constfunc{bool}{IsGregorianDate}{\param{GregorianAdoption }{country = Gr\_Standard}} + +Returns {\tt TRUE} if the given date os later than the date of adoption of the +Gregorian calendar in the given country (and hence the Gregorian calendar +calculations make sense for it). + +%%%%%%%%%%%%%%%%%%%%%%%%%%% comparison %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\membersection{wxDateTime::IsEqualTo}{wxdatetimeisequalto} + +\constfunc{bool}{IsEqualTo}{\param{const wxDateTime& }{datetime}} + +Returns {\tt TRUE} if the two dates are strictly identical. + +\membersection{wxDateTime::IsEarlierThan}{wxdatetimeisearlierthan} + +\constfunc{bool}{IsEarlierThan}{\param{const wxDateTime& }{datetime}} + +Returns {\tt TRUE} if this date precedes the given one. + +\membersection{wxDateTime::IsLaterThan}{wxdatetimeislaterthan} + +\constfunc{bool}{IsLaterThan}{\param{const wxDateTime& }{datetime}} + +Returns {\tt TRUE} if this date is later than the given one. + +\membersection{wxDateTime::IsStrictlyBetween}{wxdatetimeisstrictlybetween} + +\constfunc{bool}{IsStrictlyBetween}{\param{const wxDateTime& }{t1}, \param{const wxDateTime& }{t2}} + +Returns {\tt TRUE} if this date lies strictly between the two others, + +\wxheading{See also} + +\helpref{IsBetween}{wxdatetimeisbetween} + +\membersection{wxDateTime::IsBetween}{wxdatetimeisbetween} + +\constfunc{bool}{IsBetween}{\param{const wxDateTime& }{t1}, \param{const wxDateTime& }{t2}} + +Returns {\tt TRUE} if \helpref{IsStrictlyBetween}{wxdatetimeisstrictlybetween} +is {\tt TRUE} or if the date is equal to one of the limi values. + +\wxheading{See also} + +\helpref{IsStrictlyBetween}{wxdatetimeisstrictlybetween} + +\membersection{wxDateTime::IsSameDate}{wxdatetimeissamedate} + +\constfunc{bool}{IsSameDate}{\param{const wxDateTime& }{dt}} + +Returns {\tt TRUE} if the date is the same without comparing the time parts. + +\membersection{wxDateTime::IsSameTime}{wxdatetimeissametime} + +\constfunc{bool}{IsSameTime}{\param{const wxDateTime& }{dt}} + +Returns {\tt TRUE} if the time is the same (although dates may differ). + +\membersection{wxDateTime::IsEqualUpTo}{wxdatetimeisequalupto} + +\constfunc{bool}{IsEqualUpTo}{\param{const wxDateTime\& }{dt}, \param{const wxTimeSpan\& }{ts}} + +Returns {\tt TRUE} if the date is equal to another one up to the given time +interval, i.e. if the absolute difference between the two dates is less than +this interval. + +%%%%%%%%%%%%%%%%%%%%%%%%%%% arithmetics %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\membersection{wxDateTime::Add}{wxdatetimeaddts} + +\constfunc{wxDateTime}{Add}{\param{const wxTimeSpan\& }{diff}} + +\func{wxDateTime\&}{Add}{\param{const wxTimeSpan\& }{diff}} + +\func{wxDateTime\&}{operator$+=$}{\param{const wxTimeSpan\& }{diff}} + +Adds the given time span to this object. + +\membersection{wxDateTime::Substract}{wxdatetimesubstract} + +\constfunc{wxDateTime}{Substract}{\param{const wxTimeSpan\& }{diff}} + +\func{wxDateTime\&}{Substract}{\param{const wxTimeSpan\& }{diff}} + +\func{wxDateTime\&}{operator$-=$}{\param{const wxTimeSpan\& }{diff}} + +Substracts the given time span from this object. + +\membersection{wxDateTime::Add}{wxdatetimeadd} + +\constfunc{wxDateTime}{Add}{\param{const wxDateSpan\& }{diff}} + +\func{wxDateTime\&}{Add}{\param{const wxDateSpan\& }{diff}} + +\func{wxDateTime\&}{operator$+=$}{\param{const wxDateSpan\& }{diff}} + +Adds the given date span to this object. + +\membersection{wxDateTime::Substract}{wxdatetimesubstract} + +\constfunc{wxDateTime}{Substract}{\param{const wxDateSpan\& }{diff}} + +\func{wxDateTime\&}{Substract}{\param{const wxDateSpan\& }{diff}} + +\func{wxDateTime\&}{operator$-=$}{\param{const wxDateSpan\& }{diff}} + +Substracts the given date span from this object. + +\membersection{wxDateTime::Substract}{wxdatetimesubstract} + +\constfunc{wxTimeSpan}{Substract}{\param{const wxDateTime\& }{dt}} + +Substracts another date from this one and returns the difference between them +as wxTimeSpan. + +%%%%%%%%%%%%%%%%%%%%%%%%%%% parsing/formatting %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\membersection{wxDateTime::ParseRfc822Date}{wxdatetimeparserfc822date} + +\func{const wxChar *}{ParseRfc822Date}{\param{const wxChar* }{date}} + +Parses the string {\it date} looking for a date formatted according to the RFC +822 in it. The exact description of this format may, of course, be found in +the RFC (section $5$), but, briefly, this is the format used in the headers of +Internet email messages and one of the most common strings expressing date in +this format may be something like {\tt "Sat, 18 Dec 1999 00:48:30 +0100"}. + +Returns {\tt NULL} if the conversion failed, otherwise return the pointer to +the character immediately following the part of the string which could be +parsed. If the entire string contains only the date in RFC 822 format, +the returned pointer will be pointing to a {\tt NUL} character. + +This function is intenionally strict, it will return an error for any string +which is not RFC 822 compliant. If you need to parse date formatted in more +free ways, you should use \helpref{ParseDateTime}{wxdatetimeparsedatetime} or +\helpref{ParseDate}{wxdatetimeparsedate} instead. + +\membersection{wxDateTime::ParseFormat}{wxdatetimeparseformat} + +\func{const wxChar *}{ParseFormat}{\param{const wxChar *}{date}, \param{const wxChar *}{format = "\%c"}, \param{const wxDateTime\& }{dateDef = wxDefaultDateTime}} + +This function parses the string {\it date} according to the given +{\it format}. The system {\tt strptime(3)} function is used whenever available, +but even if it is not, this function is still implemented (although support +for locale-dependent format specificators such as {\tt "\%c"}, {\tt "\%x"} or +{\tt "\%X"} may be not perfect). This function does handle the month and +weekday names in the current locale on all platforms, however. + +Please the description of ANSI C function {\tt strftime(3)} for the syntax of +the format string. + +The {\it dateDef} parameter is used to fill in the fields which could not be +determined from the format string. For example, if the format is {\tt "\%d"} +(the day of the month), the month and the year are taken from {\it dateDef}. +If it is not specified, \helpref{Today}{wxdatetimetoday} is used as the +default date. + +Returns {\tt NULL} if the conversion failed, otherwise return the pointer to +the character which stopped the scan. + +\membersection{wxDateTime::ParseDateTime}{wxdatetimeparsedatetime} + +\func{const wxChar *}{ParseDateTime}{\param{const wxChar *}{datetime}} + +Parses the string {\it datetime} containing the date and time in free format. +This function tries as hard as it can to interpret the given string as date +and time. Unlike \helpref{ParseRfc822Date}{wxdatetimeparserfc822date}, it +will accept anything that may be accepted and will only reject strings which +can not be parsed in any way at all. + +Returns {\tt NULL} if the conversion failed, otherwise return the pointer to +the character which stopped the scan. + +\membersection{wxDateTime::ParseDate}{wxdatetimeparsedate} + +\func{const wxChar *}{ParseDate}{\param{const wxChar *}{date}} + +This function is like \helpref{ParseDateTime}{wxdatetimeparsedatetime}, but it +only allows the date to be specified. It is thus flexible then +\helpref{ParseDateTime}{wxdatetimeparsedatetime}, but also has less chances to +misinterpret the user input. + +Returns {\tt NULL} if the conversion failed, otherwise return the pointer to +the character which stopped the scan. + +\membersection{wxDateTime::ParseTime}{wxdatetimeparsetime} + +\func{const wxChar *}{ParseTime}{\param{const wxChar *}{time}} + +This functions is like \helpref{ParseDateTime}{wxdatetimeparsedatetime}, but +only allows the time to be specified in the input string. + +Returns {\tt NULL} if the conversion failed, otherwise return the pointer to +the character which stopped the scan. + +\membersection{wxDateTime::Format}{wxdatetimeformat} + +\constfunc{wxString }{Format}{\param{const wxChar *}{format = "\%c"}, \param{const TimeZone\& }{tz = Local}} + +This function does the same as the standard ANSI C {\tt strftime(3)} function. +Please see its description for the meaning of {\it format} parameter. + +\wxheading{See also} + +\helpref{ParseFormat}{wxdatetimeparseformat} + +\membersection{wxDateTime::FormatDate}{wxdatetimeformatdate} + +\constfunc{wxString }{FormatDate}{\void} + +Identical to calling \helpref{Format()}{wxdatetimeformat} with {\tt "\%x"} +argument (which means `preferred date representation for the current locale'). + +\membersection{wxDateTime::FormatTime}{wxdatetimeformattime} + +\constfunc{wxString }{FormatTime}{\void} + +Identical to calling \helpref{Format()}{wxdatetimeformat} with {\tt "\%X"} +argument (which means `preferred time representation for the current locale'). + +\membersection{wxDateTime::FormatISODate}{wxdatetimeformatisodate} + +\constfunc{wxString }{FormatISODate}{\void} + +This function returns the date representation in the ISO 8601 format +(YYYY-MM-DD). + +\membersection{wxDateTime::FormatISOTime}{wxdatetimeformatisotime} + +\constfunc{wxString }{FormatISOTime}{\void} + +This function returns the time representation in the ISO 8601 format +(HH:MM:SS). + +%%%%%%%%%%%%%%%%%%%%%%%%%%% calendar calculations %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\membersection{wxDateTime::SetToWeekDayInSameWeek}{wxdatetimesettoweekdayinsameweek} + +\func{wxDateTime\&}{SetToWeekDayInSameWeek}{\param{WeekDay }{weekday}} + +Adjusts the date so that it will still lie in the same week as before, but its +week day will be the given one. + +Returns the reference to the modified object itself. + +\membersection{wxDateTime::GetWeekDayInSameWeek}{wxdatetimegetweekdayinsameweek} + +\constfunc{wxDateTime}{GetWeekDayInSameWeek}{\param{WeekDay }{weekday}} + +Returns the copy of this object to which +\helpref{SetToWeekDayInSameWeek}{wxdatetimesettoweekdayinsameweek} was +applied. + +\membersection{wxDateTime::SetToNextWeekDay}{wxdatetimesettonextweekday} + +\func{wxDateTime\&}{SetToNextWeekDay}{\param{WeekDay }{weekday}} + +Sets the date so that it will be the first {\it weekday} following the current +date. + +Returns the reference to the modified object itself. + +\membersection{wxDateTime::GetNextWeekDay}{wxdatetimegetnextweekday} + +\constfunc{wxDateTime}{GetNextWeekDay}{\param{WeekDay }{weekday}} + +Returns the copy of this object to which +\helpref{SetToNextWeekDay}{wxdatetimesettonextweekday} was applied. + +\membersection{wxDateTime::SetToPrevWeekDay}{wxdatetimesettoprevweekday} + +\func{wxDateTime\&}{SetToPrevWeekDay}{\param{WeekDay }{weekday}} + +Sets the date so that it will be the last {\it weekday} before the current +date. + +Returns the reference to the modified object itself. + +\membersection{wxDateTime::GetPrevWeekDay}{wxdatetimegetprevweekday} + +\constfunc{wxDateTime}{GetPrevWeekDay}{\param{WeekDay }{weekday}} + +Returns the copy of this object to which +\helpref{SetToPrevWeekDay}{wxdatetimesettoprevweekday} was applied. + +\membersection{wxDateTime::SetToWeekDay}{wxdatetimesettoweekday} + +\func{bool}{SetToWeekDay}{\param{WeekDay }{weekday}, \param{int }{n = 1}, \param{Month }{month = Inv\_Month}, \param{int }{year = Inv\_Year}} + +Sets the date to the {\it n}-th {\it weekday} in the given month of the given +year (the current month and year are used by default). The parameter {\it n} +may be either opsitive (counting from the beginning of the month) or negative +(counting from the end of it). + +For example, {\tt SetToWeekDay(2, wxDateTime::Wed)} will set the date to the +second Wednesday in the current month and +{\tt SetToWeekDay(-1, wxDateTime::Sun)} - to the last Sunday in it. + +Returns {\tt TRUE} if the date was modified successfully, {\tt FALSE} +otherwise meaning that the specified date doesn't exist. + +\membersection{wxDateTime::GetWeekDay}{wxdatetimegetweekday} + +\constfunc{wxDateTime}{GetWeekDay}{\param{WeekDay }{weekday}, \param{int }{n = 1}, \param{Month }{month = Inv\_Month}, \param{int }{year = Inv\_Year}} + +Returns the copy of this object to which +\helpref{SetToWeekDay}{wxdatetimesettoweekday} was applied. + +\membersection{wxDateTime::SetToLastWeekDay}{wxdatetimesettolastweekday} + +\func{bool}{SetToLastWeekDay}{\param{WeekDay }{weekday}, \param{Month }{month = Inv\_Month}, \param{int }{year = Inv\_Year}} + +The effect of calling this function is the same as of calling +{\tt SetToWeekDay(-1, weekday, month, year)}. The date will be set to the last +{\it weekday} in the given month and year (the current ones by default). + +Always returns {\tt TRUE}. + +\membersection{wxDateTime::GetLastWeekDay}{wxdatetimegetlastweekday} + +\func{wxDateTime}{GetLastWeekDay}{\param{WeekDay }{weekday}, \param{Month }{month = Inv\_Month}, \param{int }{year = Inv\_Year}} + +Returns the copy of this object to which +\helpref{SetToLastWeekDay}{wxdatetimesettolastweekday} was applied. + +\membersection{wxDateTime::SetToTheWeek}{wxdatetimesettotheweek} + +\func{bool}{SetToTheWeek}{\param{wxDateTime\_t }{numWeek}, \param{WeekDay }{weekday = Mon}} + +Set the date to the given {\it weekday} in the week with given number +{\it numWeek}. The number should be in range $1\ldots53$ and {\tt FALSE} will +be returned if the specified date doesn't exist. {\tt TRUE} is returned if the +date was changed successfully. + +\membersection{wxDateTime::GetWeek}{wxdatetimegetweek} + +\constfunc{wxDateTime}{GetWeek}{\param{wxDateTime\_t }{numWeek}, \param{WeekDay }{weekday = Mon}} + +Returns the copy of this object to which +\helpref{SetToTheWeek}{wxdatetimesettotheweek} was applied. + +\membersection{wxDateTime::SetToLastMonthDay}{wxdatetimesettolastmonthday} + +\func{wxDateTime\&}{SetToLastMonthDay}{\param{Month }{month = Inv\_Month}, \param{int }{year = Inv\_Year}} + +Sets the date to the last day in the specified month (the current one by +default). + +Returns the reference to the modified object itself. + +\membersection{wxDateTime::GetLastMonthDay}{wxdatetimegetlastmonthday} + +\constfunc{wxDateTime}{GetLastMonthDay}{\param{Month }{month = Inv\_Month}, \param{int }{year = Inv\_Year}} + +Returns the copy of this object to which +\helpref{SetToLastMonthDay}{wxdatetimesettolastmonthday} was applied. + +\membersection{wxDateTime::SetToYearDay}{wxdatetimesettoyearday} + +\func{wxDateTime\&}{SetToYearDay}{\param{wxDateTime\_t }{yday}} + +Sets the date to the day number {\it yday} in the same year (i.e., unlike the +other functions, this one does not use the current year). The day number +should be in the range $1\ldots366$ for the leap years and $1\ldots365$ for +the other ones. + +Returns the reference to the modified object itself. + +\membersection{wxDateTime::GetYearDay}{wxdatetimegetyearday} + +\constfunc{wxDateTime}{GetYearDay}{\param{wxDateTime\_t }{yday}} + +Returns the copy of this object to which +\helpref{SetToYearDay}{wxdatetimesettoyearday} was applied. + +%%%%%%%%%%%%%%%%%%%%%%%%%%% astronomical functions %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\membersection{wxDateTime::GetJulianDayNumber}{wxdatetimegetjuliandaynumber} + +\constfunc{double}{GetJulianDayNumber}{\void} + +Returns the \helpref{JDN}{wxdatetimesetjdn} corresponding to this date. Beware +of rounding errors! + +\wxheading{See also} + +\helpref{GetModifiedJulianDayNumber}{wxdatetimegetmodifiedjuliandaynumber} + +\membersection{wxDateTime::GetJDN}{wxdatetimegetjdn} + +\constfunc{double}{GetJDN}{\void} + +Synonym for \helpref{GetJulianDayNumber}{wxdatetimegetjuliandaynumber}. + +\membersection{wxDateTime::GetModifiedJulianDayNumber}{wxdatetimegetmodifiedjuliandaynumber} + +\constfunc{double}{GetModifiedJulianDayNumber}{\void} + +Returns the {\it Modified Julian Day Number} (MJD) which is, by definition, +equal to $JDN - 2400000.5$. The MJDs are simpler to work with as the integral +MJDs correspond to midnights of the dates in the Gregorian calendar and not th +noons like JDN. The MJD $0$ is Nov 17, 1858. + +\membersection{wxDateTime::GetMJD}{wxdatetimegetmjd} + +\constfunc{double}{GetMJD}{\void} + +Synonym for \helpref{GetModifiedJulianDayNumber}{wxdatetimegetmodifiedjuliandaynumber}. + +\membersection{wxDateTime::GetRataDie}{wxdatetimegetratadie} + +\constfunc{double}{GetRataDie}{\void} + +Return the {\it Rata Die number} of this date. + +By definition, the Rata Die number is a date specified as the number of days +relative to a base date of December 31 of the year 0. Thus January 1 of the +year 1 is Rata Die day 1. + +%%%%%%%%%%%%%%%%%%%%%%%%%%% timezone and DST %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\membersection{wxDateTime::ToTimezone}{wxdatetimetotimezone} + +\constfunc{wxDateTime}{ToTimezone}{\param{const TimeZone\& }{tz}, \param{bool }{noDST = FALSE}} + +Transform the date to the given time zone. If {\it noDST} is {\tt TRUE}, no +DST adjustments will be made. + +Returns the date in the new time zone. + +\membersection{wxDateTime::MakeTimezone}{wxdatetimemaketimezone} + +\func{wxDateTime\&}{MakeTimezone}{\param{const TimeZone\& }{tz}, \param{bool }{noDST = FALSE}} + +Modifies the object in place to represent the date in another time zone. If +{\it noDST} is {\tt TRUE}, no DST adjustments will be made. + +\membersection{wxDateTime::ToGMT}{wxdatetimetogmt} + +\constfunc{wxDateTime}{ToGMT}{\param{bool }{noDST = FALSE}} + +This is the same as calling \helpref{ToTimezone}{wxdatetimetotimezone} with +the argument {\tt GMT0}. + +\membersection{wxDateTime::MakeGMT}{wxdatetimemakegmt} + +\func{wxDateTime\&}{MakeGMT}{\param{bool }{noDST = FALSE}} + +This is the same as calling \helpref{MakeTimezone}{wxdatetimemaketimezone} with +the argument {\tt GMT0}. + +\membersection{wxDateTime::IsDST}{wxdatetimeisdst} + +\constfunc{int}{IsDST}{\param{Country }{country = Country\_Default}} + +Returns {\tt TRUE} if the DST is applied for this date in the given country. + +\wxheading{See also} + +\helpref{GetBeginDST}{wxdatetimegetbegindst} and +\helpref{GetEndDST}{wxdatetimegetenddst} + +\section{\class{wxDateTimeHolidayAuthority}}\label{wxdatetimeholidayauthority} + +TODO + +\section{\class{wxDateTimeWorkDays}}\label{wxdatetimeworkdays} + +TODO diff --git a/docs/latex/wx/tdate.tex b/docs/latex/wx/tdate.tex index 600ffe932b..c825d0ae20 100644 --- a/docs/latex/wx/tdate.tex +++ b/docs/latex/wx/tdate.tex @@ -44,7 +44,8 @@ There are also helper classes which are used together with wxDateTime: \helpref{wxDateTimeHolidayAuthority}{wxdatetimeholidayauthority} which is used to determine whether a given date is a holiday or not and \helpref{wxDateTimeWorkDays}{wxdatetimeworkdays} which is a derivation of this -class for which (only) Saturdays and Sundays are the holidays. +class for which (only) Saturdays and Sundays are the holidays. See more about +these classes in the discussion of the \helpref{holidays}{tdateholidays}. Finally, in other parts of this manual you may find mentions of wxDate and wxTime classes. \helpref{These classes}{tdatecompatibility} are obsolete and @@ -110,7 +111,7 @@ also more efficient). However, wxDateSpan may be very useful in situations when you do need to understand what does `in a month' mean (of course, it is just {\tt wxDateTime::Now() + wxDateSpan::Month()}). -\subsection{Date arithmetics} +\subsection{Date arithmetics}\label{tdatearithm} Many different operations may be performed with the dates, however not all of them make sense. For example, multiplying date by a number is an invalid @@ -184,7 +185,7 @@ printf("The time is %s in local time zone", dt.FormatTime().c_str()); printf("The time is %s in GMT", dt.FormatTime(wxDateTime::GMT).c_str()); \end{verbatim} -\subsection{Daylight saving time (DST)} +\subsection{Daylight saving time (DST)}\label{tdatedst} DST (a.k.a. `summer time') handling is always a delicate task which is better left to the operating system which is supposed to be configured by the @@ -204,6 +205,10 @@ too, so they are subject to the same limitations. % is this really needed? \subsection{Conversion to/from text} +\subsection{wxDateTime and Holidays}\label{tdateholidays} + +TODO. + \subsection{Compatibility}\label{tdatecompatibility} The old classes for date/time manipulations ported from wxWindows version 1.xx diff --git a/docs/latex/wx/timespan.tex b/docs/latex/wx/timespan.tex new file mode 100644 index 0000000000..b5909c76b6 --- /dev/null +++ b/docs/latex/wx/timespan.tex @@ -0,0 +1,15 @@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% Name: datespan.tex +%% Purpose: wxDateSpan documentation +%% Author: Vadim Zeitlin +%% Modified by: +%% Created: 04.04.00 +%% RCS-ID: $Id$ +%% Copyright: (c) Vadim Zeitlin +%% License: wxWindows license +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\section{\class{wxTimeSpan}}\label{wxtimespan} + +TODO + diff --git a/docs/latex/wx/topics.tex b/docs/latex/wx/topics.tex index 5b104537eb..1c246e3404 100644 --- a/docs/latex/wx/topics.tex +++ b/docs/latex/wx/topics.tex @@ -11,6 +11,7 @@ This chapter contains a selection of topic overviews, first things first: \input tapp.tex \input truntime.tex \input tstring.tex +\input tdate.tex \input tunicode.tex \input tmbconv.tex \input ti18n.tex diff --git a/docs/latex/wx/window.tex b/docs/latex/wx/window.tex index 4dbd0bc2a8..19143b959e 100644 --- a/docs/latex/wx/window.tex +++ b/docs/latex/wx/window.tex @@ -60,7 +60,7 @@ See also \helpref{window styles overview}{windowstyles}. \latexignore{\rtfignore{\wxheading{Members}}} -\membersection{wxWindow::wxWindow} +\membersection{wxWindow::wxWindow}\label{wxwindowctor} \func{}{wxWindow}{\void}