jQWidgets Forums

jQuery UI Widgets Forums General Discussions Dates Not working with IE but Firefix and Chrome

Tagged: 

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

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

  • walker1234
    Participant

    I am displaying dates on my browser using jQXGrid. The dates are correctly displayed on Firefox and Chrome as shown in the screenshots below :

    For Chrome and Firefox:

    However, for IE, it doesn’t display it properly (shows future dates).
    From IE :

    I am using the following version if that helps:

    jQWidgets v4.3.0 (2016-Oct)
    Copyright (c) 2011-2016 jQWidgets.

    What could be the problem?


    admin
    Keymaster

    The used version is quite old. May be that is the issue.

    Regards,
    Peter


    walker1234
    Participant

    Thanks. Could you tell me if there were any IE browser specific changes after the Oct 2016 version 4.3.0 which are not compatible with the IE 11 that I am currently using for testing?


    admin
    Keymaster

    This is not IE specific. This is more how javascript Date objects work and are parsed by different browsers. In any way, if you specify the “format” when you bind the Grid, such issue will never happen.

    Regards,
    Peter


    walker1234
    Participant

    Kindly take a look at the JSfiddle below. I have already specified the format.

    https://jsfiddle.net/walker123/moLzuy7k/4/

    It shows the correct date in chrome and today’s date in IE instead of 7/15/2014. Please let me know if I am missing anything.

    Thanks


    Peter Stoev
    Keymaster

    Hi walkter1234,

    This code has an error. The format property which is set in the dataAdapter object should match the data source’s format i.e you have a Date string like that: 11/15/2015 07:00:00.0 and the format is set to “MM.dd.yyyy”. I do not know why this is done.The actual format is: .’MM/dd/yyyy hh:mm:ss.z’ The following example demonstrates that the logic is working in IE 11, Chrome, FF and Edge – https://jsfiddle.net/5tt9bcbL/1/

    Regards,
    Peter


    walker1234
    Participant

    Although your fiddle works in my IE. When I made the changes in my code as per your fiddle, it’s still showing same problem. I tried using moment as well like this

    return '<span style="position: relative; width: 100%; margin: 4px; float: ' + columnproperties.cellsalign + ';">' + moment(value).format("MM/DD/YY") + icon + '</span>';

    but no change.


    Peter Stoev
    Keymaster

    Hi walkter1234,

    My fiddle demonstrates that the Grid correctly loads Dates when the format setting is set to match the data source’s dates format. Update the fiddle with your additional data and share it so we can look at it. Also the fiddle I sent you uses the current version of jQWidgets – 5.7.2, not jQWidgets – 4.3.0 which you use. I suggest you to update to the current version.

    Regards,
    Peter

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

You must be logged in to reply to this topic.