mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 22:12:21 -04:00
fix incorrect calendar day labels
https://forums.ankiweb.net/t/day-of-the-week-legend-on-heatmap/9450/7
This commit is contained in:
parent
d8a0df2a62
commit
ab8e53f66e
1 changed files with 4 additions and 1 deletions
|
@ -61,7 +61,10 @@ export class I18n {
|
||||||
|
|
||||||
weekdayLabel(n: number): string {
|
weekdayLabel(n: number): string {
|
||||||
const firstLang = this.bundles[0].locales[0];
|
const firstLang = this.bundles[0].locales[0];
|
||||||
return new Date(86_400_000 * (3 + n)).toLocaleDateString(firstLang, {
|
const now = new Date();
|
||||||
|
const daysFromToday = -now.getDay() + n;
|
||||||
|
const desiredDay = new Date(now.getTime() + daysFromToday * 86_400_000);
|
||||||
|
return desiredDay.toLocaleDateString(firstLang, {
|
||||||
weekday: "narrow",
|
weekday: "narrow",
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue