mirror of
https://github.com/ankitects/anki.git
synced 2025-09-24 16:56:36 -04:00
Calendar graph uses consistent colors across years (#1585)
This commit is contained in:
parent
4360fd16fb
commit
ead75f2898
1 changed files with 3 additions and 3 deletions
|
@ -98,6 +98,9 @@ export function renderCalendar(
|
||||||
let maxCount = 0;
|
let maxCount = 0;
|
||||||
for (const [day, count] of sourceData.reviewCount.entries()) {
|
for (const [day, count] of sourceData.reviewCount.entries()) {
|
||||||
const date = new Date(now.getTime() + day * 86400 * 1000);
|
const date = new Date(now.getTime() + day * 86400 * 1000);
|
||||||
|
if (count > maxCount) {
|
||||||
|
maxCount = count;
|
||||||
|
}
|
||||||
if (date.getFullYear() != targetYear) {
|
if (date.getFullYear() != targetYear) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -105,9 +108,6 @@ export function renderCalendar(
|
||||||
const weekDay = timeDay.count(sourceData.timeFunction(date), date);
|
const weekDay = timeDay.count(sourceData.timeFunction(date), date);
|
||||||
const yearDay = timeDay.count(timeYear(date), date);
|
const yearDay = timeDay.count(timeYear(date), date);
|
||||||
dayMap.set(yearDay, { day, count, weekNumber, weekDay, date } as DayDatum);
|
dayMap.set(yearDay, { day, count, weekNumber, weekDay, date } as DayDatum);
|
||||||
if (count > maxCount) {
|
|
||||||
maxCount = count;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!maxCount) {
|
if (!maxCount) {
|
||||||
|
|
Loading…
Reference in a new issue