Difference between revisions of "Documentation/DevGuide/Basic/Date Field"
OOoWikiBot (Talk | contribs) m (FINAL VERSION FOR L10N) |
m |
||
Line 9: | Line 9: | ||
{{DISPLAYTITLE:Date Field}} | {{DISPLAYTITLE:Date Field}} | ||
The date field control <idl>com.sun.star.awt.UnoControlDateField</idl> extends the text field control and is used for displaying and entering dates. The date displayed in the date field is controlled by the <code>Date</code> property. The date value is of type <code>Long</code> and must be specified in the format YYYYMMDD, for example, the date September 30th, 2002 is set in the following format: | The date field control <idl>com.sun.star.awt.UnoControlDateField</idl> extends the text field control and is used for displaying and entering dates. The date displayed in the date field is controlled by the <code>Date</code> property. The date value is of type <code>Long</code> and must be specified in the format YYYYMMDD, for example, the date September 30th, 2002 is set in the following format: | ||
− | + | <source lang="oobas"> | |
oDateFieldModel = oDialog.Model.DateField1 | oDateFieldModel = oDialog.Model.DateField1 | ||
oDateFieldModel.Date = 20020930 | oDateFieldModel.Date = 20020930 | ||
− | + | </source> | |
The current date is set by using the Date and <code>CDateToIso</code> runtime functions: | The current date is set by using the Date and <code>CDateToIso</code> runtime functions: | ||
− | + | <source lang="oobas"> | |
oDateFieldModel.Date = CDateToIso( Date() ) | oDateFieldModel.Date = CDateToIso( Date() ) | ||
− | + | </source> | |
The minimum and the maximum date that the user can enter is defined by the <code>DateMin</code> and the <code>DateMax</code> property. The format of the displayed date is specified by the <code>DateFormat</code> and the <code>DateShowCentury</code> property, but the usage of <code>DateShowCentury</code> is deprecated. Some formats are dependent on the system settings. If the <code>StrictFormat</code> property is set to True, the date entered by the user is checked during input. The <code>Dropdown</code> property enables a calendar that the user can drop down to select a date. | The minimum and the maximum date that the user can enter is defined by the <code>DateMin</code> and the <code>DateMax</code> property. The format of the displayed date is specified by the <code>DateFormat</code> and the <code>DateShowCentury</code> property, but the usage of <code>DateShowCentury</code> is deprecated. Some formats are dependent on the system settings. If the <code>StrictFormat</code> property is set to True, the date entered by the user is checked during input. The <code>Dropdown</code> property enables a calendar that the user can drop down to select a date. | ||
Revision as of 10:07, 22 October 2009
The date field control com.sun.star.awt.UnoControlDateField extends the text field control and is used for displaying and entering dates. The date displayed in the date field is controlled by the Date
property. The date value is of type Long
and must be specified in the format YYYYMMDD, for example, the date September 30th, 2002 is set in the following format:
oDateFieldModel = oDialog.Model.DateField1 oDateFieldModel.Date = 20020930
The current date is set by using the Date and CDateToIso
runtime functions:
oDateFieldModel.Date = CDateToIso( Date() )
The minimum and the maximum date that the user can enter is defined by the DateMin
and the DateMax
property. The format of the displayed date is specified by the DateFormat
and the DateShowCentury
property, but the usage of DateShowCentury
is deprecated. Some formats are dependent on the system settings. If the StrictFormat
property is set to True, the date entered by the user is checked during input. The Dropdown
property enables a calendar that the user can drop down to select a date.
Dropdown
is currently not working.
Content on this page is licensed under the Public Documentation License (PDL). |