Skip to content

Commit

Permalink
Add toBroadcastDateTime
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexey Novikov committed Jun 11, 2024
1 parent 82ac7d5 commit e6d9bdc
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/calendar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ export function toCalendarDateTime<IsValid extends boolean>(
return broadcast.hour < 6 ? broadcast.plus({ day: 1 }) : broadcast;
}

export function toBroadcastDateTime<IsValid extends boolean>(
calendar: DateTime<IsValid>,
): DateTime<IsValid> {
return calendar.hour < 6 ? calendar.minus({ day: 1 }) : calendar;
}

export function getBroadcastCalendar<IsValid extends boolean>(
date: DateTime<IsValid>,
) {
Expand Down

0 comments on commit e6d9bdc

Please sign in to comment.