How to show UTC date in Wijmo cell

Posted by: chhavi.sethi on 30 August 2020, 2:31 pm EST

  • Posted 30 August 2020, 2:31 pm EST

    Hi,

    When I create a Date object with an ISO date string, it converts the date to the local timezone which is expected in JavaScript. But in the Wijmo grid, I want to show the date as UTC timezone, how is it possible?

  • Posted 31 August 2020, 12:37 am EST

    Hi Chhavi,

    If you only need to display in UTC date, then you may use the formatItem event to convert the date value to UTC and change the innerHTML of the cell so that the UTC date is displayed. Note that the if you will use filtering along side this method, the FlexGridFilter will still display the original non-UTC dates.

    If you need to update the underlying data. then simply iterate over each item in FlexGrid and convert the data to UTC.

    Please refer to the sample link below for reference:

    https://stackblitz.com/edit/angular-dgnxxh

    Regards,

    Ashwin

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels