Skip to content

Commit ef673ff

Browse files
authored
refactor(datetime): rename abbreviated month and weekday constants to full names (#6939)
1 parent 6edf369 commit ef673ff

File tree

1 file changed

+54
-54
lines changed

1 file changed

+54
-54
lines changed

datetime/constants.ts

Lines changed: 54 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -61,45 +61,45 @@ export const WEEK: number = DAY * 7;
6161
*
6262
* @example
6363
* ```ts
64-
* import { JAN } from "@std/datetime/constants";
64+
* import { JANUARY } from "@std/datetime/constants";
6565
*
66-
* new Date(2025, JAN, 1); // 2025-01-01
66+
* new Date(2025, JANUARY, 1); // 2025-01-01
6767
* ```
6868
*/
69-
export const JAN = 0;
69+
export const JANUARY = 0;
7070
/**
7171
* The month index for February.
7272
*
7373
* @example
7474
* ```ts
75-
* import { FEB } from "@std/datetime/constants";
75+
* import { FEBRUARY } from "@std/datetime/constants";
7676
*
77-
* new Date(2025, FEB, 1); // 2025-02-01
77+
* new Date(2025, FEBRUARY, 1); // 2025-02-01
7878
* ```
7979
*/
80-
export const FEB = 1;
80+
export const FEBRUARY = 1;
8181
/**
8282
* The month index for March.
8383
*
8484
* @example
8585
* ```ts
86-
* import { MAR } from "@std/datetime/constants";
86+
* import { MARCH } from "@std/datetime/constants";
8787
*
88-
* new Date(2025, MAR, 1); // 2025-03-01
88+
* new Date(2025, MARCH, 1); // 2025-03-01
8989
* ```
9090
*/
91-
export const MAR = 2;
91+
export const MARCH = 2;
9292
/**
9393
* The month index for April.
9494
*
9595
* @example
9696
* ```ts
97-
* import { APR } from "@std/datetime/constants";
97+
* import { APRIL } from "@std/datetime/constants";
9898
*
99-
* new Date(2025, APR, 1); // 2025-04-01
99+
* new Date(2025, APRIL, 1); // 2025-04-01
100100
* ```
101101
*/
102-
export const APR = 3;
102+
export const APRIL = 3;
103103
/**
104104
* The month index for May.
105105
*
@@ -116,152 +116,152 @@ export const MAY = 4;
116116
*
117117
* @example
118118
* ```ts
119-
* import { JUN } from "@std/datetime/constants";
119+
* import { JUNE } from "@std/datetime/constants";
120120
*
121-
* new Date(2025, JUN, 1); // 2025-06-01
121+
* new Date(2025, JUNE, 1); // 2025-06-01
122122
* ```
123123
*/
124-
export const JUN = 5;
124+
export const JUNE = 5;
125125
/**
126126
* The month index for July.
127127
*
128128
* @example
129129
* ```ts
130-
* import { JUL } from "@std/datetime/constants";
130+
* import { JULY } from "@std/datetime/constants";
131131
*
132-
* new Date(2025, JUL, 1); // 2025-07-01
132+
* new Date(2025, JULY, 1); // 2025-07-01
133133
* ```
134134
*/
135-
export const JUL = 6;
135+
export const JULY = 6;
136136
/**
137137
* The month index for August.
138138
*
139139
* @example
140140
* ```ts
141-
* import { AUG } from "@std/datetime/constants";
141+
* import { AUGUST } from "@std/datetime/constants";
142142
*
143-
* new Date(2025, AUG, 1); // 2025-08-01
143+
* new Date(2025, AUGUST, 1); // 2025-08-01
144144
* ```
145145
*/
146-
export const AUG = 7;
146+
export const AUGUST = 7;
147147
/**
148148
* The month index for September.
149149
*
150150
* @example
151151
* ```ts
152-
* import { SEP } from "@std/datetime/constants";
152+
* import { SEPTEMBER } from "@std/datetime/constants";
153153
*
154-
* new Date(2025, SEP, 1); // 2025-09-01
154+
* new Date(2025, SEPTEMBER, 1); // 2025-09-01
155155
* ```
156156
*/
157-
export const SEP = 8;
157+
export const SEPTEMBER = 8;
158158
/**
159159
* The month index for October.
160160
*
161161
* @example
162162
* ```ts
163-
* import { OCT } from "@std/datetime/constants";
163+
* import { OCTOBER } from "@std/datetime/constants";
164164
*
165-
* new Date(2025, OCT, 1); // 2025-10-01
165+
* new Date(2025, OCTOBER, 1); // 2025-10-01
166166
* ```
167167
*/
168-
export const OCT = 9;
168+
export const OCTOBER = 9;
169169
/**
170170
* The month index for November.
171171
*
172172
* @example
173173
* ```ts
174-
* import { NOV } from "@std/datetime/constants";
174+
* import { NOVEMBER } from "@std/datetime/constants";
175175
*
176-
* new Date(2025, NOV, 1); // 2025-11-01
176+
* new Date(2025, NOVEMBER, 1); // 2025-11-01
177177
* ```
178178
*/
179-
export const NOV = 10;
179+
export const NOVEMBER = 10;
180180
/**
181181
* The month index for December.
182182
*
183183
* @example
184184
* ```ts
185-
* import { DEC } from "@std/datetime/constants";
185+
* import { DECEMBER } from "@std/datetime/constants";
186186
*
187-
* new Date(2025, DEC, 1); // 2025-12-01
187+
* new Date(2025, DECEMBER, 1); // 2025-12-01
188188
* ```
189189
*/
190-
export const DEC = 11;
190+
export const DECEMBER = 11;
191191
/**
192192
* The day of week index for Sunday.
193193
*
194194
* @example
195195
* ```ts
196-
* import { JAN, SUN } from "@std/datetime/constants";
196+
* import { JANUARY, SUNDAY } from "@std/datetime/constants";
197197
*
198-
* new Date(2025, JAN, 5).getDay() === SUN; // true
198+
* new Date(2025, JANUARY, 5).getDay() === SUNDAY; // true
199199
* ```
200200
*/
201-
export const SUN = 0;
201+
export const SUNDAY = 0;
202202
/**
203203
* The day of week index for Monday.
204204
*
205205
* @example
206206
* ```ts
207-
* import { JAN, MON } from "@std/datetime/constants";
207+
* import { JANUARY, MONDAY } from "@std/datetime/constants";
208208
*
209-
* new Date(2025, JAN, 6).getDay() === MON; // true
209+
* new Date(2025, JANUARY, 6).getDay() === MONDAY; // true
210210
* ```
211211
*/
212-
export const MON = 1;
212+
export const MONDAY = 1;
213213
/**
214214
* The day of week index for Tuesday.
215215
*
216216
* @example
217217
* ```ts
218-
* import { JAN, TUE } from "@std/datetime/constants";
218+
* import { JANUARY, TUESDAY } from "@std/datetime/constants";
219219
*
220-
* new Date(2025, JAN, 7).getDay() === TUE; // true
220+
* new Date(2025, JANUARY, 7).getDay() === TUESDAY; // true
221221
* ```
222222
*/
223-
export const TUE = 2;
223+
export const TUESDAY = 2;
224224
/**
225225
* The day of week index for Wednesday.
226226
*
227227
* @example
228228
* ```ts
229-
* import { JAN, WED } from "@std/datetime/constants";
229+
* import { JANUARY, WEDNESDAY } from "@std/datetime/constants";
230230
*
231-
* new Date(2025, JAN, 1).getDay() === WED; // true
231+
* new Date(2025, JANUARY, 1).getDay() === WEDNESDAY; // true
232232
* ```
233233
*/
234-
export const WED = 3;
234+
export const WEDNESDAY = 3;
235235
/**
236236
* The day of week index for Thursday.
237237
*
238238
* @example
239239
* ```ts
240-
* import { JAN, THU } from "@std/datetime/constants";
240+
* import { JANUARY, THURSDAY } from "@std/datetime/constants";
241241
*
242-
* new Date(2025, JAN, 2).getDay() === THU; // true
242+
* new Date(2025, JANUARY, 2).getDay() === THURSDAY; // true
243243
* ```
244244
*/
245-
export const THU = 4;
245+
export const THURSDAY = 4;
246246
/**
247247
* The day of week index for Friday.
248248
*
249249
* @example
250250
* ```ts
251-
* import { JAN, FRI } from "@std/datetime/constants";
251+
* import { JANUARY, FRIDAY } from "@std/datetime/constants";
252252
*
253-
* new Date(2025, JAN, 3).getDay() === FRI; // true
253+
* new Date(2025, JANUARY, 3).getDay() === FRIDAY; // true
254254
* ```
255255
*/
256-
export const FRI = 5;
256+
export const FRIDAY = 5;
257257
/**
258258
* The day of week index for Saturday.
259259
*
260260
* @example
261261
* ```ts
262-
* import { JAN, SAT } from "@std/datetime/constants";
262+
* import { JANUARY, SATURDAY } from "@std/datetime/constants";
263263
*
264-
* new Date(2025, JAN, 4).getDay() === SAT; // true
264+
* new Date(2025, JANUARY, 4).getDay() === SATURDAY; // true
265265
* ```
266266
*/
267-
export const SAT = 6;
267+
export const SATURDAY = 6;

0 commit comments

Comments
 (0)