Skip to content

Commit 7c8a09c

Browse files
authored
Fixup localized countdown timer display
1 parent 698ddbd commit 7c8a09c

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

src/layouts/Default.astro

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -130,12 +130,8 @@ const languageEntries = Object.entries(languages);
130130
const c = formatter.formatToParts(-value, unit);
131131

132132
const offset = getOffset(unit);
133-
if (p[0].type === 'literal') {
134-
if (!c.length || c[0].type !== 'literal') {
135-
prefix[offset] = p[0].value.length;
136-
} else if (!c[0].value.endsWith(p[0].value)) {
137-
prefix[offset] = p[0].value.length - extractCommon(p[0].value, c[0].value, true);
138-
}
133+
if (p[0].type === 'literal' && (!c.length || c[0].type !== 'literal' || !c[0].value.endsWith(p[0].value))) {
134+
prefix[offset] = p[0].value.length;
139135
}
140136
if (p[p.length - 1].type === 'literal') {
141137
if (!c.length || c[c.length - 1].type !== 'literal') {

0 commit comments

Comments
 (0)