Open ravikandpal31 opened 2 years ago
having same issue. Had to do big workaround to get things semi working
Setting the date before passing it into the date picker
startDate: dayjs().tz('Australia/Sydney'), endDate: dayjs().tz('Australia/Sydney'),
Converting it to UTC after getting the value from the date picker
// if a new date is selected ngx-daterangepicker-material converts the date time back to your local time.
// to fix this you pass true as a second value in .tz options so it changes the timezone but not the time
// https://day.js.org/docs/en/timezone/converting-to-zone for more information
// then convert to utc format for api
let startDate = dayjs(valueFromForm.startDate) .tz('Australia/Sydney', true) .utc() .format();
let endDate = dayjs(valueFromForm.endDate) .tz('Australia/Sydney', true) .utc() .format();
I am facing issue related to timezone handling in this component. Is there any options available to pass timezone to the component. Or is there any other way to display selected date in a particular timezone.