Skip to content

Commit

Permalink
Fix cooldown schedule (#6480)
Browse files Browse the repository at this point in the history
  • Loading branch information
dharit-tan authored Oct 27, 2023
1 parent 2bd883d commit b6da96f
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ export const useChallengeCooldownSchedule = (

const getAudioMatchingCooldownLabel = (now: Dayjs, created_at: Dayjs) => {
const diff = now.diff(created_at, 'day')
if (diff === COOLDOWN_DAYS - 1) {
if (diff === COOLDOWN_DAYS) {
return messages.laterToday
} else if (diff === COOLDOWN_DAYS - 2) {
} else if (diff === COOLDOWN_DAYS - 1) {
return messages.tomorrow
}
return created_at.local().add(COOLDOWN_DAYS, 'day').format('ddd (M/D)')
Expand All @@ -55,7 +55,7 @@ const getAudioMatchingCooldownLabel = (now: Dayjs, created_at: Dayjs) => {
const formatAudioMatchingChallengeCooldownSchedule = (
challenges: UndisbursedUserChallenge[]
) => {
const now = dayjs.utc().startOf('day')
const now = dayjs.utc().endOf('day')
const cooldownChallenges = new Array(7)
challenges.forEach((c) => {
const createdAtUTC = dayjs.utc(c.created_at)
Expand Down

0 comments on commit b6da96f

Please sign in to comment.