#include <Wt/Ext/DateField>
Public Member Functions | |
DateField (WContainerWidget *parent=0) | |
Create a new date field. | |
void | setFormat (const WString &format) |
Set the date format. | |
const WString & | format () const |
Get the date format. | |
void | setDate (const WDate &date) |
Set the date value. | |
WDate | date () const |
Get the date value. |
You can set a WDateValidator to specify in more detail the valid range, and the client-side validation messages. When using a WDateValidator, however, make sure to use the same date format as the format used by the field.
Here is a snapshot taken on 01/09/2007 (shown as today), and with current value 12/09/2007 currently selected.
DateField
void Wt::Ext::DateField::setFormat | ( | const WString & | format | ) |
Set the date format.
The syntax of the format string is the same as used by WDate::toString(const WString&).
The default value is 'dd/MM/yyyy'.
const WString& Wt::Ext::DateField::format | ( | ) | const [inline] |
WDate Wt::Ext::DateField::date | ( | ) | const |
Get the date value.
When the date could not be parsed, an invalid date is returned (for which WDate::isValid() returns false).