kendo-labs / knockout-kendo

A project to create a robust set of Knockout.js bindings for the Kendo UI widgets.
http://kendo-labs.github.com/knockout-kendo/
273 stars 144 forks source link

Datepicker binding issues #32

Closed fbuchinger closed 12 years ago

fbuchinger commented 12 years ago

I'm having some issues with the knockout-kendo bindings for the datepicker/datetimepicker widget, unfortunately I'm unable to reproduce them in a simple jsfiddle (I'm using a fairly complex hierarchical viewmodel for representing a form).

The first issue was that the datepicker simply dumps out the standard date.toString() format instead of the one I provide in the kendo datepicker widget settings, i.e. Fri Oct 19 2012 15:02:01 GMT+0200 (Mitteleuropäische Sommerzeit) instead of 10/19/2012. I could circumvent this by setting the bound observable to a string in the desired format instead of a date object. This is not my desired way to fix this, because i need the date object for other calculations.

The second issue: I can select a date in the datepicker popup, which closes then, but the selected value is neither set on the bound observable nor in the textfield of the widget. The other way works: dateObservable("1/1/2000'') sets textfield and popup of the picker to the correct date.

I know this sounds impossible, but could you give me some hints on how i could debug this issues?

rniemeyer commented 12 years ago

Hmmm, not sure the best way to figure this one out. Here is a fiddle with the latest code: http://jsfiddle.net/rniemeyer/5VGCK/. Maybe you can keep trying to get it closer to your scenario. You should be dealing with Date objects rather than having to move to strings.

fbuchinger commented 12 years ago

Hi Ryan, thanks for your hints! After an endless debugging session, I located the issue at a completely different spot: the kendo ui datepicker got disturbed because I included the jQuery globalize library BEFORE the Kendo UI library in my page, if you change the order (first Kendo UI, then globalize) everything works fine. I've updated your fiddle to reproduce the issue (http://jsfiddle.net/XBSjf/1/) and notified the KendoUI team at Telerik about it.