fix(web): handle buckets before year 1000 (#21832)

This commit is contained in:
Jason Rasmussen
2025-09-11 15:36:16 -04:00
committed by GitHub
parent 03af60e8eb
commit f29230c8a6
2 changed files with 16 additions and 3 deletions

View File

@@ -94,8 +94,11 @@ export const fromTimelinePlainYearMonth = (timelineYearMonth: TimelineYearMonth)
{ zone: 'local', locale: get(locale) },
) as DateTime<true>;
export const toISOYearMonthUTC = ({ year, month }: TimelineYearMonth): string =>
`${year}-${month.toString().padStart(2, '0')}-01T00:00:00.000Z`;
export const toISOYearMonthUTC = ({ year, month }: TimelineYearMonth): string => {
const yearFull = `${year}`.padStart(4, '0');
const monthFull = `${month}`.padStart(2, '0');
return `${yearFull}-${monthFull}-01T00:00:00.000Z`;
};
export function formatMonthGroupTitle(_date: DateTime): string {
if (!_date.isValid) {