JDialog dlg = new JDialog(new Frame(), true); DateField df = new DateField(); dlg.getContentPane().add(df); dlg.pack(); dlg.show(); if (null != df.getDate()) System.out.println(df.getDate().toString()); dlg.dispose(); System.exit(0);@author B. Bell @version 1.1a
A date editor component that can be bound to any {@link Property} that iscompatible with java.util.Date
.
Since DateField
extends AbstractField
it implements the {@link com.vaadin.data.Buffered}interface.
A DateField
is in write-through mode by default, so {@link com.vaadin.ui.AbstractField#setWriteThrough(boolean)}must be called to enable buffering.
<html> <head> $headElements </head> <body> $form $jsElements </body> </html>
Note that DateField is lenient with regards to parsing fractional seconds that end in trailing zeros and will ensure that those values are indexed in the correct canonical format.
This FieldType also supports incoming "Date Math" strings for computing values by adding/rounding internals of time relative either an explicit datetime (in the format specified above) or the literal string "NOW", ie: "NOW+1YEAR", "NOW/DAY", "1995-12-31T23:59:59.999Z+5MINUTES", etc... -- see {@link DateMathParser} for more examples.
Explanation of "UTC"...
"In 1970 the Coordinated Universal Time system was devised by an international advisory group of technical experts within the International Telecommunication Union (ITU). The ITU felt it was best to designate a single abbreviation for use in all languages in order to minimize confusion. Since unanimous agreement could not be achieved on using either the English word order, CUT, or the French word order, TUC, the acronym UTC was chosen as a compromise."@version $Id: DateField.java 1171741 2011-09-16 19:29:23Z hossman $ @see XML schema part 2
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|