Question

Need to show date only on web client according to the timezone

  • 23 October 2023
  • 6 replies
  • 77 views

Userlevel 4
Badge +9
  • Sidekick (Partner)
  • 59 replies

Hi Experts,

We have the requirement to show only the date part for the plan_start_dttm field of task (on the web client). We tried to achieve this by adding a DATEONLY mask type on the custom metadata level.
 



So, now we got it to show this

 

 instead of this

 




This worked well from the UI p.o.v as well, because the user no longer has to select a time when setting this date (which is what they expected)


But then we ran into an issue with time zone differences. The customer time zone is UTC+10. Whenever a task was created before 10 a.m, the field returns the date part of the UTC time (without any timezone conversions), resulting in showing the previous date on the client.

Example,

with DATEONLY mask for the plan_start_dttm

  • If a task is created on the web client at 8.00 a.m (on brisbane timezone/utc+10), with the plan start date set to 23/10/2023 and saved, soon after saving the plan start date shows 22/10/2023. 
  • If a task is created on the web client at 11.00 a.m (on brisbane timezone), with the plan start date set to 23/10/2023 and saved, it correctly shows 23/10/2023 . 
    ​​​​​​​

with DATETIME mask for the plan_start_dttm​​​​​​​

If a task is created on the web client at 8.00 a.m (on brisbane timezone), with the plan start date set to 23/10/2023 and saved, the client shows the date & time converted to the timezone as 
23/10/2023 08:00. This is accurate in terms of the data, but not the desired UI look.

So, is this a limitation/bug? Can this be achieved without having to go for a code customization?

 


6 replies

Userlevel 6
Badge +26

Hi @Miraj 

When you wrote that 

  • If a task is created on the web client at 8.00 a.m (on brisbane timezone/utc+10), with the plan start date set to 23/10/2023 and saved, soon after saving the plan start date shows 22/10/2023. 

 

Where is it showing?

Cheers!

Userlevel 4
Badge +9

@Shneor Cheshin 

This can be observed under the task tab of the request screen,

 

 

Userlevel 6
Badge +26

hI @Miraj 

This could be a product bug.

Did you also configure the UI designer to be date only?

Cheers!

Userlevel 2
Badge +6

@Miraj What timezone is the computer? could you also take a look at the date in the database to see what time the server is putting on the record.

Cheers

Userlevel 4
Badge +9

@Shneor Cheshin Yes, both custom metadata and UI designer were set to dateonly for the field. 

@Morris The user computer is in the brisbane timezone (utc+10). The database stores the utc time. 
so, whenever a dateonly mask is applied to a date field (plan_start_dttm in our case), and we try to save it at such a time where the client day and the utc day fall on different days (in our case before 10 a.m in brisbane), the client shows the date only part of the utc date. But, when we have a datetime mask applied instead, the dates are shown as per the client’s timezone. 

Userlevel 6
Badge +26

@Miraj 

Sounds like a bug to me. I recommend opening a support call

Cheers!

Reply