date-and-time 2.2.0 → 2.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. package/PLUGINS.md +22 -22
  2. package/README.md +87 -83
  3. package/date-and-time.d.ts +304 -0
  4. package/date-and-time.js +76 -74
  5. package/date-and-time.min.js +8 -8
  6. package/esm/date-and-time.es.js +76 -74
  7. package/esm/date-and-time.es.min.js +7 -7
  8. package/esm/date-and-time.mjs +76 -74
  9. package/esm/plugin/timezone.es.js +3 -5
  10. package/esm/plugin/timezone.mjs +3 -5
  11. package/locale/ar.d.ts +1 -0
  12. package/locale/az.d.ts +1 -0
  13. package/locale/bn.d.ts +1 -0
  14. package/locale/cs.d.ts +1 -0
  15. package/locale/de.d.ts +1 -0
  16. package/locale/dk.d.ts +1 -0
  17. package/locale/el.d.ts +1 -0
  18. package/locale/en.d.ts +1 -0
  19. package/locale/es.d.ts +1 -0
  20. package/locale/fa.d.ts +1 -0
  21. package/locale/fr.d.ts +1 -0
  22. package/locale/hi.d.ts +1 -0
  23. package/locale/hu.d.ts +1 -0
  24. package/locale/id.d.ts +1 -0
  25. package/locale/it.d.ts +1 -0
  26. package/locale/ja.d.ts +1 -0
  27. package/locale/jv.d.ts +1 -0
  28. package/locale/ko.d.ts +1 -0
  29. package/locale/my.d.ts +1 -0
  30. package/locale/nl.d.ts +1 -0
  31. package/locale/pa-in.d.ts +1 -0
  32. package/locale/pl.d.ts +1 -0
  33. package/locale/pt.d.ts +1 -0
  34. package/locale/ro.d.ts +1 -0
  35. package/locale/ru.d.ts +1 -0
  36. package/locale/rw.d.ts +1 -0
  37. package/locale/sr.d.ts +1 -0
  38. package/locale/sv.d.ts +1 -0
  39. package/locale/th.d.ts +1 -0
  40. package/locale/tr.d.ts +1 -0
  41. package/locale/uk.d.ts +1 -0
  42. package/locale/uz.d.ts +1 -0
  43. package/locale/vi.d.ts +1 -0
  44. package/locale/zh-cn.d.ts +1 -0
  45. package/locale/zh-tw.d.ts +1 -0
  46. package/package.json +7 -4
  47. package/plugin/day-of-week.d.ts +1 -0
  48. package/plugin/meridiem.d.ts +1 -0
  49. package/plugin/microsecond.d.ts +1 -0
  50. package/plugin/ordinal.d.ts +1 -0
  51. package/plugin/timespan.d.ts +24 -0
  52. package/plugin/timezone.d.ts +79 -0
  53. package/plugin/timezone.js +3 -5
  54. package/plugin/two-digit-year.d.ts +1 -0
package/PLUGINS.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Plugins
2
2
 
3
- This library is oriented towards minimalism, so it may seem to some developers to be lacking in features. Plugin is the most realistic solution to such dissatisfaction. By importing plugins, you can extend the functionality of this library, mainly a formatter and a parser.
3
+ This library is oriented towards minimalism, so it may seem to some developers to be lacking in features. The plugin is the most realistic solution to such dissatisfaction. By importing plugins, you can extend the functionality of this library, primarily the formatter and parser.
4
4
 
5
5
  *The formatter is used in `format()`, etc., the parser is used in `parse()`, `preparse()`, `isValid()`, etc.*
6
6
 
@@ -238,9 +238,9 @@ It adds `timeSpan()` function that calculates the difference of two dates to the
238
238
 
239
239
  #### timeSpan(date1, date2)
240
240
 
241
- - @param {**Date**} date1 - a Date object
242
- - @param {**Date**} date2 - a Date object
243
- - @returns {**Object**} a result object subtracting date2 from date1
241
+ - @param {**Date**} date1 - A Date object
242
+ - @param {**Date**} date2 - A Date object
243
+ - @returns {**Object**} The result object of subtracting date2 from date1
244
244
 
245
245
  ```javascript
246
246
  const date = require('date-and-time');
@@ -262,11 +262,11 @@ Like `subtract()`, `timeSpan()` returns an object with functions like this:
262
262
 
263
263
  | function | description |
264
264
  |:---------------|:------------------------|
265
- | toDays | Outputs as dates |
266
- | toHours | Outputs as hours |
267
- | toMinutes | Outputs as minutes |
268
- | toSeconds | Outputs as seconds |
269
- | toMilliseconds | Outputs as milliseconds |
265
+ | toDays | Outputs in dates |
266
+ | toHours | Outputs in hours |
267
+ | toMinutes | Outputs in minutes |
268
+ | toSeconds | Outputs in seconds |
269
+ | toMilliseconds | Outputs in milliseconds |
270
270
 
271
271
  In these functions can be available some tokens to format the calculation result. Here are the tokens and their meanings:
272
272
 
@@ -294,29 +294,29 @@ It adds `formatTZ()`, `parseTZ()` and `transformTZ()` that support `IANA time zo
294
294
 
295
295
  #### formatTZ(dateObj, arg[, timeZone])
296
296
 
297
- - @param {**Date**} dateObj - a Date object
298
- - @param {**string|Array.\<string\>**} arg - a format string or its compiled object
299
- - @param {**string**} [timeZone] - output as this time zone
300
- - @returns {**string**} a formatted string
297
+ - @param {**Date**} dateObj - A Date object
298
+ - @param {**string|Array.\<string\>**} arg - A format string or its compiled object
299
+ - @param {**string**} [timeZone] - Output as this time zone
300
+ - @returns {**string**} A formatted string
301
301
 
302
302
  `formatTZ()` is upward compatible with `format()`. Tokens available for `arg` are the same as those for `format()`. If `timeZone` is omitted, this function assumes `timeZone` to be a local time zone and outputs a string. This means that the result is the same as when `format()` is used.
303
303
 
304
304
  #### parseTZ(dateString, arg[, timeZone])
305
305
 
306
- - @param {**string**} dateString - a date string
307
- - @param {**string|Array.\<string\>**} arg - a format string or its compiled object
308
- - @param {**string**} [timeZone] - input as this time zone
309
- - @returns {**Date**} a constructed date
306
+ - @param {**string**} dateString - A date and time string
307
+ - @param {**string|Array.\<string\>**} arg - A format string or its compiled object
308
+ - @param {**string**} [timeZone] - Input as this time zone
309
+ - @returns {**Date**} A Date object
310
310
 
311
311
  `parseTZ()` is upward compatible with `parse()`. Tokens available for `arg` are the same as those for `parse()`. `timeZone` in this function is used as supplemental information. if `dateString` contains a time zone offset value (i.e. -0800, +0900), `timeZone` is not be used. If `dateString` doesn't contain a time zone offset value and `timeZone` is omitted, this function assumes `timeZone` to be a local time zone. This means that the result is the same as when `parse()` is used.
312
312
 
313
313
  #### transformTZ(dateString, arg1, arg2[, timeZone])
314
314
 
315
- - @param {**string**} dateString - a date string
316
- - @param {**string|Array.\<string\>**} arg1 - a format string or its compiled object
317
- - @param {**string|Array.\<string\>**} arg2 - a transformed format string or its compiled object
318
- - @param {**string**} [timeZone] - output as this time zone
319
- - @returns {**string**} a formatted string
315
+ - @param {**string**} dateString - A date and time string
316
+ - @param {**string|Array.\<string\>**} arg1 - A format string before transformation or its compiled object
317
+ - @param {**string|Array.\<string\>**} arg2 - A format string after transformation or its compiled object
318
+ - @param {**string**} [timeZone] - Output as this time zone
319
+ - @returns {**string**} A formatted string
320
320
 
321
321
  `transformTZ()` is upward compatible with `transform()`. `dateString` must itself contain a time zone offset value (i.e. -0800, +0900), otherwise this function assumes it is a local time zone. Tokens available for `arg1` are the same as those for `parse()`, also tokens available for `arg2` are the same as those for `format()`. `timeZone` is a `IANA time zone names`, which is required to output a new formatted string. If it is omitted, this function assumes `timeZone` to be a local time zone. This means that the result is the same as when `transform()` is used.
322
322
 
package/README.md CHANGED
@@ -24,15 +24,19 @@ npm i date-and-time
24
24
 
25
25
  ## Recent Changes
26
26
 
27
- - 2.2.0
28
- - Added `tranformTZ()` to `timezone` plugin. See [PLUGINS.md](./PLUGINS.md) for details.
29
- - Added `ZZ` token to supports time zone values like `-08:00` `+09:00` to `format()` and `parse()`.
27
+ - 2.3.1
28
+ - Updated dev dependencies to resolve vulnerabilities.
29
+
30
+ - 2.3.0
31
+ - TypeScript support.
32
+ - Fixed an issue where `parseTZ()` in timezone plugin could return `NaN` instead of `Invalid Date` if parsing failed.
30
33
 
31
- - 2.1.2
32
- - Fixed an issue that the lib's validation logic would consider an error when a time zone offset value of a date-time string was greater than +12 hours.
34
+ - 2.2.1
35
+ - Fixed an issue where `parse()` would treat a date and time string containing a UTC time zone (i.e. +0000) as a local time zone when parsing.
33
36
 
34
- - 2.1.1
35
- - Updated dev dependencies to resolve vulnerability.
37
+ - 2.2.0
38
+ - Added `tranformTZ()` to `timezone` plugin. See [PLUGINS.md](./PLUGINS.md) for details.
39
+ - Added `ZZ` token to support time zone values with colon like `-08:00` `+09:00` to `format()` and `parse()`.
36
40
 
37
41
  ## Usage
38
42
 
@@ -59,32 +63,34 @@ import date from '/path/to/date-and-time.es.min.js';
59
63
  - Older browser:
60
64
 
61
65
  ```html
62
- <script src="/path/to/date-and-time.min.js"></script>
66
+ <script src="/path/to/date-and-time.min.js">
67
+ // You will be able to access the global variable `date`.
68
+ </script>
63
69
  ```
64
70
 
65
71
  ### Note
66
72
 
67
- - If you want to use ES Modules in Node.js without a transpiler, you need to add `"type": "module"` in your `package.json` or change your file extension from `.js` to `.mjs`.
73
+ - If you want to use ES Modules in Node.js without the transpiler, you need to add `"type": "module"` in your `package.json` or change your file extension from `.js` to `.mjs`.
68
74
 
69
75
  ## API
70
76
 
71
77
  - [format](#formatdateobj-arg-utc)
72
- - Formatting a Date and Time (Date -> String)
78
+ - Formatting date and time objects (Date -> String)
73
79
 
74
80
  - [parse](#parsedatestring-arg-utc)
75
- - Parsing a Date and Time string (String -> Date)
81
+ - Parsing date and time strings (String -> Date)
76
82
 
77
83
  - [compile](#compileformatstring)
78
- - Compiling a format string
84
+ - Compiling format strings
79
85
 
80
86
  - [preparse](#preparsedatestring-arg)
81
- - Pre-parsing a Date and Time string
87
+ - Pre-parsing date and time strings
82
88
 
83
89
  - [isValid](#isvalidarg1-arg2)
84
- - Validation
90
+ - Date and time string validation
85
91
 
86
92
  - [transform](#transformdatestring-arg1-arg2-utc)
87
- - Transforming a Date and Time string (String -> String)
93
+ - Format transformation of date and time strings (String -> String)
88
94
 
89
95
  - [addYears](#addyearsdateobj-years)
90
96
  - Adding years
@@ -108,29 +114,29 @@ import date from '/path/to/date-and-time.es.min.js';
108
114
  - Adding milliseconds
109
115
 
110
116
  - [subtract](#subtractdate1-date2)
111
- - Subtracting two dates
117
+ - Subtracting two dates (date1 - date2)
112
118
 
113
119
  - [isLeapYear](#isleapyeary)
114
- - Whether year is leap year
120
+ - Whether a year is a leap year
115
121
 
116
122
  - [isSameDay](#issamedaydate1-date2)
117
123
  - Comparison of two dates
118
124
 
119
- - [locale](#localecode-locale)
120
- - Changing the locale or defining new locales
125
+ - [locale](#localelocale)
126
+ - Changing locales
121
127
 
122
128
  - [extend](#extendextension)
123
- - Feature extension
129
+ - Functional extension
124
130
 
125
- - [plugin](#pluginname-plugin)
126
- - Importing or defining plugins
131
+ - [plugin](#pluginplugin)
132
+ - Importing plugins
127
133
 
128
134
  ### format(dateObj, arg[, utc])
129
135
 
130
- - @param {**Date**} dateObj - a Date object
131
- - @param {**string|Array.\<string\>**} arg - a format string or its compiled object
132
- - @param {**boolean**} [utc] - output as UTC
133
- - @returns {**string**} a formatted string
136
+ - @param {**Date**} dateObj - A Date object
137
+ - @param {**string|Array.\<string\>**} arg - A format string or its compiled object
138
+ - @param {**boolean**} [utc] - Output as UTC
139
+ - @returns {**string**} A formatted string
134
140
 
135
141
  ```javascript
136
142
  const now = new Date();
@@ -194,7 +200,7 @@ date.format(new Date(), '[DD-[MM]-YYYY]'); // => 'DD-[MM]-YYYY'
194
200
 
195
201
  #### Note 2. Output as UTC
196
202
 
197
- This function usually outputs a local date-time string. Set to true the `utc` option (the 3rd parameter) if you would like to get a UTC date-time string.
203
+ This function usually outputs a local date and time string. Set to true the `utc` option (the 3rd parameter) if you would like to get a UTC date and time string.
198
204
 
199
205
  ```javascript
200
206
  date.format(new Date(), 'hh:mm A [GMT]Z'); // => '11:14 PM GMT-0800'
@@ -207,10 +213,10 @@ You can also define your own tokens. See [EXTEND.md](./EXTEND.md) for details.
207
213
 
208
214
  ### parse(dateString, arg[, utc])
209
215
 
210
- - @param {**string**} dateString - a date string
211
- - @param {**string|Array.\<string\>**} arg - a format string or its compiled object
212
- - @param {**boolean**} [utc] - input as UTC
213
- - @returns {**Date**} a constructed date
216
+ - @param {**string**} dateString - A date and time string
217
+ - @param {**string|Array.\<string\>**} arg - A format string or its compiled object
218
+ - @param {**boolean**} [utc] - Input as UTC
219
+ - @returns {**Date**} A Date object
214
220
 
215
221
  ```javascript
216
222
  date.parse('2015/01/02 23:14:05', 'YYYY/MM/DD HH:mm:ss'); // => Jan 2 2015 23:14:05 GMT-0800
@@ -278,7 +284,7 @@ if (isNaN(today)) {
278
284
 
279
285
  #### Note 2. Input as UTC
280
286
 
281
- This function assumes the `dateString` is a local date-time unless it contains a time zone offset value. Set to true the `utc` option (the 3rd parameter) if it is a UTC date-time.
287
+ This function assumes the `dateString` is a local datea and time unless it contains a time zone offset value. Set to true the `utc` option (the 3rd parameter) if it is a UTC date and time.
282
288
 
283
289
  ```javascript
284
290
  date.parse('11:14:05 PM', 'hh:mm:ss A'); // => Jan 1 1970 23:14:05 GMT-0800
@@ -317,7 +323,7 @@ date.parse('11:14:05 PM', 'hh:mm:ss A'); // => Jan 1 1970 23:14:05 GMT-0800
317
323
 
318
324
  #### Note 6. Token disablement
319
325
 
320
- Use square brackets `[]` if a date-time string includes some token characters. Tokens inside square brackets in the `formatString` will be interpreted as normal characters:
326
+ Use square brackets `[]` if a datea and time string includes some token characters. Tokens inside square brackets in the `formatString` will be interpreted as normal characters:
321
327
 
322
328
  ```javascript
323
329
  date.parse('12 hours 34 minutes', 'HH hours mm minutes'); // => Invalid Date
@@ -345,8 +351,8 @@ date.parse('2015/01/02 11:14:05', 'YYYY/MM/DD...'); // => Jan 2 2015 00:00:00
345
351
 
346
352
  ### compile(formatString)
347
353
 
348
- - @param {**string**} formatString - a format string
349
- - @returns {**Array.\<string\>**} a compiled object
354
+ - @param {**string**} formatString - A format string
355
+ - @returns {**Array.\<string\>**} A compiled object
350
356
 
351
357
  If you are going to execute the `format()`, the `parse()` or the `isValid()` so many times with one string format, recommended to precompile and reuse it for performance.
352
358
 
@@ -362,9 +368,9 @@ If you are going to execute the `format()`, the `parse()` or the `isValid()` so
362
368
 
363
369
  ### preparse(dateString, arg)
364
370
 
365
- - @param {**string**} dateString - a date string
366
- - @param {**string|Array.\<string\>**} arg - a format string or its compiled object
367
- - @returns {**Object**} a date structure
371
+ - @param {**string**} dateString - A date and time string
372
+ - @param {**string|Array.\<string\>**} arg - A format string or its compiled object
373
+ - @returns {**Object**} A pre-parsed result object
368
374
 
369
375
  This function takes exactly the same parameters with the `parse()`, but returns a date structure as follows unlike that:
370
376
 
@@ -392,9 +398,9 @@ This date structure provides a parsing result. You will be able to tell from it
392
398
 
393
399
  ### isValid(arg1[, arg2])
394
400
 
395
- - @param {**Object|string**} arg1 - a date structure or a date string
396
- - @param {**string|Array.\<string\>**} [arg2] - a format string or its compiled object
397
- - @returns {**boolean**} whether the date string is a valid date
401
+ - @param {**Object|string**} arg1 - A pre-parsed result object or a date and time string
402
+ - @param {**string|Array.\<string\>**} [arg2] - A format string or its compiled object
403
+ - @returns {**boolean**} Whether the date and time string is a valid date and time
398
404
 
399
405
  This function takes either exactly the same parameters with the `parse()` or a date structure which the `preparse()` returns, evaluates the validity of them.
400
406
 
@@ -410,11 +416,11 @@ date.isValid(result); // => true
410
416
 
411
417
  ### transform(dateString, arg1, arg2[, utc])
412
418
 
413
- - @param {**string**} dateString - a date string
414
- - @param {**string|Array.\<string\>**} arg1 - a format string or its compiled object
415
- - @param {**string|Array.\<string\>**} arg2 - a transformed format string or its compiled object
416
- - @param {**boolean**} [utc] - output as UTC
417
- - @returns {**string**} a formatted string
419
+ - @param {**string**} dateString - A date and time string
420
+ - @param {**string|Array.\<string\>**} arg1 - A format string or its compiled object before transformation
421
+ - @param {**string|Array.\<string\>**} arg2 - A format string or its compiled object after transformation
422
+ - @param {**boolean**} [utc] - Output as UTC
423
+ - @returns {**string**} A formatted string
418
424
 
419
425
  This function transforms the format of a date string. The 2nd parameter, `arg1`, is the format string of it. Available token list is equal to the `parse()`'s. The 3rd parameter, `arg2`, is the transformed format string. Available token list is equal to the `format()`'s.
420
426
 
@@ -428,9 +434,9 @@ date.transform('13:05', 'HH:mm', 'hh:mm A');
428
434
 
429
435
  ### addYears(dateObj, years)
430
436
 
431
- - @param {**Date**} dateObj - a Date object
432
- - @param {**number**} years - number of years to add
433
- - @returns {**Date**} a date after adding the value
437
+ - @param {**Date**} dateObj - A Date object
438
+ - @param {**number**} years - Number of years to add
439
+ - @returns {**Date**} The Date object after adding the value
434
440
 
435
441
  ```javascript
436
442
  const now = new Date();
@@ -439,9 +445,9 @@ const next_year = date.addYears(now, 1);
439
445
 
440
446
  ### addMonths(dateObj, months)
441
447
 
442
- - @param {**Date**} dateObj - a Date object
443
- - @param {**number**} months - number of months to add
444
- - @returns {**Date**} a date after adding the value
448
+ - @param {**Date**} dateObj - A Date object
449
+ - @param {**number**} months - Number of months to add
450
+ - @returns {**Date**} The Date object after adding the value
445
451
 
446
452
  ```javascript
447
453
  const now = new Date();
@@ -450,9 +456,9 @@ const next_month = date.addMonths(now, 1);
450
456
 
451
457
  ### addDays(dateObj, days)
452
458
 
453
- - @param {**Date**} dateObj - a Date object
454
- - @param {**number**} days - number of days to add
455
- - @returns {**Date**} a date after adding the value
459
+ - @param {**Date**} dateObj - A Date object
460
+ - @param {**number**} days - Number of days to add
461
+ - @returns {**Date**} The Date object after adding the value
456
462
 
457
463
  ```javascript
458
464
  const now = new Date();
@@ -461,9 +467,9 @@ const yesterday = date.addDays(now, -1);
461
467
 
462
468
  ### addHours(dateObj, hours)
463
469
 
464
- - @param {**Date**} dateObj - a Date object
465
- - @param {**number**} hours - number of hours to add
466
- - @returns {**Date**} a date after adding the value
470
+ - @param {**Date**} dateObj - A Date object
471
+ - @param {**number**} hours - Number of hours to add
472
+ - @returns {**Date**} The Date object after adding the value
467
473
 
468
474
  ```javascript
469
475
  const now = new Date();
@@ -472,9 +478,9 @@ const an_hour_ago = date.addHours(now, -1);
472
478
 
473
479
  ### addMinutes(dateObj, minutes)
474
480
 
475
- - @param {**Date**} dateObj - a Date object
476
- - @param {**number**} minutes - number of minutes to add
477
- - @returns {**Date**} a date after adding the value
481
+ - @param {**Date**} dateObj - A Date object
482
+ - @param {**number**} minutes - Number of minutes to add
483
+ - @returns {**Date**} The Date object after adding the value
478
484
 
479
485
  ```javascript
480
486
  const now = new Date();
@@ -483,9 +489,9 @@ const two_minutes_later = date.addMinutes(now, 2);
483
489
 
484
490
  ### addSeconds(dateObj, seconds)
485
491
 
486
- - @param {**Date**} dateObj - a Date object
487
- - @param {**number**} seconds - number of seconds to add
488
- - @returns {**Date**} a date after adding the value
492
+ - @param {**Date**} dateObj - A Date object
493
+ - @param {**number**} seconds - Number of seconds to add
494
+ - @returns {**Date**} The Date object after adding the value
489
495
 
490
496
  ```javascript
491
497
  const now = new Date();
@@ -494,9 +500,9 @@ const three_seconds_ago = date.addSeconds(now, -3);
494
500
 
495
501
  ### addMilliseconds(dateObj, milliseconds)
496
502
 
497
- - @param {**Date**} dateObj - a Date object
498
- - @param {**number**} milliseconds - number of milliseconds to add
499
- - @returns {**Date**} a date after adding the value
503
+ - @param {**Date**} dateObj - A Date object
504
+ - @param {**number**} milliseconds - Number of milliseconds to add
505
+ - @returns {**Date**} The Date object after adding the value
500
506
 
501
507
  ```javascript
502
508
  const now = new Date();
@@ -505,9 +511,9 @@ const a_millisecond_later = date.addMilliseconds(now, 1);
505
511
 
506
512
  ### subtract(date1, date2)
507
513
 
508
- - @param {**Date**} date1 - a Date object
509
- - @param {**Date**} date2 - a Date object
510
- - @returns {**Object**} a result object subtracting date2 from date1
514
+ - @param {**Date**} date1 - A Date object
515
+ - @param {**Date**} date2 - A Date object
516
+ - @returns {**Object**} The result object of subtracting date2 from date1
511
517
 
512
518
  ```javascript
513
519
  const today = new Date(2015, 0, 2);
@@ -522,8 +528,8 @@ date.subtract(today, yesterday).toMilliseconds(); // => 86400000
522
528
 
523
529
  ### isLeapYear(y)
524
530
 
525
- - @param {**number**} y - year
526
- - @returns {**boolean**} whether year is leap year
531
+ - @param {**number**} y - A year to check
532
+ - @returns {**boolean**} Whether the year is a leap year
527
533
 
528
534
  ```javascript
529
535
  date.isLeapYear(2015); // => false
@@ -532,9 +538,9 @@ date.isLeapYear(2012); // => true
532
538
 
533
539
  ### isSameDay(date1, date2)
534
540
 
535
- - @param {**Date**} date1 - a Date object
536
- - @param {**Date**} date2 - a Date object
537
- - @returns {**boolean**} whether the two dates are the same day (time is ignored)
541
+ - @param {**Date**} date1 - A Date object
542
+ - @param {**Date**} date2 - A Date object
543
+ - @returns {**boolean**} Whether the two dates are the same day (time is ignored)
538
544
 
539
545
  ```javascript
540
546
  const date1 = new Date(2017, 0, 2, 0); // Jan 2 2017 00:00:00
@@ -544,11 +550,10 @@ date.isSameDay(date1, date2); // => true
544
550
  date.isSameDay(date1, date3); // => false
545
551
  ```
546
552
 
547
- ### locale([code[, locale]])
553
+ ### locale([locale])
548
554
 
549
- - @param {**Function|string**} [code] - locale installer | language code
550
- - @param {**Object**} [locale] - locale definition
551
- - @returns {**string**} current language code
555
+ - @param {**Function|string**} [locale] - A locale installer or language code
556
+ - @returns {**string**} The current language code
552
557
 
553
558
  It returns the current language code if called without any parameters.
554
559
 
@@ -568,15 +573,14 @@ See [LOCALE.md](./LOCALE.md) for details.
568
573
 
569
574
  ### extend(extension)
570
575
 
571
- - @param {**Object**} extension - extension object
576
+ - @param {**Object**} extension - An extension object
572
577
  - @returns {**void**}
573
578
 
574
579
  It extends this library. See [EXTEND.md](./EXTEND.md) for details.
575
580
 
576
- ### plugin(name[, plugin])
581
+ ### plugin(plugin)
577
582
 
578
- - @param {**Function|string**} name - plugin installer | plugin name
579
- - @param {**Object**} [plugin] - plugin object
583
+ - @param {**Function|string**} plugin - A plugin installer or plugin name
580
584
  - @returns {**void**}
581
585
 
582
586
  Plugin is a named extension object. By installing predefined plugins, you can easily extend this library. See [PLUGINS.md](./PLUGINS.md) for details.