From 0ec8bdf12fcc853c4493f63bb47b45310fc03144 Mon Sep 17 00:00:00 2001 From: Marcelo Augusto Date: Fri, 4 Sep 2026 16:08:02 -0300 Subject: [PATCH] fix(site): normalize release dates and align cast control --- index.html | 21 +++++++++++++++++---- mcuapi-title-detail.html | 5 ++--- 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/index.html b/index.html index 2b72d61..a961661 100644 --- a/index.html +++ b/index.html @@ -2993,6 +2993,21 @@

Built it because the data should stay reachable.

return d.toLocaleDateString(undefined, { day: 'numeric', month: 'long', year: 'numeric' }); }; + var normalizeReleaseDate = function (value) { + if (typeof value !== 'string') { return null; } + var calendarDate = value.slice(0, 10); + if (!/^\d{4}-\d{2}-\d{2}$/.test(calendarDate)) { return null; } + var isDateOnly = value === calendarDate; + var isTimestamp = value.charAt(10) === 'T' && !isNaN(Date.parse(value)); + if (!isDateOnly && !isTimestamp) { return null; } + var parts = calendarDate.split('-').map(Number); + var date = new Date(parts[0], parts[1] - 1, parts[2]); + if (date.getFullYear() !== parts[0] || date.getMonth() !== parts[1] - 1 || date.getDate() !== parts[2]) { + return null; + } + return date; + }; + var tick = function (target) { var diff = Math.max(0, target.getTime() - Date.now()); var days = Math.floor(diff / 86400000); @@ -3031,10 +3046,8 @@

Built it because the data should stay reachable.

var item = json && json.total > 0 && json.data && json.data[0]; if (!item) { return; } - // Parsing a bare 'YYYY-MM-DD' string yields UTC midnight, which in a - // UTC-negative timezone renders as the previous day — appending a - // local-time component gets local midnight instead. - var releaseDate = new Date(item.release_date + 'T00:00:00'); + var releaseDate = normalizeReleaseDate(item.release_date); + if (!releaseDate) { return; } if (item.cover_url) { img.src = item.cover_url; diff --git a/mcuapi-title-detail.html b/mcuapi-title-detail.html index 5af3570..c1b8646 100644 --- a/mcuapi-title-detail.html +++ b/mcuapi-title-detail.html @@ -354,8 +354,7 @@ badge lines up across every card in a row instead of floating at whatever height that card's own text happens to end. */ .cast-tags{display:flex;gap:6px;flex-wrap:wrap;margin-top:auto;padding-top:3px} -.cast-first{font-family:var(--mono);font-size:10.5px;color:var(--muted);text-decoration:none;border-bottom:1px dashed var(--border-ui);align-self:flex-start} -.cast-first:hover{color:var(--fg);border-color:var(--fg)} +.cast-first{align-self:flex-start} .cast-empty,.pcs-empty{ font-family:var(--mono);font-size:12.5px;color:var(--muted); padding:20px;border:1px dashed var(--border);border-radius:3px;background:var(--surface); @@ -886,7 +885,7 @@

Raw response

var firstId = c.first_appearance_movie_id || c.first_appearance_tvshow_id; var crossRef = ''; if (firstType && !(firstType === currentType && firstId === currentId)) { - crossRef = ''; + crossRef = ''; } var variantHtml = c.variant_of ? 'Variant of…' : '';