Skip to content

Commit e2d9c75

Browse files
committed
feat: sv-FI locale
1 parent dd66398 commit e2d9c75

File tree

5 files changed

+602
-0
lines changed

5 files changed

+602
-0
lines changed

package.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7300,6 +7300,16 @@
73007300
"default": "./locale/sv.js"
73017301
}
73027302
},
7303+
"./locale/sv-FI": {
7304+
"require": {
7305+
"types": "./locale/sv-FI.d.cts",
7306+
"default": "./locale/sv-FI.cjs"
7307+
},
7308+
"import": {
7309+
"types": "./locale/sv-FI.d.ts",
7310+
"default": "./locale/sv-FI.js"
7311+
}
7312+
},
73037313
"./locale/ta": {
73047314
"require": {
73057315
"types": "./locale/ta.d.cts",

src/locale/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ export * from "./sq/index.ts";
8383
export * from "./sr/index.ts";
8484
export * from "./sr-Latn/index.ts";
8585
export * from "./sv/index.ts";
86+
export * from "./sv-FI/index.ts";
8687
export * from "./ta/index.ts";
8788
export * from "./te/index.ts";
8889
export * from "./th/index.ts";
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
import { buildFormatLongFn } from "../../../_lib/buildFormatLongFn/index.ts";
2+
import { formatLong as svFormatLong } from "../../../sv/_lib/formatLong/index.ts";
3+
import type { FormatLong } from "../../../types.ts";
4+
5+
const dateFormats = {
6+
full: "EEEE d MMMM y",
7+
long: "d MMMM y",
8+
medium: "d MMM y",
9+
short: "d.M.y",
10+
};
11+
12+
const timeFormats = {
13+
full: "'kl'. HH.mm.ss zzzz",
14+
long: "HH.mm.ss z",
15+
medium: "HH.mm.ss",
16+
short: "H.mm",
17+
};
18+
19+
export const formatLong: FormatLong = {
20+
date: buildFormatLongFn({
21+
formats: dateFormats,
22+
defaultWidth: "full",
23+
}),
24+
25+
time: buildFormatLongFn({
26+
formats: timeFormats,
27+
defaultWidth: "full",
28+
}),
29+
30+
dateTime: svFormatLong.dateTime,
31+
};

src/locale/sv-FI/index.ts

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import { formatDistance } from "../sv/_lib/formatDistance/index.ts";
2+
import { formatRelative } from "../sv/_lib/formatRelative/index.ts";
3+
import { localize } from "../sv/_lib/localize/index.ts";
4+
import { match } from "../sv/_lib/match/index.ts";
5+
import type { Locale } from "../types.ts";
6+
import { formatLong } from "./_lib/formatLong/index.ts";
7+
8+
/**
9+
* @category Locales
10+
* @summary Swedish-speaking-Finnish locale.
11+
* @language Swedish
12+
* @iso-639-2 swe
13+
* @author Timo Saikkonen [@timosaikkonen](https://github.com/timosaikkonen)
14+
*/
15+
export const svFI: Locale = {
16+
code: "sv-FI",
17+
formatDistance: formatDistance,
18+
formatLong: formatLong,
19+
formatRelative: formatRelative,
20+
localize: localize,
21+
match: match,
22+
options: {
23+
weekStartsOn: 1 /* Monday */,
24+
firstWeekContainsDate: 4,
25+
},
26+
};

0 commit comments

Comments
 (0)