From 7c8a09c27ad236f8ae4e8046d3a7e89406184b09 Mon Sep 17 00:00:00 2001 From: ray2c <160003873+ray2c@users.noreply.github.com> Date: Sun, 22 Feb 2026 00:23:41 +0800 Subject: [PATCH] Fixup localized countdown timer display --- src/layouts/Default.astro | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/layouts/Default.astro b/src/layouts/Default.astro index 0930537..9653632 100644 --- a/src/layouts/Default.astro +++ b/src/layouts/Default.astro @@ -130,12 +130,8 @@ const languageEntries = Object.entries(languages); const c = formatter.formatToParts(-value, unit); const offset = getOffset(unit); - if (p[0].type === 'literal') { - if (!c.length || c[0].type !== 'literal') { - prefix[offset] = p[0].value.length; - } else if (!c[0].value.endsWith(p[0].value)) { - prefix[offset] = p[0].value.length - extractCommon(p[0].value, c[0].value, true); - } + if (p[0].type === 'literal' && (!c.length || c[0].type !== 'literal' || !c[0].value.endsWith(p[0].value))) { + prefix[offset] = p[0].value.length; } if (p[p.length - 1].type === 'literal') { if (!c.length || c[c.length - 1].type !== 'literal') {