MCPcopy Create free account
hub / github.com/dailydotdev/apps / isSameDayInTimezone

Function isSameDayInTimezone

packages/shared/src/lib/timezones.ts:621–636  ·  view source on GitHub ↗
(
  date1: Date,
  date2: Date,
  timezone?: string,
)

Source from the content-addressed store, hash-verified

619};
620
621export const isSameDayInTimezone = (
622 date1: Date,
623 date2: Date,
624 timezone?: string,
625): boolean => {
626 const dateFormat = 'dd-MM-yyyy';
627
628 if (Number.isNaN(date1.getTime()) || Number.isNaN(date2.getTime())) {
629 return false;
630 }
631
632 return (
633 dateFormatInTimezone(date1, dateFormat, timezone) ===
634 dateFormatInTimezone(date2, dateFormat, timezone)
635 );
636};
637
638export const getTimezoneOffsetLabel = (timezone: string): string => {
639 const resolvedTimezone = timezone || DEFAULT_TIMEZONE;

Callers 6

ReadingStreakButtonFunction · 0.90
getStreakFunction · 0.90
ReadingStreakPopupFunction · 0.90
useReadingStreakFunction · 0.90
useReadingStreakSummaryFunction · 0.90
useViewPostFunction · 0.90

Calls 1

dateFormatInTimezoneFunction · 0.85

Tested by

no test coverage detected