From 7c2b7b380829d1129fd645c93537b4a2e911a099 Mon Sep 17 00:00:00 2001 From: Rasmus Melchior Jacobsen Date: Thu, 21 Nov 2024 15:04:56 +0100 Subject: [PATCH] Fix danish locale to not use definite singular expression for weekdays Fixes #327 --- src/i18n/locales/da.ts | 2 +- test/i18n.ts | 11 ++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/i18n/locales/da.ts b/src/i18n/locales/da.ts index 91de714..2590d66 100644 --- a/src/i18n/locales/da.ts +++ b/src/i18n/locales/da.ts @@ -51,7 +51,7 @@ export class da implements Locale { return ", kun i %s"; } commaOnlyOnX0() { - return ", kun på %s"; + return ", på %se"; } commaAndOnX0() { return ", og på %s"; diff --git a/test/i18n.ts b/test/i18n.ts index 47bce1e..51d323a 100644 --- a/test/i18n.ts +++ b/test/i18n.ts @@ -1,6 +1,8 @@ import "mocha"; -import chai = require("chai"); + import cronstrue from "../src/cronstrue-i18n"; + +import chai = require("chai"); let assert = chai.assert; describe("i18n", function () { @@ -342,6 +344,13 @@ describe("i18n", function () { "Hvert 5. minut, mellem 15:00 og 15:59, mandag til og med fredag" ); }); + + it("0 3 * * 4", function () { + assert.equal( + cronstrue.toString(this.test?.title as string, { locale: "da" }), + "Kl 03:00, på torsdage" + ); + }); }); describe("fa", function () {