You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Giovanni (JIRA)" <ji...@apache.org> on 2010/03/07 15:37:27 UTC

[jira] Created: (WICKET-2767) DatePicker Calendar: wrong year format when 4 digits are used (yyyy), e.g. 2010 --> 0010

DatePicker Calendar: wrong year format when 4 digits are used (yyyy), e.g. 2010 --> 0010
----------------------------------------------------------------------------------------

                 Key: WICKET-2767
                 URL: https://issues.apache.org/jira/browse/WICKET-2767
             Project: Wicket
          Issue Type: Bug
          Components: wicket-datetime
    Affects Versions: 1.4.7
            Reporter: Giovanni


I found that there is still a bug in Wicket 1.4.7 in case that the datePattern is "dd/MM/yyyy".

For example, if you use the DatePicker and select a date such as
23/02/2010 from the calendar GUI, the date selected in the DateTextField is "23/02/0010".

This is the example Java code:

                // define the date text field for the data decorrenza
                DateTextField dataDecorrenzaDaTextField = new DateTextField("dataDecorrenzaDa",
                        new PropertyModel(this.accordo, "dataDecorrenzaDa"),
                        new PatternDateConverter("dd/MM/yyyy", true)
                );

                // add the graphical calendar date picker
                dataDecorrenzaDaTextField.add(new DatePicker() {

                        @Override
                        protected boolean enableMonthYearSelection() {
 
                            // enable month/year selection
                            return true;

                        } // end enableMonthYearSelection

                    } // end DatePicker

                );

I found that the bug is still in the "wicket-date.js", line 137.

The wrong code is:

if(datePattern.match(/yy+/)) year = Wicket.DateTime.padDateFragment(year % 100);

This line also makes the module 100 on the year, when the year pattern is "yyyy".

The fixed code is:

if(datePattern.match(/yyyy+/)) {
    year = year;
} else if(datePattern.match(/yy+/)) year = Wicket.DateTime.padDateFragment(year % 100);




-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (WICKET-2767) DatePicker Calendar: wrong year format when 4 digits are used (yyyy), e.g. 2010 --> 0010

Posted by "Jonas (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-2767?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jonas updated WICKET-2767:
--------------------------

    Attachment: wicket-2767.patch

> DatePicker Calendar: wrong year format when 4 digits are used (yyyy), e.g. 2010 --> 0010
> ----------------------------------------------------------------------------------------
>
>                 Key: WICKET-2767
>                 URL: https://issues.apache.org/jira/browse/WICKET-2767
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket-datetime
>    Affects Versions: 1.4.7
>            Reporter: Giovanni
>         Attachments: wicket-2767.patch
>
>   Original Estimate: 0.08h
>  Remaining Estimate: 0.08h
>
> I found that there is still a bug in Wicket 1.4.7 in case that the datePattern is "dd/MM/yyyy".
> For example, if you use the DatePicker and select a date such as
> 23/02/2010 from the calendar GUI, the date selected in the DateTextField is "23/02/0010".
> This is the example Java code:
>                 // define the date text field for the data decorrenza
>                 DateTextField dataDecorrenzaDaTextField = new DateTextField("dataDecorrenzaDa",
>                         new PropertyModel(this.accordo, "dataDecorrenzaDa"),
>                         new PatternDateConverter("dd/MM/yyyy", true)
>                 );
>                 // add the graphical calendar date picker
>                 dataDecorrenzaDaTextField.add(new DatePicker() {
>                         @Override
>                         protected boolean enableMonthYearSelection() {
>  
>                             // enable month/year selection
>                             return true;
>                         } // end enableMonthYearSelection
>                     } // end DatePicker
>                 );
> I found that the bug is still in the "wicket-date.js", line 137.
> The wrong code is:
> if(datePattern.match(/yy+/)) year = Wicket.DateTime.padDateFragment(year % 100);
> This line also makes the module 100 on the year, when the year pattern is "yyyy".
> The fixed code is:
> if(datePattern.match(/yyyy+/)) {
>     year = year;
> } else if(datePattern.match(/yy+/)) year = Wicket.DateTime.padDateFragment(year % 100);

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (WICKET-2767) DatePicker Calendar: wrong year format when 4 digits are used (yyyy), e.g. 2010 --> 0010

Posted by "martin kovacik (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-2767?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12867127#action_12867127 ] 

martin kovacik commented on WICKET-2767:
----------------------------------------

The same issue is still present in 1.4.8 in DateTimeField component.

> DatePicker Calendar: wrong year format when 4 digits are used (yyyy), e.g. 2010 --> 0010
> ----------------------------------------------------------------------------------------
>
>                 Key: WICKET-2767
>                 URL: https://issues.apache.org/jira/browse/WICKET-2767
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket-datetime
>    Affects Versions: 1.4.7
>            Reporter: Giovanni
>            Assignee: Igor Vaynberg
>             Fix For: 1.4.8, 1.5-M1
>
>         Attachments: wicket-2767.patch
>
>   Original Estimate: 0.08h
>  Remaining Estimate: 0.08h
>
> I found that there is still a bug in Wicket 1.4.7 in case that the datePattern is "dd/MM/yyyy".
> For example, if you use the DatePicker and select a date such as
> 23/02/2010 from the calendar GUI, the date selected in the DateTextField is "23/02/0010".
> This is the example Java code:
>                 // define the date text field for the data decorrenza
>                 DateTextField dataDecorrenzaDaTextField = new DateTextField("dataDecorrenzaDa",
>                         new PropertyModel(this.accordo, "dataDecorrenzaDa"),
>                         new PatternDateConverter("dd/MM/yyyy", true)
>                 );
>                 // add the graphical calendar date picker
>                 dataDecorrenzaDaTextField.add(new DatePicker() {
>                         @Override
>                         protected boolean enableMonthYearSelection() {
>  
>                             // enable month/year selection
>                             return true;
>                         } // end enableMonthYearSelection
>                     } // end DatePicker
>                 );
> I found that the bug is still in the "wicket-date.js", line 137.
> The wrong code is:
> if(datePattern.match(/yy+/)) year = Wicket.DateTime.padDateFragment(year % 100);
> This line also makes the module 100 on the year, when the year pattern is "yyyy".
> The fixed code is:
> if(datePattern.match(/yyyy+/)) {
>     year = year;
> } else if(datePattern.match(/yy+/)) year = Wicket.DateTime.padDateFragment(year % 100);

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (WICKET-2767) DatePicker Calendar: wrong year format when 4 digits are used (yyyy), e.g. 2010 --> 0010

Posted by "Steve Mactaggart (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-2767?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12846200#action_12846200 ] 

Steve Mactaggart commented on WICKET-2767:
------------------------------------------

We have the same issue, although with a different date pattern.
We are using yyyy/MM/dd and end up with the same 2 digit year.

> DatePicker Calendar: wrong year format when 4 digits are used (yyyy), e.g. 2010 --> 0010
> ----------------------------------------------------------------------------------------
>
>                 Key: WICKET-2767
>                 URL: https://issues.apache.org/jira/browse/WICKET-2767
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket-datetime
>    Affects Versions: 1.4.7
>            Reporter: Giovanni
>   Original Estimate: 0.08h
>  Remaining Estimate: 0.08h
>
> I found that there is still a bug in Wicket 1.4.7 in case that the datePattern is "dd/MM/yyyy".
> For example, if you use the DatePicker and select a date such as
> 23/02/2010 from the calendar GUI, the date selected in the DateTextField is "23/02/0010".
> This is the example Java code:
>                 // define the date text field for the data decorrenza
>                 DateTextField dataDecorrenzaDaTextField = new DateTextField("dataDecorrenzaDa",
>                         new PropertyModel(this.accordo, "dataDecorrenzaDa"),
>                         new PatternDateConverter("dd/MM/yyyy", true)
>                 );
>                 // add the graphical calendar date picker
>                 dataDecorrenzaDaTextField.add(new DatePicker() {
>                         @Override
>                         protected boolean enableMonthYearSelection() {
>  
>                             // enable month/year selection
>                             return true;
>                         } // end enableMonthYearSelection
>                     } // end DatePicker
>                 );
> I found that the bug is still in the "wicket-date.js", line 137.
> The wrong code is:
> if(datePattern.match(/yy+/)) year = Wicket.DateTime.padDateFragment(year % 100);
> This line also makes the module 100 on the year, when the year pattern is "yyyy".
> The fixed code is:
> if(datePattern.match(/yyyy+/)) {
>     year = year;
> } else if(datePattern.match(/yy+/)) year = Wicket.DateTime.padDateFragment(year % 100);

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (WICKET-2767) DatePicker Calendar: wrong year format when 4 digits are used (yyyy), e.g. 2010 --> 0010

Posted by "Igor Vaynberg (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-2767?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Igor Vaynberg resolved WICKET-2767.
-----------------------------------

       Resolution: Fixed
    Fix Version/s: 1.5-M1
                   1.4.8
         Assignee: Igor Vaynberg

> DatePicker Calendar: wrong year format when 4 digits are used (yyyy), e.g. 2010 --> 0010
> ----------------------------------------------------------------------------------------
>
>                 Key: WICKET-2767
>                 URL: https://issues.apache.org/jira/browse/WICKET-2767
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket-datetime
>    Affects Versions: 1.4.7
>            Reporter: Giovanni
>            Assignee: Igor Vaynberg
>             Fix For: 1.4.8, 1.5-M1
>
>         Attachments: wicket-2767.patch
>
>   Original Estimate: 0.08h
>  Remaining Estimate: 0.08h
>
> I found that there is still a bug in Wicket 1.4.7 in case that the datePattern is "dd/MM/yyyy".
> For example, if you use the DatePicker and select a date such as
> 23/02/2010 from the calendar GUI, the date selected in the DateTextField is "23/02/0010".
> This is the example Java code:
>                 // define the date text field for the data decorrenza
>                 DateTextField dataDecorrenzaDaTextField = new DateTextField("dataDecorrenzaDa",
>                         new PropertyModel(this.accordo, "dataDecorrenzaDa"),
>                         new PatternDateConverter("dd/MM/yyyy", true)
>                 );
>                 // add the graphical calendar date picker
>                 dataDecorrenzaDaTextField.add(new DatePicker() {
>                         @Override
>                         protected boolean enableMonthYearSelection() {
>  
>                             // enable month/year selection
>                             return true;
>                         } // end enableMonthYearSelection
>                     } // end DatePicker
>                 );
> I found that the bug is still in the "wicket-date.js", line 137.
> The wrong code is:
> if(datePattern.match(/yy+/)) year = Wicket.DateTime.padDateFragment(year % 100);
> This line also makes the module 100 on the year, when the year pattern is "yyyy".
> The fixed code is:
> if(datePattern.match(/yyyy+/)) {
>     year = year;
> } else if(datePattern.match(/yy+/)) year = Wicket.DateTime.padDateFragment(year % 100);

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.