From f3756dac8a49f3b5599fd50f4c631da4168e9eb0 Mon Sep 17 00:00:00 2001 From: Nathan Reiner Date: Mon, 24 Nov 2025 21:13:47 +0100 Subject: add jump-to month --- static/month.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'static/month.js') diff --git a/static/month.js b/static/month.js index 7875f36..05037d4 100644 --- a/static/month.js +++ b/static/month.js @@ -55,7 +55,7 @@ export default class Month { } is_same(other) { - return this.year == other.year || this.month == other.month; + return this.year == other?.year && this.month == other?.month; } is_same_year(other) { @@ -68,8 +68,14 @@ export default class Month { return date.toLocaleDateString('default', { month: 'long' }) } + static from_unix(date) { + if (date == null) return null; + + return Month.from_date(new Date(date * 1000)); + } + static from_date(date) { - return new Month(date.getMonth() - 1, date.getFullYear()); + return new Month(date.getMonth() + 1, date.getFullYear()); } static from_string(string) { -- cgit v1.2.3-70-g09d2