gastromatic / calendar-date

Immutable object to represent and work with a calendar date with zero dependencies
MIT License
21 stars 1 forks source link

Add a toLocalDate method #302

Closed bjaminp closed 3 months ago

bjaminp commented 3 months ago

Currently toDate() returns a UTC date. It would be helpful to add a 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

co-sic commented 3 months ago

completed in https://github.com/gastromatic/calendar-date/pull/303 @bjaminp thanks for contributing :)