Skip to content

Commit

Permalink
SUL23-600 show closing minutes if they are not 00
Browse files Browse the repository at this point in the history
  • Loading branch information
pookmish committed Aug 15, 2024
1 parent b1bb27b commit ed71add
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions src/lib/hooks/useTodayLibraryHours.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,9 @@ const useTodayLibraryHours = (branchId?: string): HoursProps | undefined => {
isOpen = rightNow >= openTime && rightNow < closeTime
}

const closingTime = closeTime
?.toLocaleTimeString("en-US", {
hour: "numeric",
minute: "numeric",
timeZone: "America/Los_Angeles",
})
.toLowerCase()
const closingTimeFormat: Intl.DateTimeFormatOptions = {hour: "numeric", timeZone: "America/Los_Angeles"}
if (closeTime?.getMinutes() !== 0) closingTimeFormat.minute = "2-digit"
const closingTime = closeTime?.toLocaleTimeString("en-US", closingTimeFormat).toLowerCase()

const openingTime = openTime
?.toLocaleTimeString("en-US", {
Expand Down

0 comments on commit ed71add

Please sign in to comment.