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

Reply via email to