Incorrect timezone with "Minimum Date" on DateTime selector validator

That actually doesn't work, the issue is that Min Date stubbornly converts the time to the local timezone for Min Date.

image

But that got me on the right track. Figured it out with this code:

{{ moment(calendarDataEntryDTStart.value).tz(calendarDataEntryAllDay.value == true ? 'UTC' : selectedUser.data.timezone || 'local').toISOString(true) }}

You read in with moment, set the timezone, then use toISOString(true) to keep the offset.

1 Like