Subversion Repository Public Repository

litesoft

Diff Revisions 142 vs 851 for /trunk/Java/GWT/Client/src/org/litesoft/GWT/forms/client/components/impls/input/FormDatePicker.java

Diff revisions: vs.
  @@ -11,19 +11,19 @@
11 11
12 12 public class FormDatePicker extends AbstractTextFieldWithPicker
13 13 {
14 - private String mDateFormat;
14 + private DateFormat mDateFormat;
15 15 private TemporalParser mTemporalParser;
16 16
17 - public FormDatePicker( String pFieldLabel, UiFont pLabelFont, String pTooltip, String pCancelText, String pTodayText, DateFormatControl pDateFormatControl )
17 + public FormDatePicker( String pFieldLabel, UiFont pLabelFont, String pTooltip, String pCancelText, String pTodayText, DateFormat pDateFormat )
18 18 {
19 19 // 1234567-101
20 20 // 04 JAN 1957
21 - super( pTooltip, true, pDateFormatControl.getFormat().length(), "Calendar", new MyPicker( pCancelText, pTodayText ) );
21 + super( pTooltip, true, pDateFormat.getFormat().length(), "Calendar", new MyPicker( pCancelText, pTodayText ) );
22 22 initialize( pFieldLabel, pLabelFont, pTooltip );
23 23
24 - mDateFormat = pDateFormatControl.getFormat();
25 - String zFieldOrder = pDateFormatControl.getFieldOrder();
26 - if ( zFieldOrder.equals( "dMy" ) && mDateFormat.contains( "MMM" ) )
24 + mDateFormat = pDateFormat;
25 + String zFieldOrder = pDateFormat.getFieldOrder();
26 + if ( zFieldOrder.equals( "dMy" ) && mDateFormat.getFormat().contains( "MMM" ) )
27 27 {
28 28 zFieldOrder = "Mdy";
29 29 }
  @@ -34,8 +34,8 @@
34 34 protected Object parseNotEmptyTextFieldToInternalForm( String pText, Object pLastValidInternalFormValue )
35 35 throws IllegalArgumentException
36 36 {
37 - UtilDateAdaptor zInadequatePartsSource = (pLastValidInternalFormValue instanceof SimpleDate) ? ((SimpleDate) pLastValidInternalFormValue).getUtilDateAdaptor() : null;
38 - return mTemporalParser.parseDate( mDateFormat, pText, zInadequatePartsSource );
37 + UtilDateAdaptor zInadequatePartsSource = (pLastValidInternalFormValue instanceof SimpleDate) ? ((SimpleDate) pLastValidInternalFormValue).toUtilDateAdaptor() : null;
38 + return mTemporalParser.parseDate( mDateFormat.getFormat(), pText, zInadequatePartsSource );
39 39 }
40 40
41 41 @Override
  @@ -56,11 +56,11 @@
56 56 Date zDate;
57 57 if ( pCurrentValue instanceof SimpleDate )
58 58 {
59 - zDate = ((SimpleDate) pCurrentValue).getDate();
59 + zDate = ((SimpleDate) pCurrentValue).toUtilDate();
60 60 }
61 61 else if ( pLastValidInternalFormValue instanceof SimpleDate )
62 62 {
63 - zDate = ((SimpleDate) pLastValidInternalFormValue).getDate();
63 + zDate = ((SimpleDate) pLastValidInternalFormValue).toUtilDate();
64 64 }
65 65 else
66 66 {