Skip to content

Commit a59fe03

Browse files
committed
Show year so far when clicking on current year
1 parent 07b6705 commit a59fe03

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/iso.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { toArray, groupBy, last } from 'lodash-es'
22

33
const dateFormat = new Intl.DateTimeFormat('en-US', { month: 'short', day: 'numeric', timeZone: 'UTC' })
4+
const sameDay = (d1, d2) => d1.toDateString() === d2.toDateString()
45

56
let days
67
let weeks
@@ -204,7 +205,9 @@ const loadStats = () => {
204205
firstDay = d.date
205206
}
206207

207-
if (days.at(-1) === d) {
208+
if (sameDay(d.date, new Date())) {
209+
lastDay = d.date
210+
} else if (!lastDay && days.at(-1) === d) {
208211
lastDay = d.date
209212
}
210213

0 commit comments

Comments
 (0)