Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Timezone issues

    Hi,

    We’re running into a few issues with handling timezones in the Smartclient JS version and need some help with the following:
    1. We'd like to customize date formatting in ListGrids. For example, one column should display dates as "YYYY-MM-DD HH:MM:SS" and another as "YYYY-MM-DD HH:MM".
    2. All dates in ListGrids should be displayed in UTC without timezones.
    3. The date filters in ListGrids should work with UTC time(we select/type UTC time and want to see UTC time selected).
    4. It should be possible to manually type input dates in the ListGrids date filters in the "YYYY-MM-DD HH:MM:SS" format.
    Could somebody help us with this?

    P.S. Besides listgrids, dates should work normally with timezones.

    Thanks!


    #2
    You need to look at:

    1. dataSourceField.format: this allows you to declare whatever date format you want, on a per-field basis

    2. Time.setDefaultDisplayTimezone(): this allows you to force all timezone display to UTC, regardless of the user's locale

    Comment


      #3
      Hello, i hope that it's ok to hijack this thread, because i have a very similar question.

      Our product is in a single timzeone right now, with customers in Scandinavia only. However, sometimes we have clients travelling to other time zones. What happens right now is that it displays GMT+1 times in the Local time, so if an event occurs at 17.00 Swedish time, it becomes 01.00 in the client browser.

      So, the use case is that in the client browser, there is a checkbox to "work with Swedish times" (or perhaps to decide what timezone to display as) so that displays and forms can be viewed and edited as if the user was in the local timezone. But the times still come in as they do today.

      Is that the method you describe above or do i need to do something more?
      Last edited by mathias; 15 Dec 2025, 00:30.

      Comment


        #4
        Yes, this is what setDefaultDisplayTimezone() does. But note, you will need to reload the application; there's no provision for changing on the fly.

        Comment

        Working...
        X