You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Marat Radchenko (JIRA)" <ji...@apache.org> on 2009/12/29 11:30:29 UTC

[jira] Created: (WICKET-2648) DatePicker javascript uses 4 symbols for year although pattern contains just yy

DatePicker javascript uses 4 symbols for year although pattern contains just yy
-------------------------------------------------------------------------------

                 Key: WICKET-2648
                 URL: https://issues.apache.org/jira/browse/WICKET-2648
             Project: Wicket
          Issue Type: Bug
          Components: wicket
    Affects Versions: 1.4.5
            Reporter: Marat Radchenko


Steps to reproduce:
1. Create TextField
2. Add DatePicker with yy for year (en_US locale, SHORT format, for example).
3. Set some date to textfield
4. Open page (year is correctly shown with two digits)
5. Click datepicker icon
Expected: year is still 2-digit
Actual: year becomes 4-digit

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


[jira] Commented: (WICKET-2648) DatePicker javascript uses 4 symbols for year although pattern contains just yy

Posted by "Marcin Palka (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-2648?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12849097#action_12849097 ] 

Marcin Palka commented on WICKET-2648:
--------------------------------------

In my application I use  the "yyyy-MM-dd" pattern. It results in dates saved as 0010-03-23 instead of 2010-03-23. I had to to revert to fall back to wicket  1.4.6. Is there any other bug filled for this? It seems that now all the four digit year patterns are affected.

> DatePicker javascript uses 4 symbols for year although pattern contains just yy
> -------------------------------------------------------------------------------
>
>                 Key: WICKET-2648
>                 URL: https://issues.apache.org/jira/browse/WICKET-2648
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket-extensions
>    Affects Versions: 1.4.5
>            Reporter: Marat Radchenko
>            Assignee: Igor Vaynberg
>             Fix For: 1.4.7, 1.5-M1
>
>         Attachments: wicket-datetime.patch
>
>
> Steps to reproduce:
> 1. Create TextField
> 2. Add DatePicker with yy for year (en_US locale, SHORT format, for example).
> 3. Set some date to textfield
> 4. Open page (year is correctly shown with two digits)
> 5. Click datepicker icon
> Expected: year is still 2-digit
> Actual: year becomes 4-digit

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


[jira] Issue Comment Edited: (WICKET-2648) DatePicker javascript uses 4 symbols for year although pattern contains just yy

Posted by "Marcin Palka (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-2648?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12849097#action_12849097 ] 

Marcin Palka edited comment on WICKET-2648 at 3/24/10 8:11 AM:
---------------------------------------------------------------

In my application I use  the "yyyy-MM-dd" pattern. It results in dates saved as 0010-03-23 instead of 2010-03-23. I had to to fall back to wicket  1.4.6. Is there any other bug filled for this? It seems that now all the four digit year patterns are affected.

      was (Author: mpalka):
    In my application I use  the "yyyy-MM-dd" pattern. It results in dates saved as 0010-03-23 instead of 2010-03-23. I had to to revert to fall back to wicket  1.4.6. Is there any other bug filled for this? It seems that now all the four digit year patterns are affected.
  
> DatePicker javascript uses 4 symbols for year although pattern contains just yy
> -------------------------------------------------------------------------------
>
>                 Key: WICKET-2648
>                 URL: https://issues.apache.org/jira/browse/WICKET-2648
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket-extensions
>    Affects Versions: 1.4.5
>            Reporter: Marat Radchenko
>            Assignee: Igor Vaynberg
>             Fix For: 1.4.7, 1.5-M1
>
>         Attachments: wicket-datetime.patch
>
>
> Steps to reproduce:
> 1. Create TextField
> 2. Add DatePicker with yy for year (en_US locale, SHORT format, for example).
> 3. Set some date to textfield
> 4. Open page (year is correctly shown with two digits)
> 5. Click datepicker icon
> Expected: year is still 2-digit
> Actual: year becomes 4-digit

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


[jira] Resolved: (WICKET-2648) DatePicker javascript uses 4 symbols for year although pattern contains just yy

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

Igor Vaynberg resolved WICKET-2648.
-----------------------------------

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

thanks, fixed.

> DatePicker javascript uses 4 symbols for year although pattern contains just yy
> -------------------------------------------------------------------------------
>
>                 Key: WICKET-2648
>                 URL: https://issues.apache.org/jira/browse/WICKET-2648
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket-extensions
>    Affects Versions: 1.4.5
>            Reporter: Marat Radchenko
>            Assignee: Igor Vaynberg
>             Fix For: 1.4.7, 1.5-M1
>
>
> Steps to reproduce:
> 1. Create TextField
> 2. Add DatePicker with yy for year (en_US locale, SHORT format, for example).
> 3. Set some date to textfield
> 4. Open page (year is correctly shown with two digits)
> 5. Click datepicker icon
> Expected: year is still 2-digit
> Actual: year becomes 4-digit

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


[jira] Commented: (WICKET-2648) DatePicker javascript uses 4 symbols for year although pattern contains just yy

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

Giovanni commented on WICKET-2648:
----------------------------------

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);



> DatePicker javascript uses 4 symbols for year although pattern contains just yy
> -------------------------------------------------------------------------------
>
>                 Key: WICKET-2648
>                 URL: https://issues.apache.org/jira/browse/WICKET-2648
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket-extensions
>    Affects Versions: 1.4.5
>            Reporter: Marat Radchenko
>            Assignee: Igor Vaynberg
>             Fix For: 1.4.7, 1.5-M1
>
>         Attachments: wicket-datetime.patch
>
>
> Steps to reproduce:
> 1. Create TextField
> 2. Add DatePicker with yy for year (en_US locale, SHORT format, for example).
> 3. Set some date to textfield
> 4. Open page (year is correctly shown with two digits)
> 5. Click datepicker icon
> Expected: year is still 2-digit
> Actual: year becomes 4-digit

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


[jira] Updated: (WICKET-2648) DatePicker javascript uses 4 symbols for year although pattern contains just yy

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

Marat Radchenko updated WICKET-2648:
------------------------------------

    Component/s:     (was: wicket)
                 wicket-extensions

> DatePicker javascript uses 4 symbols for year although pattern contains just yy
> -------------------------------------------------------------------------------
>
>                 Key: WICKET-2648
>                 URL: https://issues.apache.org/jira/browse/WICKET-2648
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket-extensions
>    Affects Versions: 1.4.5
>            Reporter: Marat Radchenko
>
> Steps to reproduce:
> 1. Create TextField
> 2. Add DatePicker with yy for year (en_US locale, SHORT format, for example).
> 3. Set some date to textfield
> 4. Open page (year is correctly shown with two digits)
> 5. Click datepicker icon
> Expected: year is still 2-digit
> Actual: year becomes 4-digit

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


[jira] Commented: (WICKET-2648) DatePicker javascript uses 4 symbols for year although pattern contains just yy

Posted by "Igor Vaynberg (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-2648?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12834314#action_12834314 ] 

Igor Vaynberg commented on WICKET-2648:
---------------------------------------

i thought this issue was fixed?....

> DatePicker javascript uses 4 symbols for year although pattern contains just yy
> -------------------------------------------------------------------------------
>
>                 Key: WICKET-2648
>                 URL: https://issues.apache.org/jira/browse/WICKET-2648
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket-extensions
>    Affects Versions: 1.4.5
>            Reporter: Marat Radchenko
>            Assignee: Igor Vaynberg
>             Fix For: 1.4.7, 1.5-M1
>
>         Attachments: wicket-datetime.patch
>
>
> Steps to reproduce:
> 1. Create TextField
> 2. Add DatePicker with yy for year (en_US locale, SHORT format, for example).
> 3. Set some date to textfield
> 4. Open page (year is correctly shown with two digits)
> 5. Click datepicker icon
> Expected: year is still 2-digit
> Actual: year becomes 4-digit

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


[jira] Updated: (WICKET-2648) DatePicker javascript uses 4 symbols for year although pattern contains just yy

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

count negative updated WICKET-2648:
-----------------------------------

    Comment: was deleted

(was: This is a patch for the 1.4.6 branch. It's based on the date.js library from http://www.datejs.com/ under a MIT license.


To play around put a new DateField to your form and set the dateformat you want.and the locale Session.get().setLocale(Locale.UK);

form.add(new DateField("date", new PropertyModel(user, "date")) {
            private static final long serialVersionUID = 1L;

            @Override
            protected DateTextField newDateTextField(String id, PropertyModel model) {
                return DateTextField.withConverter(id, model, new PatternDateConverter("dd-MMMM-yy", true));
            }

            @Override
            protected DatePicker newDatePicker() {
                return new DatePicker() {
                    @Override
                    protected String getDatePattern() {
                        return "dddd-MMMM-yy";
                    }
                };
            }
        });)

> DatePicker javascript uses 4 symbols for year although pattern contains just yy
> -------------------------------------------------------------------------------
>
>                 Key: WICKET-2648
>                 URL: https://issues.apache.org/jira/browse/WICKET-2648
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket-extensions
>    Affects Versions: 1.4.5
>            Reporter: Marat Radchenko
>            Assignee: Igor Vaynberg
>             Fix For: 1.4.7, 1.5-M1
>
>         Attachments: wicket-datetime.patch
>
>
> Steps to reproduce:
> 1. Create TextField
> 2. Add DatePicker with yy for year (en_US locale, SHORT format, for example).
> 3. Set some date to textfield
> 4. Open page (year is correctly shown with two digits)
> 5. Click datepicker icon
> Expected: year is still 2-digit
> Actual: year becomes 4-digit

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


[jira] Commented: (WICKET-2648) DatePicker javascript uses 4 symbols for year although pattern contains just yy

Posted by "count negative (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-2648?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12806681#action_12806681 ] 

count negative commented on WICKET-2648:
----------------------------------------

There is a simple typo in wicket-date.js line 137: 
if(datePattern.match(/byy+/)) year = Wicket.DateTime.padDateFragment(year % 100);
should be
if(datePattern.match(/yy+/)) year = Wicket.DateTime.padDateFragment(year % 100);



> DatePicker javascript uses 4 symbols for year although pattern contains just yy
> -------------------------------------------------------------------------------
>
>                 Key: WICKET-2648
>                 URL: https://issues.apache.org/jira/browse/WICKET-2648
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket-extensions
>    Affects Versions: 1.4.5
>            Reporter: Marat Radchenko
>
> Steps to reproduce:
> 1. Create TextField
> 2. Add DatePicker with yy for year (en_US locale, SHORT format, for example).
> 3. Set some date to textfield
> 4. Open page (year is correctly shown with two digits)
> 5. Click datepicker icon
> Expected: year is still 2-digit
> Actual: year becomes 4-digit

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


[jira] Commented: (WICKET-2648) DatePicker javascript uses 4 symbols for year although pattern contains just yy

Posted by "Igor Vaynberg (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-2648?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12828016#action_12828016 ] 

Igor Vaynberg commented on WICKET-2648:
---------------------------------------

a patch against 2427 is more then welcome...

> DatePicker javascript uses 4 symbols for year although pattern contains just yy
> -------------------------------------------------------------------------------
>
>                 Key: WICKET-2648
>                 URL: https://issues.apache.org/jira/browse/WICKET-2648
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket-extensions
>    Affects Versions: 1.4.5
>            Reporter: Marat Radchenko
>            Assignee: Igor Vaynberg
>             Fix For: 1.4.7, 1.5-M1
>
>
> Steps to reproduce:
> 1. Create TextField
> 2. Add DatePicker with yy for year (en_US locale, SHORT format, for example).
> 3. Set some date to textfield
> 4. Open page (year is correctly shown with two digits)
> 5. Click datepicker icon
> Expected: year is still 2-digit
> Actual: year becomes 4-digit

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


[jira] Commented: (WICKET-2648) DatePicker javascript uses 4 symbols for year although pattern contains just yy

Posted by "count negative (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-2648?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12834664#action_12834664 ] 

count negative commented on WICKET-2648:
----------------------------------------

aie, I see. This should be the patch against 2427 but, sorry, putted it in here. I'll fix it this evening.

> DatePicker javascript uses 4 symbols for year although pattern contains just yy
> -------------------------------------------------------------------------------
>
>                 Key: WICKET-2648
>                 URL: https://issues.apache.org/jira/browse/WICKET-2648
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket-extensions
>    Affects Versions: 1.4.5
>            Reporter: Marat Radchenko
>            Assignee: Igor Vaynberg
>             Fix For: 1.4.7, 1.5-M1
>
>         Attachments: wicket-datetime.patch
>
>
> Steps to reproduce:
> 1. Create TextField
> 2. Add DatePicker with yy for year (en_US locale, SHORT format, for example).
> 3. Set some date to textfield
> 4. Open page (year is correctly shown with two digits)
> 5. Click datepicker icon
> Expected: year is still 2-digit
> Actual: year becomes 4-digit

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


[jira] Commented: (WICKET-2648) DatePicker javascript uses 4 symbols for year although pattern contains just yy

Posted by "count negative (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-2648?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12806799#action_12806799 ] 

count negative commented on WICKET-2648:
----------------------------------------

Igor, please look at https://issues.apache.org/jira/browse/WICKET-2375 and https://issues.apache.org/jira/browse/WICKET-2427. The solution in WICKET-2427 is very smart and should do for future uses of datepicker. What do you mean?

> DatePicker javascript uses 4 symbols for year although pattern contains just yy
> -------------------------------------------------------------------------------
>
>                 Key: WICKET-2648
>                 URL: https://issues.apache.org/jira/browse/WICKET-2648
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket-extensions
>    Affects Versions: 1.4.5
>            Reporter: Marat Radchenko
>            Assignee: Igor Vaynberg
>             Fix For: 1.4.7, 1.5-M1
>
>
> Steps to reproduce:
> 1. Create TextField
> 2. Add DatePicker with yy for year (en_US locale, SHORT format, for example).
> 3. Set some date to textfield
> 4. Open page (year is correctly shown with two digits)
> 5. Click datepicker icon
> Expected: year is still 2-digit
> Actual: year becomes 4-digit

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


[jira] Updated: (WICKET-2648) DatePicker javascript uses 4 symbols for year although pattern contains just yy

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

count negative updated WICKET-2648:
-----------------------------------

    Comment: was deleted

(was: aie, I see. This should be the patch against 2427 but, sorry, putted it in here. I'll fix it this evening.)

> DatePicker javascript uses 4 symbols for year although pattern contains just yy
> -------------------------------------------------------------------------------
>
>                 Key: WICKET-2648
>                 URL: https://issues.apache.org/jira/browse/WICKET-2648
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket-extensions
>    Affects Versions: 1.4.5
>            Reporter: Marat Radchenko
>            Assignee: Igor Vaynberg
>             Fix For: 1.4.7, 1.5-M1
>
>         Attachments: wicket-datetime.patch
>
>
> Steps to reproduce:
> 1. Create TextField
> 2. Add DatePicker with yy for year (en_US locale, SHORT format, for example).
> 3. Set some date to textfield
> 4. Open page (year is correctly shown with two digits)
> 5. Click datepicker icon
> Expected: year is still 2-digit
> Actual: year becomes 4-digit

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


[jira] Commented: (WICKET-2648) DatePicker javascript uses 4 symbols for year although pattern contains just yy

Posted by "Andrey Lopatin (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-2648?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12845431#action_12845431 ] 

Andrey Lopatin commented on WICKET-2648:
----------------------------------------

I agree with Giovanni -  there is still a bug in Wicket 1.4.7. Please, fix in future versions.

> DatePicker javascript uses 4 symbols for year although pattern contains just yy
> -------------------------------------------------------------------------------
>
>                 Key: WICKET-2648
>                 URL: https://issues.apache.org/jira/browse/WICKET-2648
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket-extensions
>    Affects Versions: 1.4.5
>            Reporter: Marat Radchenko
>            Assignee: Igor Vaynberg
>             Fix For: 1.4.7, 1.5-M1
>
>         Attachments: wicket-datetime.patch
>
>
> Steps to reproduce:
> 1. Create TextField
> 2. Add DatePicker with yy for year (en_US locale, SHORT format, for example).
> 3. Set some date to textfield
> 4. Open page (year is correctly shown with two digits)
> 5. Click datepicker icon
> Expected: year is still 2-digit
> Actual: year becomes 4-digit

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


[jira] Updated: (WICKET-2648) DatePicker javascript uses 4 symbols for year although pattern contains just yy

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

count negative updated WICKET-2648:
-----------------------------------

    Attachment: wicket-datetime.patch

This is a patch for the 1.4.6 branch. It's based on the date.js library from http://www.datejs.com/ under a MIT license.


To play around put a new DateField to your form and set the dateformat you want.and the locale Session.get().setLocale(Locale.UK);

form.add(new DateField("date", new PropertyModel(user, "date")) {
            private static final long serialVersionUID = 1L;

            @Override
            protected DateTextField newDateTextField(String id, PropertyModel model) {
                return DateTextField.withConverter(id, model, new PatternDateConverter("dd-MMMM-yy", true));
            }

            @Override
            protected DatePicker newDatePicker() {
                return new DatePicker() {
                    @Override
                    protected String getDatePattern() {
                        return "dddd-MMMM-yy";
                    }
                };
            }
        });

> DatePicker javascript uses 4 symbols for year although pattern contains just yy
> -------------------------------------------------------------------------------
>
>                 Key: WICKET-2648
>                 URL: https://issues.apache.org/jira/browse/WICKET-2648
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket-extensions
>    Affects Versions: 1.4.5
>            Reporter: Marat Radchenko
>            Assignee: Igor Vaynberg
>             Fix For: 1.4.7, 1.5-M1
>
>         Attachments: wicket-datetime.patch
>
>
> Steps to reproduce:
> 1. Create TextField
> 2. Add DatePicker with yy for year (en_US locale, SHORT format, for example).
> 3. Set some date to textfield
> 4. Open page (year is correctly shown with two digits)
> 5. Click datepicker icon
> Expected: year is still 2-digit
> Actual: year becomes 4-digit

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