jQWidgets Forums

jQuery UI Widgets Forums Grid Time is not getting sort properly

This topic contains 3 replies, has 2 voices, and was last updated by  Dimitar 11 years, 5 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
  • Time is not getting sort properly #46681

    mukund
    Participant

    Hi, I am using a column type date and displaying there only time value, I have used var timeString = $.jqx.dataFormat.formatdate(timeObject, “T”) to format my date time in time string and cellsformat = t, now this column is displaying time in a correct format but it is not getting sort properly. Can you suggest why this is happening. One more thing is there any specific column type available for time.

    Time is not getting sort properly #46694

    Dimitar
    Participant

    Hello mukund,

    Unfortunately, there is no time column. The date columns are sorted by date first and then by time, whether or not you show the date. You can, however, implement custom sorting. Another option is to modify your data in the source beforeLoadComplete callback function (change all dates to be the same).

    Best Regards,
    Dimitar

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

    Time is not getting sort properly #46809

    mukund
    Participant

    Thanks for your reply. I have another query, I am getting dateTime value from java side as yyyy-mm-dd HH:mm:ss.fff, I want to localize this and display in a grid cell of type date. But for that first i have to use $.jqx.dataFormat.parsedate(dateObject, yyyy-MM-dd HH:mm:ss.fff) and then $.jqx.dataFormat.formatdate(dateTimeObject, “yyyy-MM-dd HH:mm:ss”) and after using formatdate i pass the value to cell. I am also using localizationobj.patterns = patterns (where patterns may be ‘D’ or ‘d’ etc.) to localize values. I want to know if i can localize my dates without altering data (through parse and format) which i am getting from java side.

    Time is not getting sort properly #46815

    Dimitar
    Participant

    Hi mukund,

    You do not need to modify your data, just set the column cellsformat property. Here are some of its possible values:

    “d”-the day of the month;
    “dd”-the day of the month;
    “ddd”-the abbreviated name of the day of the week;
    “dddd”- the full name of the day of the week;
    “h”-the hour, using a 12-hour clock from 1 to 12;
    “hh”-the hour, using a 12-hour clock from 01 to 12;
    “H”-the hour, using a 24-hour clock from 0 to 23;
    “HH”- the hour, using a 24-hour clock from 00 to 23;
    “m”-the minute, from 0 through 59;
    “mm”-the minutes,from 00 though59;
    “M”- the month, from 1 through 12;
    “MM”- the month, from 01 through 12;
    “MMM”-the abbreviated name of the month;
    “MMMM”-the full name of the month;
    “s”-the second, from 0 through 59;
    “ss”-the second, from 00 through 59;
    “t”- the first character of the AM/PM designator;
    “tt”-the AM/PM designator;
    “y”- the year, from 0 to 99;
    “yy”- the year, from 00 to 99;
    “yyy”-the year, with a minimum of three digits;
    “yyyy”-the year as a four-digit number;
    “yyyyy”-the year as a four-digit number.

    You can also set your own, custom, cellsformat, e.g.:

    { text: 'Ship Date', datafield: 'date', columntype: 'datetimeinput', width: 110, align: 'right', cellsalign: 'right', cellsformat: 'yyyy-MM-dd' }

    which would output today’s date as “2013-12-20”.

    Best Regards,
    Dimitar

    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.