mirror of
https://github.com/tiennm99/awesome-advent-of-code.git
synced 2026-10-17 08:14:10 +00:00
upate-badge: handle failed moments
This commit is contained in:
1 file changed
+4
@@ -80,6 +80,10 @@ function colorScale(steps, colors, reversed) {
|
||||
}
|
||||
|
||||
function age(date) {
|
||||
if (!date.add) {
|
||||
return "red"
|
||||
}
|
||||
|
||||
const now = moment()
|
||||
const then = moment(date)
|
||||
if (now.diff(date) < 0) date.add(-1, 'y')
|
||||
|
||||
Reference in new issue
Block a user