Skip to content

Commit

Permalink
fix: vendor closed now bug
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinand11 committed Oct 3, 2024
1 parent 34f52d2 commit 599ba9c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions services/api/src/modules/users/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export const isVendorOpen = (time: BusinessTime) => {
const timeSlot = time.schedule[day]
if (!timeSlot) return false
const { from, to } = timeSlot
const hour = nowAtTimezone.getHours()
const minute = nowAtTimezone.getMinutes()
return [hour >= from[0], hour <= to[0], minute >= from[1], minute <= to[1]].every(Boolean)
const start = new Date(nowAtTimezone.getFullYear(), nowAtTimezone.getMonth(), nowAtTimezone.getDate(), from.hr, from.min)
const end = new Date(nowAtTimezone.getFullYear(), nowAtTimezone.getMonth(), nowAtTimezone.getDate(), to.hr, to.min)
return nowAtTimezone >= start && nowAtTimezone <= end
}

0 comments on commit 599ba9c

Please sign in to comment.