Closed bjaminp closed 3 months ago
Currently toDate() returns a UTC date. It would be helpful to add a toLocalDate().
toDate()
toLocalDate()
Example: const calendarDate = CalendarDate.nowLocal(); //2024-05-31 const date = calendarDate.toDate(); //Thu May 30 2024 18:00:00 GMT-0600 const localDate = calendarDate.toLocalDate(); //Fri May 31 2024 00:00:00 GMT-0600
const calendarDate = CalendarDate.nowLocal(); //2024-05-31
const date = calendarDate.toDate(); //Thu May 30 2024 18:00:00 GMT-0600
const localDate = calendarDate.toLocalDate(); //Fri May 31 2024 00:00:00 GMT-0600
completed in https://github.com/gastromatic/calendar-date/pull/303 @bjaminp thanks for contributing :)
Currently
toDate()
returns a UTC date. It would be helpful to add atoLocalDate()
.Example:
const calendarDate = CalendarDate.nowLocal(); //2024-05-31
const date = calendarDate.toDate(); //Thu May 30 2024 18:00:00 GMT-0600
const localDate = calendarDate.toLocalDate(); //Fri May 31 2024 00:00:00 GMT-0600