Skip to content

Commit

Permalink
Merge pull request #282 from simPod/getTimeZoneOffset
Browse files Browse the repository at this point in the history
fix: make getTimeZoneOffset's 2nd arg optional vol.2
  • Loading branch information
marnusw committed Apr 16, 2024
2 parents e632f5f + 5d57f29 commit 1181fe6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/format/formatters/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ export const formatters: Record<
},
}

function getTimeZoneOffset(timeZone: string | undefined, originalDate?: Date) {
function getTimeZoneOffset(timeZone: string | undefined, originalDate: Date|undefined = undefined) {
const timeZoneOffset = timeZone
? tzParseTimezone(timeZone, originalDate, true) / MILLISECONDS_IN_MINUTE
: (originalDate?.getTimezoneOffset() ?? 0)
Expand Down

0 comments on commit 1181fe6

Please sign in to comment.