Dateparsing error kendo AjaxDateTimePicker only in March, May, October

classic Classic list List threaded Threaded
17 messages Options
Reply | Threaded
Open this post in threaded view
|

Dateparsing error kendo AjaxDateTimePicker only in March, May, October

hfriederichs
Good morning/afternoon/evening

I'm using a com.googlecode.wicket.kendo.ui.form.datetime.AjaxDateTimePicker version 7.1.0 on top of Wicket 7.1.0

Since today, march 1st, I get this error when I pick a month:

Error while parsing datetime: date was '01 Mar 2016' and time was '17:30'.

And this is very, very strange: I'm getting this error only when choosing March, May and October, and not in the other months...

Regards, Hans

Reply | Threaded
Open this post in threaded view
|

Re: Dateparsing error kendo AjaxDateTimePicker only in March, May, October

Martin Grigorov-4
Hi,

Please try with Wicket JQuery UI 7.2.0.
I think KendoUI has been updated with 7.2.0.

Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Tue, Mar 1, 2016 at 9:52 AM, hfriederichs <[hidden email]> wrote:

> Good morning/afternoon/evening
>
> I'm using a com.googlecode.wicket.kendo.ui.form.datetime.AjaxDateTimePicker
> version 7.1.0 on top of Wicket 7.1.0
>
> Since today, march 1st, I get this error when I pick a month:
>
> Error while parsing datetime: date was '01 Mar 2016' and time was '17:30'.
>
> And this is very, very strange: I'm getting this error only when choosing
> March, May and October, and not in the other months...
>
> Regards, Hans
>
>
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/Dateparsing-error-kendo-AjaxDateTimePicker-only-in-March-May-October-tp4673756.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Dateparsing error kendo AjaxDateTimePicker only in March, May, October

hfriederichs
I upgraded Wicket, Wicket JQuery and KendoUI to 7.2.0.

Same problem.
Reply | Threaded
Open this post in threaded view
|

Re: Dateparsing error kendo AjaxDateTimePicker only in March, May, October

Sebastien
Hi,

I make me think about a locale or pattern issue.

This does not repro in the sample site:
http://www.7thweb.net/wicket-jquery-ui/kendo/datetimepicker/PatternDateTimePickerPage

Please try to isolate the issue in a quickstart (we often find the solution
while doing the quickstart ;))

Thanks & best regards,
Sebastien.
Reply | Threaded
Open this post in threaded view
|

Re: Dateparsing error kendo AjaxDateTimePicker only in March, May, October

Martin Grigorov-4
In reply to this post by hfriederichs
Can you reproduce it at
http://www.7thweb.net/wicket-jquery-ui/kendo/datetimepicker/AjaxDatePickerPage
?
It works for me

Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Tue, Mar 1, 2016 at 10:09 AM, hfriederichs <[hidden email]> wrote:

> I upgraded Wicket, Wicket JQuery and KendoUI to 7.2.0.
>
> Same problem.
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/Dateparsing-error-kendo-AjaxDateTimePicker-only-in-March-May-October-tp4673756p4673758.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Dateparsing error kendo AjaxDateTimePicker only in March, May, October

hfriederichs
It's not a DatePicker, but a AjaxDateTimePicker.
I discovered it is indeed a pattern issue.
This is my code:

private final static String dateDisplay = "dd MMM yyyy";
private final static String timeDisplay = "HH.mm";
scheduleDateTimeField = new AjaxDateTimePicker("scheduledatumtijd", planDateModel, dateDisplay, timeDisplay) {

etcetera.

It works when I change dateDisplay to "dd MM yyyy", so that the month parses to a two digit number in stead of a shortened String (like 'Mar', 'Apr'...).

Reply | Threaded
Open this post in threaded view
|

Re: Dateparsing error kendo AjaxDateTimePicker only in March, May, October

Sebastien
I can make it work with:
final DateTimePicker datetimepicker = new
AjaxDateTimePicker("datetimepicker", Model.of(calendar.getTime()), "dd MMM
yyyy", "HH:mm")



On Tue, Mar 1, 2016 at 10:43 AM, hfriederichs <[hidden email]> wrote:

> It's not a DatePicker, but a AjaxDateTimePicker.
> I discovered it is indeed a pattern issue.
> This is my code:
>
> private final static String dateDisplay = "dd MMM yyyy";
> private final static String timeDisplay = "HH.mm";
> scheduleDateTimeField = new AjaxDateTimePicker("scheduledatumtijd",
> planDateModel, dateDisplay, timeDisplay) {
>
> etcetera.
>
> It works when I change dateDisplay to "dd MM yyyy", so that the month
> parses
> to a two digit number in stead of a shortened String (like 'Mar',
> 'Apr'...).
>
>
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/Dateparsing-error-kendo-AjaxDateTimePicker-only-in-March-May-October-tp4673756p4673763.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Dateparsing error kendo AjaxDateTimePicker only in March, May, October

hfriederichs
It's a Locale thing...

I Have:

@Override
public Locale getLocale() {
        return new Locale("nl", "NL");
}

When I change this to ("en", "US") it works fine for me too.

And I discovered another thing: the dutch short, three letter forms for months are the same as in English, except for March, May and October ('mrt', 'mei', 'okt' versus 'Mar', 'May' and 'Oct'), which explains the odd behaviour I mentioned in my first post.

Perhaps Dutch is not supported for this kind of GUI translations?
I'd rather not change to the English Locale.

Reply | Threaded
Open this post in threaded view
|

Re: Dateparsing error kendo AjaxDateTimePicker only in March, May, October

Sebastien
Yes, that explains, you need to have kendo cultures:

        <dependency>
            <groupId>com.googlecode.wicket-jquery-ui</groupId>
            <artifactId>wicket-kendo-ui-culture</artifactId>
            <version>7.2.0</version>
        </dependency>

Usage is (was, see bellow) explained here:
http://localhost:8080/wicket-jquery-ui/kendo/datetimepicker/LocaleDateTimePickerPage

But there is new classes to help:

 public void renderHead(IHeaderResponse response)
 {
     super.renderHead(response);

     response.render(new KendoCultureHeaderItem(KendoCulture.FR_FR));
 }

or in Application#init() - I guess your best choice

     public void init()
     {
         super.init();

         this.getHeaderContributorListenerCollection().add(new
KendoCultureHeaderContributor(Locale.GERMANY));
     }

Bet regards,
Sebastien


On Tue, Mar 1, 2016 at 12:46 PM, hfriederichs <[hidden email]> wrote:

> It's a Locale thing...
>
Reply | Threaded
Open this post in threaded view
|

Re: Dateparsing error kendo AjaxDateTimePicker only in March, May, October

Sebastien
Additional setup options:

        @Override
        public void renderHead(IHeaderResponse response)
        {
                super.renderHead(response);

                // response.render(new KendoCultureHeaderItem("fr")); // or fr-FR
                // response.render(new KendoCultureHeaderItem(KendoCulture.FR)); //
or KendoCulture.FR_FR
                response.render(new KendoCultureHeaderItem(Locale.FRENCH));
        }



On Tue, Mar 1, 2016 at 2:30 PM, Sebastien <[hidden email]> wrote:

> Yes, that explains, you need to have kendo cultures:
>
>         <dependency>
>             <groupId>com.googlecode.wicket-jquery-ui</groupId>
>             <artifactId>wicket-kendo-ui-culture</artifactId>
>             <version>7.2.0</version>
>         </dependency>
>
> Usage is (was, see bellow) explained here:
>
> http://localhost:8080/wicket-jquery-ui/kendo/datetimepicker/LocaleDateTimePickerPage
>
> But there is new classes to help:
>
>  public void renderHead(IHeaderResponse response)
>  {
>      super.renderHead(response);
>
>      response.render(new KendoCultureHeaderItem(KendoCulture.FR_FR));
>  }
>
> or in Application#init() - I guess your best choice
>
>      public void init()
>      {
>          super.init();
>
>          this.getHeaderContributorListenerCollection().add(new
> KendoCultureHeaderContributor(Locale.GERMANY));
>      }
>
> Bet regards,
> Sebastien
>
>
> On Tue, Mar 1, 2016 at 12:46 PM, hfriederichs <[hidden email]>
> wrote:
>
>> It's a Locale thing...
>>
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Dateparsing error kendo AjaxDateTimePicker only in March, May, October

Sebastien
I've added a todo to automatically register current culture and messages
https://github.com/sebfz1/wicket-jquery-ui/issues/222

I still should debate if it's a good idea or not... :/
Reply | Threaded
Open this post in threaded view
|

Re: Dateparsing error kendo AjaxDateTimePicker only in March, May, October

hfriederichs
In reply to this post by Sebastien
That solved the problem, thank you Sebastian!

By he way, when I use E in my date pattern, like in "EEEE d MMMM yyyy", that still doesn't work.

When the datetimepicker is displayed first,  it renders ok:

dinsdag 1 maart 2016

(dinsdag=tuesday, maart=march in Dutch)

But when I change the date, I get:

Error while parsing datetime: date was 'EEEE 17 maart 2016' and time was '19.00'



Reply | Threaded
Open this post in threaded view
|

Re: Dateparsing error kendo AjaxDateTimePicker only in March, May, October

Sebastien
IIRC, EEEE is not supported by kendi UI, try finding a previous post about
this... (maybe in the wicket-jquery-ui forum)

On Tue, Mar 1, 2016 at 3:11 PM, hfriederichs <[hidden email]> wrote:

> That solved the problem, thank you Sebastian!
>
> By he way, when I use E in my date pattern, like in "EEEE d MMMM yyyy",
> that
> still doesn't work.
>
> When the datetimepicker is displayed first,  it renders ok:
>
> dinsdag 1 maart 2016
>
> (dinsdag=tuesday, maart=march in Dutch)
>
> But when I change the date, I get:
>
> Error while parsing datetime: date was 'EEEE 17 maart 2016' and time was
> '19.00'
>
>
>
>
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/Dateparsing-error-kendo-AjaxDateTimePicker-only-in-March-May-October-tp4673756p4673779.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Dateparsing error kendo AjaxDateTimePicker only in March, May, October

Sebastien
Reply | Threaded
Open this post in threaded view
|

Re: Dateparsing error kendo AjaxDateTimePicker only in March, May, October

hfriederichs
EEE is the abbreviated day, EEEE the full day-name.
But EEE doesn't work either.
Reply | Threaded
Open this post in threaded view
|

Re: Dateparsing error kendo AjaxDateTimePicker only in March, May, October

Sebastien
Ok, please reopen the issue bellow with a description (is it only for
Dutch, is it repro with default/US locale for instance?)
https://github.com/sebfz1/wicket-jquery-ui/issues/216

No need a quickstart for this case. I will try to look at this before the
WE...

Thanks in advance,
Sebastien.
Reply | Threaded
Open this post in threaded view
|

Re: Dateparsing error kendo AjaxDateTimePicker only in March, May, October

hfriederichs
I'm not allowed to re-open the issue, so I added a comment to the closed issue.


Thank you so far