Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

Content Fragment | How to save the date in author given time zone

Avatar

Avatar
Validate 1
Level 1
sharms13
Level 1

Likes

0 likes

Total Posts

6 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Give Back
View profile

Avatar
Validate 1
Level 1
sharms13
Level 1

Likes

0 likes

Total Posts

6 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Give Back
View profile
sharms13
Level 1

18-05-2021

Hi All,

 

We have a content fragment template which has date field  and Time Zone dropdown. Now our requirement is that when the author selects a date and the time zone we want the date to be saved in the author selected time zone format.

For example , if author has entered date as "May 21,2021 11:29 am" and selected Time zone as "UTC+8: Hong Kong, Beijing, Kaula Lumpur"  then instead of saving the date  as "2021-05-21T11:29:00.000+05:30" it should be saved like "2021-05-21T11:29:00.000+08:00"  which is author selected time zone format.

 

One approach we are planning is to invoke a listener or a javascript function when the author tries to save the content fragment.

 

Please suggest if anyone has come up with the similar kind of use-case and solved it. Also the approach taken to achieve the same.

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Boost 100
Level 7
rush_pawan
Level 7

Likes

120 likes

Total Posts

192 posts

Correct Reply

77 solutions
Top badges earned
Boost 100
Validate 1
Ignite 1
Give Back 5
Give Back 3
View profile

Avatar
Boost 100
Level 7
rush_pawan
Level 7

Likes

120 likes

Total Posts

192 posts

Correct Reply

77 solutions
Top badges earned
Boost 100
Validate 1
Ignite 1
Give Back 5
Give Back 3
View profile
rush_pawan
Level 7

18-05-2021

Hello,

 

We went through this and our approach was

 

- rather changing the time and saving author specific time zone better to keep the server time zone (to keep common across for business logic and use cases) and calculate it based on client location while rendering the content. benefit we saw was a common client side solution to handle time zone difference and was applicable for any such rendering to content rather writing complex logic to figure out each different saved time zone according to author and then calculate these for a end user time zone.

 

i hope, i was able to clarify. hope this helps!!

 

thanks.

 

 

Answers (0)