( date: Date, localDate: string, timezone?: string, )
| 656 | // `timezone`. The API reports streak days as local date strings, so compare |
| 657 | // the day in that zone instead of turning the string into a UTC instant. |
| 658 | export const isLocalDateInTimezone = ( |
| 659 | date: Date, |
| 660 | localDate: string, |
| 661 | timezone?: string, |
| 662 | ): boolean => { |
| 663 | if (Number.isNaN(date.getTime())) { |
| 664 | return false; |
| 665 | } |
| 666 | |
| 667 | return dateFormatInTimezone(date, 'yyyy-MM-dd', timezone) === localDate; |
| 668 | }; |
| 669 | |
| 670 | export const getTimezoneOffsetLabel = (timezone: string): string => { |
| 671 | const resolvedTimezone = timezone || DEFAULT_TIMEZONE; |
no test coverage detected