Wt: Wt::Ext::DateField Class Reference

Wt 3.3.0

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes

- Class List
- Class Hierarchy
- Class Members

Public Member Functions
Wt::Ext::DateField Class Reference
Ext widgets (Wt::Ext, deprecated)

A form field for conveniently editing a date using a calendar popup. More...

`#include <Wt/Ext/DateField>`

Inheritance diagram for Wt::Ext::DateField:
[legend]

List of all members.

## 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
| Return the date format.
void | setDate (const WDate &date)
| Set the date value.
WDate | date () const
| Return the date value.

## Detailed Description

A form field for conveniently editing a date using a calendar popup.

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

See also:
  Calendar, WDatePicker

## Member Function Documentation

WDate Wt::Ext::DateField::date | ( |  | ) | const

Return the date value.

When the date could not be parsed, an invalid date is returned (for which WDate::isValid() returns false).

const WString& Wt::Ext::DateField::format | ( |  | ) | const

Return the date format.

See also:
  setFormat()

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'.

See also:
  format()

All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator