Skip to content

Commit

Permalink
fixup, indicate "unknown" if year or type is missing
Browse files Browse the repository at this point in the history
  • Loading branch information
candela97 committed Mar 31, 2024
1 parent 6263bb2 commit 5807de6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@
const types = {};
for (const item of document.querySelectorAll(".account_table tr")) {
const dateStr = item.querySelector(".license_date_col")?.textContent.trim();
const type = item.querySelector(".license_acquisition_col")?.textContent.trim();
if (!dateStr || !type) { continue; }
const dateStr = item.querySelector("td.license_date_col")?.textContent.trim();
if (!dateStr) { continue; }
const year = /\d{4}/.exec(dateStr)?.[0] ?? "";
const year = /\d{4}/.exec(dateStr)?.[0] ?? Localization.str.thewordunknown;
const type = item.querySelector("td.license_acquisition_col")?.textContent.trim() || Localization.str.thewordunknown;
(list[year] ??= {})[type] = (list[year][type] ?? 0) + 1;
types[type] = (types[type] ?? 0) + 1;
Expand Down Expand Up @@ -105,6 +105,7 @@
font-size: 22px;
font-family: "Motiva Sans", Sans-serif;
font-weight: normal;
text-transform: uppercase;
}
button {
vertical-align: text-bottom;
Expand Down
1 change: 1 addition & 0 deletions src/localization/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"toomanyrequests": "Too Many Requests",
"show_comments": "Show Comments",
"hide_comments": "Hide Comments",
"thewordunknown": "Unknown",
"calc_workshop_size": {
"file_size": "File size __size__",
"calc_size": "Calculate Total Size",
Expand Down

0 comments on commit 5807de6

Please sign in to comment.