Skip to content

Commit 368dce1

Browse files
authored
Show missing regions in tooltip
1 parent 5d7bf50 commit 368dce1

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

app.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -319,9 +319,9 @@ function calculateDayStatistics(fromDate, toDate) {
319319
} else if (r.subdivisions) {
320320
const regions = r.subdivisions.map(s => s.code.split("-").slice(0, 2).join("-"))
321321
regions.forEach(code => {
322+
infos[label].Subdivisions.add(code);
322323
if (countryPop[code]) {
323-
holidayRegions.add(code);
324-
infos[label].Subdivisions.add(code);
324+
holidayRegions.add(code)
325325
} else {
326326
missingRegions.add(code)
327327
}
@@ -347,7 +347,7 @@ function calculateDayStatistics(fromDate, toDate) {
347347
for (const [label, info] of Object.entries(infos)) {
348348
if (info.All || info.Subdivisions.size > 0) {
349349
//const divisionsText = [...info.Subdivisions].map((s) => s.split("-")[1]).toSorted().join(", ");
350-
const divisionsText = i18n.in + " " + [...info.Subdivisions].map((s) => regionNames[s]).toSorted().join(", ");
350+
const divisionsText = i18n.in + " " + [...info.Subdivisions].map((s) => regionNames[s] || s).toSorted().join(", ");
351351
tooltip.push(`${label} <span class="tooltip-info">(${info.Type} ${info.All ? i18n.nationwide : divisionsText})</span>`)
352352
}
353353
}

0 commit comments

Comments
 (0)