Skip to content

Commit d12c698

Browse files
authored
Merge pull request #620 from wanasit/dev_no_dayjs
Remove DayJS usages in src/locales.
2 parents e25fa10 + 7497cc1 commit d12c698

29 files changed

+498
-541
lines changed

package-lock.json

Lines changed: 73 additions & 99 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/locales/de/constants.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import { OpUnitType, QUnitType } from "dayjs";
21
import { matchAnyPattern, repeatedTimeunitPattern } from "../../utils/pattern";
32
import { findMostLikelyADYear } from "../../calculation/years";
43
import { Duration } from "../../calculation/duration";
4+
import { Timeunit } from "../../types";
55

66
export const WEEKDAY_DICTIONARY: { [word: string]: number } = {
77
"sonntag": 0,
@@ -86,7 +86,7 @@ export const INTEGER_WORD_DICTIONARY: { [word: string]: number } = {
8686
"zwoelf": 12,
8787
};
8888

89-
export const TIME_UNIT_DICTIONARY: { [word: string]: OpUnitType | QUnitType } = {
89+
export const TIME_UNIT_DICTIONARY: { [word: string]: Timeunit } = {
9090
sek: "second",
9191
sekunde: "second",
9292
sekunden: "second",
@@ -97,9 +97,9 @@ export const TIME_UNIT_DICTIONARY: { [word: string]: OpUnitType | QUnitType } =
9797
std: "hour",
9898
stunde: "hour",
9999
stunden: "hour",
100-
tag: "d",
101-
tage: "d",
102-
tagen: "d",
100+
tag: "day",
101+
tage: "day",
102+
tagen: "day",
103103
woche: "week",
104104
wochen: "week",
105105
monat: "month",

src/locales/en/constants.ts

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
import { OpUnitType, QUnitType } from "dayjs";
21
import { matchAnyPattern, repeatedTimeunitPattern } from "../../utils/pattern";
32
import { findMostLikelyADYear } from "../../calculation/years";
43
import { Duration } from "../../calculation/duration";
5-
import { Weekday } from "../../types";
4+
import { Timeunit, Weekday } from "../../types";
65

76
export const WEEKDAY_DICTIONARY: { [word: string]: Weekday } = {
87
sunday: 0,
@@ -134,15 +133,15 @@ export const ORDINAL_WORD_DICTIONARY: { [word: string]: number } = {
134133
"thirty-first": 31,
135134
};
136135

137-
export const TIME_UNIT_DICTIONARY_NO_ABBR: { [word: string]: OpUnitType | QUnitType } = {
136+
export const TIME_UNIT_DICTIONARY_NO_ABBR: { [word: string]: Timeunit } = {
138137
second: "second",
139138
seconds: "second",
140139
minute: "minute",
141140
minutes: "minute",
142141
hour: "hour",
143142
hours: "hour",
144-
day: "d",
145-
days: "d",
143+
day: "day",
144+
days: "day",
146145
week: "week",
147146
weeks: "week",
148147
month: "month",
@@ -153,7 +152,7 @@ export const TIME_UNIT_DICTIONARY_NO_ABBR: { [word: string]: OpUnitType | QUnitT
153152
years: "year",
154153
};
155154

156-
export const TIME_UNIT_DICTIONARY: { [word: string]: OpUnitType | QUnitType } = {
155+
export const TIME_UNIT_DICTIONARY: { [word: string]: Timeunit } = {
157156
s: "second",
158157
sec: "second",
159158
second: "second",
@@ -168,10 +167,10 @@ export const TIME_UNIT_DICTIONARY: { [word: string]: OpUnitType | QUnitType } =
168167
hrs: "hour",
169168
hour: "hour",
170169
hours: "hour",
171-
d: "d",
172-
day: "d",
173-
days: "d",
174-
w: "w",
170+
d: "day",
171+
day: "day",
172+
days: "day",
173+
w: "week",
175174
week: "week",
176175
weeks: "week",
177176
mo: "month",

0 commit comments

Comments
 (0)