jQuery UI Widgets Forums Grid Incorrect format of date

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

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
  • Incorrect format of date #106877

    Zabelsky
    Participant

    Good afternoon. I have a question.
    I have Grid,which have some columns with type “date” and cellsformat: ‘dd.MM.yyyy’
    Why If some object doesn’t have value (read null or empty value like “”), that cellsformat doesn’t work and date show like string( Sun Nov 17 2019 00:00:00 GMT+0300 (Саудовская Аравия, стандартное время)) ?
    How I can to fix this problem?
    Thanks a lot.

    Incorrect format of date #106920

    Peter Stoev
    Keymaster

    Hi Zabelsky,

    Have you tried setting nullable: true or false of your date column? It is also possible to customize the column rendering by handling the cellsrenderer column callback function.

    Hope this helps.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    https://www.jqwidgets.com

    Incorrect format of date #106925

    Zabelsky
    Participant

    Hi,Peter.
    I tried to use rendering by handling the cellrenderer column callback function,but that cellsformat didn`t work and return to cell the string like ( Sun Nov 17 2019 00:00:00 GMT+0300 (Саудовская Аравия, стандартное время)).but in function I was return the object.
    But I didn`t try setting nullable.
    Please,describe or give me example how to use setting nullable
    Big thanks,Peter.
    With best regards,
    Alexey Zabelsky.

    Incorrect format of date #106926

    Zabelsky
    Participant

    { text: "Visa", datafield: "_Visa", width: "16%", type: "date", cellsformat: 'dd.MM.yyyy', nullable: true }
    Is it correctly?
    Because I got http://prntscr.com/pedtgz (check screen,please)
    Second try:
    { text: "Visa", datafield: "_Visa", width: "16%", type: "date", cellsformat: 'dd.MM.yyyy', nullable: true, cellsrenderer: rendd }
    and rendd:

     var rendd = function (row, column, value) {
                if (value == null) {
                    return true;
                } else return value;
            }; 

    but I got result like in the 1th attemp

    Incorrect format of date #106931

    Peter Stoev
    Keymaster

    Hi Zabelsky,

    cellsrenderer overrides the cells rendering i.e cellsformat is not taken into account, when this is implemented. The value is a Date object i.e you can custom format it for your app’s needs.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    https://www.jqwidgets.com

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

You must be logged in to reply to this topic.