search envelope-o feed check
Home Unanswered Active Tags New Question
user comment-o

When create new event it shows wrong time

Asked by Dhiraj
5 years ago.

Hi,

I am using Daypilot calendar control in Angular 4, when i create new event by selecting time range It shows proper time on my local machine, But when i deploy it on one of our machine in Finland, it shows time 3 hours afterword, So if i select time range from 1 to 2, then it shows 4-5,
however i am setting locale value properly for that countrym

Can you please help me on it,

Thanks,
Dhiraj

Answer posted by Dan Letecky [DayPilot]
5 years ago.

Dhiraj,

How do you get the start/end dates of the selected range? The onTimeRangeSelect(ed) event handler returns DayPilot.Date object which uses the idealized time zone that the Calendar uses internally (see also https://api.daypilot.org/daypilot-date-class/).

You'll get the correct ISO 8601 string value (as a local representation) if you call DayPilot.Date.toString().

If you need the Date object please choose the appropriate method:

  • DayPilot.Date.toDate() returns the value as GMT base of the Date object
  • DayPilot.Date.toDateLocal() return the value as the local value of the Date object

Let me know if it doesn't help.

Comment posted by Dhiraj
5 years ago.

Thanks, It worked!

This question is more than 1 months old and has been closed. Please create a new question if you have anything to add.