jQWidgets Forums

jQuery UI Widgets Forums Editors DateTimeInput Binding DateTimeInput control with knockout model.

This topic contains 3 replies, has 2 voices, and was last updated by  Peter Stoev 11 years, 4 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author

  • Naresh
    Participant

    Hi,

    I’m using v2.8.2 version.

    I noticed one issue with jqxDateTimeInput control while binding with knockout. I used in the following way

    <div style=’margin-top: 3px;’ id=’date_expected’ class=’date_expected’ data-bind=”jqxDateTimeInput: { width: ‘200px’, height: ’20px’, formatString: ‘MM-dd-yyyy’, theme: theme, value: DateValue} “>
    </div>

    The issue i got is the date which is binding is one day less than the actual date which i’m assigning.

    For example :
    The DateValue is coming as 27/3/2013
    But the value binding as 26/3/2013

    I found the same issue in jqxGrid and fixed it by giving the format in data adapter
    { name: ‘DateValue’, type: ‘date’, format: “yyyy-MM-ddTHH:mm:ss” },

    Can anyone suggest me any solution for this issue

    Thanks in advance,
    Naresh


    Peter Stoev
    Keymaster

    Hi Naresh,

    jqxDateTimeInput uses JavaScript Date object for displaying data so if you pass String in the MM-dd-yyyy format, the widget will do new Date(MM-dd-yyyy string) and will display the result. Make your DateValue a JavaScript date object and it would work. Also I suggest you to use a newer version of the software.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com/


    Naresh
    Participant

    Hi,

    Thanks for your response,

    The actual date to populate is ‘2013-10-25T00:00:00

    But when converting to new Date(2013-10-25T00:00:00) the result is coming as
    Thu Oct 24 2013 18:00:00 GMT-0600 (Mountain Daylight Time)

    This resulting date is populating in the control, is there any way to just bind the actual date.

    I have upgraded jqwidgets to v3.0.3.

    Thanks,
    Naresh


    Peter Stoev
    Keymaster

    Hi Naresh,

    There are different type of Date object constructors – http://www.w3schools.com/jsref/jsref_obj_date.asp. The one that you use may not be the best solution for you.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com/

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.