Skip to content

Commit 862a4ad

Browse files
committed
support all languages
1 parent cdc16ae commit 862a4ad

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

modules/default/clock/clock.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,8 @@ Module.register("clock", {
227227
const weekWrapperInnerHTML = this.translate("WEEK", { weekNumber: now.week() });
228228

229229
if (this.config.showWeek === "short") {
230-
weekWrapper.innerHTML = weekWrapperInnerHTML.replace("Week ", "W");
230+
const [weekText, weekValue] = weekWrapperInnerHTML.split(" ");
231+
weekWrapper.innerHTML = weekText[0] + weekValue;
231232
} else {
232233
weekWrapper.innerHTML = weekWrapperInnerHTML;
233234
}

tests/e2e/modules/clock_es_spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ describe("Clock set to spanish language module", () => {
7070
});
7171

7272
it("shows week with correct format", async () => {
73-
const weekRegex = /^Semana [0-9]{1,2}$/;
73+
const weekRegex = /^S[0-9]{1,2}$/;
7474
await expect(helpers.testMatch(".clock .week", weekRegex)).resolves.toBe(true);
7575
});
7676
});

0 commit comments

Comments
 (0)