Skip to content

Commit

Permalink
Use UTC times consistently for daily classifications
Browse files Browse the repository at this point in the history
  • Loading branch information
eatyourgreens committed Nov 5, 2024
1 parent 55d4d50 commit 15031c7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ function DailyClassificationsChartContainer({
const [year, monthIndex, date] = period.split('-')
const utcDay = Date.UTC(year, monthIndex - 1, date)
const day = new Date(utcDay)
const isToday = day.getUTCDay() === TODAY.getDay()
const isToday = day.getUTCDay() === TODAY.getUTCDay()
const count = isToday ? counts.today : statsCount
const longLabel = day.toLocaleDateString(locale, { timeZone: 'UTC', weekday: 'long' })
const alt = `${longLabel}: ${count}`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ const YourStats = types
weekDay.setUTCDate(newDate)
const period = weekDay.toISOString().substring(0, 10)
const { count } = dailyCounts.find(count => count.period.startsWith(period)) || { count: 0, period }
const dayNumber = weekDay.getDay()
const dayNumber = weekDay.getUTCDay()
weeklyStats.push({
count,
dayNumber,
Expand Down

0 comments on commit 15031c7

Please sign in to comment.