quasar 1.18.0 → 1.18.4

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 (119) hide show
  1. package/dist/api/QKnob.json +18 -0
  2. package/dist/api/QRange.json +1 -1
  3. package/dist/api/QSlider.json +1 -1
  4. package/dist/icon-set/bootstrap-icons.umd.min.js +1 -1
  5. package/dist/icon-set/eva-icons.umd.min.js +1 -1
  6. package/dist/icon-set/fontawesome-v5-pro.umd.min.js +1 -1
  7. package/dist/icon-set/fontawesome-v5.umd.min.js +1 -1
  8. package/dist/icon-set/ionicons-v4.umd.min.js +1 -1
  9. package/dist/icon-set/line-awesome.umd.min.js +1 -1
  10. package/dist/icon-set/material-icons-outlined.umd.min.js +1 -1
  11. package/dist/icon-set/material-icons-round.umd.min.js +1 -1
  12. package/dist/icon-set/material-icons-sharp.umd.min.js +1 -1
  13. package/dist/icon-set/material-icons.umd.min.js +1 -1
  14. package/dist/icon-set/mdi-v3.umd.min.js +1 -1
  15. package/dist/icon-set/mdi-v4.umd.min.js +1 -1
  16. package/dist/icon-set/mdi-v5.umd.min.js +1 -1
  17. package/dist/icon-set/mdi-v6.umd.min.js +1 -1
  18. package/dist/icon-set/svg-bootstrap-icons.umd.min.js +1 -1
  19. package/dist/icon-set/svg-eva-icons.umd.min.js +1 -1
  20. package/dist/icon-set/svg-fontawesome-v5.umd.min.js +1 -1
  21. package/dist/icon-set/svg-ionicons-v4.umd.min.js +1 -1
  22. package/dist/icon-set/svg-ionicons-v5.umd.min.js +1 -1
  23. package/dist/icon-set/svg-ionicons-v6.umd.min.js +1 -1
  24. package/dist/icon-set/svg-line-awesome.umd.min.js +1 -1
  25. package/dist/icon-set/svg-material-icons-outlined.umd.min.js +1 -1
  26. package/dist/icon-set/svg-material-icons-round.umd.min.js +1 -1
  27. package/dist/icon-set/svg-material-icons-sharp.umd.min.js +1 -1
  28. package/dist/icon-set/svg-material-icons.umd.min.js +1 -1
  29. package/dist/icon-set/svg-mdi-v4.umd.min.js +1 -1
  30. package/dist/icon-set/svg-mdi-v5.umd.min.js +1 -1
  31. package/dist/icon-set/svg-mdi-v6.umd.min.js +1 -1
  32. package/dist/icon-set/svg-themify.umd.min.js +1 -1
  33. package/dist/icon-set/themify.umd.min.js +1 -1
  34. package/dist/lang/ar.umd.min.js +1 -1
  35. package/dist/lang/az-latn.umd.min.js +1 -1
  36. package/dist/lang/bg.umd.min.js +1 -1
  37. package/dist/lang/ca.umd.min.js +1 -1
  38. package/dist/lang/cs.umd.min.js +1 -1
  39. package/dist/lang/da.umd.min.js +1 -1
  40. package/dist/lang/de.umd.min.js +1 -1
  41. package/dist/lang/el.umd.min.js +1 -1
  42. package/dist/lang/en-gb.umd.min.js +1 -1
  43. package/dist/lang/en-us.umd.min.js +1 -1
  44. package/dist/lang/eo.umd.min.js +1 -1
  45. package/dist/lang/es.umd.min.js +1 -1
  46. package/dist/lang/et.umd.min.js +1 -1
  47. package/dist/lang/fa-ir.umd.min.js +1 -1
  48. package/dist/lang/fa.umd.min.js +1 -1
  49. package/dist/lang/fi.umd.min.js +1 -1
  50. package/dist/lang/fr.umd.min.js +1 -1
  51. package/dist/lang/gn.umd.min.js +1 -1
  52. package/dist/lang/he.umd.min.js +1 -1
  53. package/dist/lang/hr.umd.min.js +1 -1
  54. package/dist/lang/hu.umd.min.js +1 -1
  55. package/dist/lang/id.umd.min.js +1 -1
  56. package/dist/lang/is.umd.min.js +1 -1
  57. package/dist/lang/it.umd.min.js +1 -1
  58. package/dist/lang/ja.umd.min.js +1 -1
  59. package/dist/lang/km.umd.min.js +1 -1
  60. package/dist/lang/ko-kr.umd.min.js +1 -1
  61. package/dist/lang/kur-ckb.umd.min.js +1 -1
  62. package/dist/lang/lu.umd.min.js +1 -1
  63. package/dist/lang/lv.umd.min.js +1 -1
  64. package/dist/lang/ml.umd.min.js +1 -1
  65. package/dist/lang/ms.umd.min.js +1 -1
  66. package/dist/lang/my.umd.min.js +1 -1
  67. package/dist/lang/nb-no.umd.min.js +1 -1
  68. package/dist/lang/nl.umd.min.js +1 -1
  69. package/dist/lang/pl.umd.min.js +1 -1
  70. package/dist/lang/pt-br.umd.min.js +1 -1
  71. package/dist/lang/pt.umd.min.js +1 -1
  72. package/dist/lang/ro.umd.min.js +1 -1
  73. package/dist/lang/ru.umd.min.js +1 -1
  74. package/dist/lang/sk.umd.min.js +1 -1
  75. package/dist/lang/sl.umd.min.js +1 -1
  76. package/dist/lang/sr.umd.min.js +1 -1
  77. package/dist/lang/sv.umd.min.js +1 -1
  78. package/dist/lang/ta.umd.min.js +1 -1
  79. package/dist/lang/th.umd.min.js +1 -1
  80. package/dist/lang/tr.umd.min.js +1 -1
  81. package/dist/lang/ug.umd.min.js +1 -1
  82. package/dist/lang/uk.umd.min.js +1 -1
  83. package/dist/lang/vi.umd.min.js +1 -1
  84. package/dist/lang/zh-hans.umd.min.js +1 -1
  85. package/dist/lang/zh-hant.umd.min.js +1 -1
  86. package/dist/quasar.addon.css +1 -1
  87. package/dist/quasar.addon.rtl.css +1 -1
  88. package/dist/quasar.common.js +2 -2
  89. package/dist/quasar.css +5 -1
  90. package/dist/quasar.esm.js +2 -2
  91. package/dist/quasar.ie.polyfills.js +1 -1
  92. package/dist/quasar.ie.polyfills.umd.min.js +1 -1
  93. package/dist/quasar.min.css +1 -1
  94. package/dist/quasar.rtl.css +5 -1
  95. package/dist/quasar.rtl.min.css +1 -1
  96. package/dist/quasar.sass +3 -1
  97. package/dist/quasar.styl +3 -1
  98. package/dist/quasar.umd.js +239 -153
  99. package/dist/quasar.umd.min.js +2 -2
  100. package/dist/quasar.umd.modern.js +236 -151
  101. package/dist/quasar.umd.modern.min.js +2 -2
  102. package/dist/types/index.d.ts +8 -0
  103. package/dist/types/utils/date.d.ts +28 -13
  104. package/dist/vetur/quasar-attributes.json +8 -0
  105. package/dist/vetur/quasar-tags.json +2 -0
  106. package/dist/web-types/web-types.json +21 -3
  107. package/package.json +1 -1
  108. package/src/components/field/QField.sass +2 -0
  109. package/src/components/field/QField.styl +2 -0
  110. package/src/components/form/QForm.js +17 -14
  111. package/src/components/knob/QKnob.js +41 -23
  112. package/src/components/knob/QKnob.json +16 -0
  113. package/src/components/select/QSelect.js +1 -1
  114. package/src/components/slider/slider-utils.json +1 -1
  115. package/src/components/tree/QTree.js +6 -8
  116. package/src/mixins/mask.js +1 -1
  117. package/src/mixins/validate.js +12 -12
  118. package/src/plugins/Screen.js +10 -6
  119. package/src/utils/date.js +147 -85
package/src/utils/date.js CHANGED
@@ -19,8 +19,8 @@ function getRegexData (mask, dateLocale) {
19
19
  days = '(' + dateLocale.days.join('|') + ')',
20
20
  key = mask + days
21
21
 
22
- if (regexStore[key] !== void 0) {
23
- return regexStore[key]
22
+ if (regexStore[ key ] !== void 0) {
23
+ return regexStore[ key ]
24
24
  }
25
25
 
26
26
  const
@@ -138,7 +138,7 @@ function getRegexData (mask, dateLocale) {
138
138
 
139
139
  default:
140
140
  index--
141
- if (match[0] === '[') {
141
+ if (match[ 0 ] === '[') {
142
142
  match = match.substring(1, match.length - 1)
143
143
  }
144
144
  return match.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')
@@ -146,7 +146,7 @@ function getRegexData (mask, dateLocale) {
146
146
  })
147
147
 
148
148
  const res = { map, regex: new RegExp('^' + regexText) }
149
- regexStore[key] = res
149
+ regexStore[ key ] = res
150
150
 
151
151
  return res
152
152
  }
@@ -178,12 +178,14 @@ function applyYearMonthDayChange (date, mod, sign) {
178
178
 
179
179
  const day = date.getDate()
180
180
 
181
- if (mod.years !== void 0) {
182
- year += sign * mod.years
181
+ if (mod.year !== void 0) {
182
+ year += sign * mod.year
183
+ delete mod.year
183
184
  }
184
185
 
185
- if (mod.months !== void 0) {
186
- month += sign * mod.months
186
+ if (mod.month !== void 0) {
187
+ month += sign * mod.month
188
+ delete mod.month
187
189
  }
188
190
 
189
191
  date.setDate(1)
@@ -193,76 +195,108 @@ function applyYearMonthDayChange (date, mod, sign) {
193
195
  date.setMonth(month)
194
196
  date.setDate(Math.min(day, daysInMonth(date)))
195
197
 
196
- if (mod.days !== void 0) {
197
- date.setDate(date.getDate() + sign * mod.days)
198
+ if (mod.date !== void 0) {
199
+ date.setDate(date.getDate() + sign * mod.date)
200
+ delete mod.date
198
201
  }
199
202
 
200
203
  return date
201
204
  }
202
205
 
203
- const yearMonDay = [ 'years', 'year', 'months', 'month', 'days' ]
206
+ function applyYearMonthDay (date, mod, middle) {
207
+ const
208
+ year = mod.year !== void 0 ? mod.year : date[ `get${middle}FullYear` ](),
209
+ month = mod.month !== void 0 ? mod.month - 1 : date[ `get${middle}Month` ](),
210
+ maxDay = (new Date(year, month + 1, 0)).getDate(),
211
+ day = Math.min(maxDay, mod.date !== void 0 ? mod.date : date[ `get${middle}Date` ]())
212
+
213
+ date[ `set${middle}Date` ](1)
214
+ date[ `set${middle}Month` ](2)
215
+
216
+ date[ `set${middle}FullYear` ](year)
217
+ date[ `set${middle}Month` ](month)
218
+ date[ `set${middle}Date` ](day)
204
219
 
205
- function getChange (date, mod, sign) {
220
+ delete mod.year
221
+ delete mod.month
222
+ delete mod.date
223
+
224
+ return date
225
+ }
226
+
227
+ function getChange (date, rawMod, sign) {
206
228
  const
229
+ mod = normalizeMod(rawMod),
207
230
  d = new Date(date),
208
- t = (
209
- mod.years !== void 0 || mod.year !== void 0 ||
210
- mod.months !== void 0 || mod.month !== void 0 ||
211
- mod.days !== void 0
212
- )
213
- ? applyYearMonthDayChange(d, mod, sign)
231
+ t = mod.year !== void 0 || mod.month !== void 0 || mod.date !== void 0
232
+ ? applyYearMonthDayChange(d, mod, sign) // removes year/month/day
214
233
  : d
215
234
 
216
235
  for (const key in mod) {
217
- if (yearMonDay.includes(key) === false) {
218
- const op = capitalize(key)
219
- t[`set${op}`](t[`get${op}`]() + sign * mod[key])
220
- }
236
+ const op = capitalize(key)
237
+ t[ `set${op}` ](t[ `get${op}` ]() + sign * mod[ key ])
221
238
  }
222
239
 
223
240
  return t
224
241
  }
225
242
 
226
- function applyYearMonthDay (date, mod, middle) {
227
- const
228
- year = mod.year !== void 0
229
- ? mod.year
230
- : (mod.years !== void 0 ? mod.years : date[`get${middle}FullYear`]()),
231
- month = mod.month !== void 0
232
- ? mod.month - 1
233
- : (mod.months !== void 0 ? mod.months : date[`get${middle}Month`]()),
234
- maxDay = (new Date(year, month + 1, 0)).getDate(),
235
- day = Math.min(maxDay, mod.date !== void 0 ? mod.date : date[`get${middle}Date`]())
243
+ function normalizeMod (mod) {
244
+ const acc = { ...mod }
236
245
 
237
- date[`set${middle}Date`](1)
238
- date[`set${middle}Month`](2)
246
+ if (mod.years !== void 0) {
247
+ acc.year = mod.years
248
+ delete acc.years
249
+ }
239
250
 
240
- date[`set${middle}FullYear`](year)
241
- date[`set${middle}Month`](month)
242
- date[`set${middle}Date`](day)
251
+ if (mod.months !== void 0) {
252
+ acc.month = mod.months
253
+ delete acc.months
254
+ }
243
255
 
244
- return date
245
- }
256
+ if (mod.days !== void 0) {
257
+ acc.date = mod.days
258
+ delete acc.days
259
+ }
260
+ if (mod.day !== void 0) {
261
+ acc.date = mod.day
262
+ delete acc.day
263
+ }
264
+
265
+ if (mod.hour !== void 0) {
266
+ acc.hours = mod.hour
267
+ delete acc.hour
268
+ }
246
269
 
247
- const yearMonDayAdj = [ 'years', 'year', 'months', 'month', 'days' ]
270
+ if (mod.minute !== void 0) {
271
+ acc.minutes = mod.minute
272
+ delete acc.minute
273
+ }
274
+
275
+ if (mod.second !== void 0) {
276
+ acc.seconds = mod.second
277
+ delete acc.second
278
+ }
248
279
 
249
- export function adjustDate (date, mod, utc) {
280
+ if (mod.millisecond !== void 0) {
281
+ acc.milliseconds = mod.millisecond
282
+ delete acc.millisecond
283
+ }
284
+
285
+ return acc
286
+ }
287
+
288
+ export function adjustDate (date, rawMod, utc) {
250
289
  const
290
+ mod = normalizeMod(rawMod),
251
291
  middle = utc === true ? 'UTC' : '',
252
292
  d = new Date(date),
253
- t = (
254
- mod.years !== void 0 || mod.year !== void 0 ||
255
- mod.months !== void 0 || mod.month !== void 0 ||
256
- mod.days !== void 0
257
- )
258
- ? applyYearMonthDay(d, mod, middle)
293
+ t = mod.year !== void 0 || mod.month !== void 0 || mod.date !== void 0
294
+ ? applyYearMonthDay(d, mod, middle) // removes year/month/day
259
295
  : d
260
296
 
261
297
  for (const key in mod) {
262
- if (yearMonDayAdj.includes(key) === false) {
263
- const op = key.charAt(0).toUpperCase() + key.slice(1)
264
- t[`set${middle}${op}`](mod[key])
265
- }
298
+ const op = key.charAt(0).toUpperCase() + key.slice(1)
299
+ t[ `set${middle}${op}` ](mod[ key ])
266
300
  }
267
301
 
268
302
  return t
@@ -333,7 +367,7 @@ export function __splitDate (str, mask, dateLocale, calendar, defaultModel) {
333
367
  let tzString = ''
334
368
 
335
369
  if (map.X !== void 0 || map.x !== void 0) {
336
- const stamp = parseInt(match[map.X !== void 0 ? map.X : map.x], 10)
370
+ const stamp = parseInt(match[ map.X !== void 0 ? map.X : map.x ], 10)
337
371
 
338
372
  if (isNaN(stamp) === true || stamp < 0) {
339
373
  return date
@@ -351,28 +385,28 @@ export function __splitDate (str, mask, dateLocale, calendar, defaultModel) {
351
385
  }
352
386
  else {
353
387
  if (map.YYYY !== void 0) {
354
- date.year = parseInt(match[map.YYYY], 10)
388
+ date.year = parseInt(match[ map.YYYY ], 10)
355
389
  }
356
390
  else if (map.YY !== void 0) {
357
- const y = parseInt(match[map.YY], 10)
391
+ const y = parseInt(match[ map.YY ], 10)
358
392
  date.year = y < 0 ? y : 2000 + y
359
393
  }
360
394
 
361
395
  if (map.M !== void 0) {
362
- date.month = parseInt(match[map.M], 10)
396
+ date.month = parseInt(match[ map.M ], 10)
363
397
  if (date.month < 1 || date.month > 12) {
364
398
  return date
365
399
  }
366
400
  }
367
401
  else if (map.MMM !== void 0) {
368
- date.month = monthsShort.indexOf(match[map.MMM]) + 1
402
+ date.month = monthsShort.indexOf(match[ map.MMM ]) + 1
369
403
  }
370
404
  else if (map.MMMM !== void 0) {
371
- date.month = months.indexOf(match[map.MMMM]) + 1
405
+ date.month = months.indexOf(match[ map.MMMM ]) + 1
372
406
  }
373
407
 
374
408
  if (map.D !== void 0) {
375
- date.day = parseInt(match[map.D], 10)
409
+ date.day = parseInt(match[ map.D ], 10)
376
410
 
377
411
  if (date.year === null || date.month === null || date.day < 1) {
378
412
  return date
@@ -388,14 +422,14 @@ export function __splitDate (str, mask, dateLocale, calendar, defaultModel) {
388
422
  }
389
423
 
390
424
  if (map.H !== void 0) {
391
- date.hour = parseInt(match[map.H], 10) % 24
425
+ date.hour = parseInt(match[ map.H ], 10) % 24
392
426
  }
393
427
  else if (map.h !== void 0) {
394
- date.hour = parseInt(match[map.h], 10) % 12
428
+ date.hour = parseInt(match[ map.h ], 10) % 12
395
429
  if (
396
- (map.A && match[map.A] === 'PM') ||
397
- (map.a && match[map.a] === 'pm') ||
398
- (map.aa && match[map.aa] === 'p.m.')
430
+ (map.A && match[ map.A ] === 'PM') ||
431
+ (map.a && match[ map.a ] === 'pm') ||
432
+ (map.aa && match[ map.aa ] === 'p.m.')
399
433
  ) {
400
434
  date.hour += 12
401
435
  }
@@ -403,20 +437,20 @@ export function __splitDate (str, mask, dateLocale, calendar, defaultModel) {
403
437
  }
404
438
 
405
439
  if (map.m !== void 0) {
406
- date.minute = parseInt(match[map.m], 10) % 60
440
+ date.minute = parseInt(match[ map.m ], 10) % 60
407
441
  }
408
442
 
409
443
  if (map.s !== void 0) {
410
- date.second = parseInt(match[map.s], 10) % 60
444
+ date.second = parseInt(match[ map.s ], 10) % 60
411
445
  }
412
446
 
413
447
  if (map.S !== void 0) {
414
- date.millisecond = parseInt(match[map.S], 10) * 10 ** (3 - match[map.S].length)
448
+ date.millisecond = parseInt(match[ map.S ], 10) * 10 ** (3 - match[ map.S ].length)
415
449
  }
416
450
 
417
451
  if (map.Z !== void 0 || map.ZZ !== void 0) {
418
- tzString = (map.Z !== void 0 ? match[map.Z].replace(':', '') : match[map.ZZ])
419
- date.timezoneOffset = (tzString[0] === '+' ? -1 : 1) * (60 * tzString.slice(1, 3) + 1 * tzString.slice(3, 5))
452
+ tzString = (map.Z !== void 0 ? match[ map.Z ].replace(':', '') : match[ map.ZZ ])
453
+ date.timezoneOffset = (tzString[ 0 ] === '+' ? -1 : 1) * (60 * tzString.slice(1, 3) + 1 * tzString.slice(3, 5))
420
454
  }
421
455
  }
422
456
 
@@ -496,17 +530,24 @@ export function startOfDate (date, unit, utc) {
496
530
 
497
531
  switch (unit) {
498
532
  case 'year':
499
- t[`${prefix}Month`](0)
533
+ case 'years':
534
+ t[ `${prefix}Month` ](0)
500
535
  case 'month':
501
- t[`${prefix}Date`](1)
536
+ case 'months':
537
+ t[ `${prefix}Date` ](1)
502
538
  case 'day':
503
- t[`${prefix}Hours`](0)
539
+ case 'days':
540
+ case 'date':
541
+ t[ `${prefix}Hours` ](0)
504
542
  case 'hour':
505
- t[`${prefix}Minutes`](0)
543
+ case 'hours':
544
+ t[ `${prefix}Minutes` ](0)
506
545
  case 'minute':
507
- t[`${prefix}Seconds`](0)
546
+ case 'minutes':
547
+ t[ `${prefix}Seconds` ](0)
508
548
  case 'second':
509
- t[`${prefix}Milliseconds`](0)
549
+ case 'seconds':
550
+ t[ `${prefix}Milliseconds` ](0)
510
551
  }
511
552
  return t
512
553
  }
@@ -518,17 +559,24 @@ export function endOfDate (date, unit, utc) {
518
559
 
519
560
  switch (unit) {
520
561
  case 'year':
521
- t[`${prefix}Month`](11)
562
+ case 'years':
563
+ t[ `${prefix}Month` ](11)
522
564
  case 'month':
523
- t[`${prefix}Date`](daysInMonth(t))
565
+ case 'months':
566
+ t[ `${prefix}Date` ](daysInMonth(t))
524
567
  case 'day':
525
- t[`${prefix}Hours`](23)
568
+ case 'days':
569
+ case 'date':
570
+ t[ `${prefix}Hours` ](23)
526
571
  case 'hour':
527
- t[`${prefix}Minutes`](59)
572
+ case 'hours':
573
+ t[ `${prefix}Minutes` ](59)
528
574
  case 'minute':
529
- t[`${prefix}Seconds`](59)
575
+ case 'minutes':
576
+ t[ `${prefix}Seconds` ](59)
530
577
  case 'second':
531
- t[`${prefix}Milliseconds`](999)
578
+ case 'seconds':
579
+ t[ `${prefix}Milliseconds` ](999)
532
580
  }
533
581
  return t
534
582
  }
@@ -563,21 +611,28 @@ export function getDateDiff (date, subtract, unit = 'days') {
563
611
 
564
612
  switch (unit) {
565
613
  case 'years':
614
+ case 'year':
566
615
  return (t.getFullYear() - sub.getFullYear())
567
616
 
568
617
  case 'months':
618
+ case 'month':
569
619
  return (t.getFullYear() - sub.getFullYear()) * 12 + t.getMonth() - sub.getMonth()
570
620
 
571
621
  case 'days':
622
+ case 'day':
623
+ case 'date':
572
624
  return getDiff(startOfDate(t, 'day'), startOfDate(sub, 'day'), MILLISECONDS_IN_DAY)
573
625
 
574
626
  case 'hours':
627
+ case 'hour':
575
628
  return getDiff(startOfDate(t, 'hour'), startOfDate(sub, 'hour'), MILLISECONDS_IN_HOUR)
576
629
 
577
630
  case 'minutes':
631
+ case 'minute':
578
632
  return getDiff(startOfDate(t, 'minute'), startOfDate(sub, 'minute'), MILLISECONDS_IN_MINUTE)
579
633
 
580
634
  case 'seconds':
635
+ case 'second':
581
636
  return getDiff(startOfDate(t, 'second'), startOfDate(sub, 'second'), 1000)
582
637
  }
583
638
  }
@@ -623,26 +678,33 @@ export function isSameDate (date, date2, unit) {
623
678
 
624
679
  switch (unit) {
625
680
  case 'second':
681
+ case 'seconds':
626
682
  if (t.getSeconds() !== d.getSeconds()) {
627
683
  return false
628
684
  }
629
685
  case 'minute': // intentional fall-through
686
+ case 'minutes':
630
687
  if (t.getMinutes() !== d.getMinutes()) {
631
688
  return false
632
689
  }
633
690
  case 'hour': // intentional fall-through
691
+ case 'hours':
634
692
  if (t.getHours() !== d.getHours()) {
635
693
  return false
636
694
  }
637
695
  case 'day': // intentional fall-through
696
+ case 'days':
697
+ case 'date':
638
698
  if (t.getDate() !== d.getDate()) {
639
699
  return false
640
700
  }
641
701
  case 'month': // intentional fall-through
702
+ case 'months':
642
703
  if (t.getMonth() !== d.getMonth()) {
643
704
  return false
644
705
  }
645
706
  case 'year': // intentional fall-through
707
+ case 'years':
646
708
  if (t.getFullYear() !== d.getFullYear()) {
647
709
  return false
648
710
  }
@@ -700,12 +762,12 @@ const formatter = {
700
762
 
701
763
  // Month Short Name: Jan, Feb, ...
702
764
  MMM (date, dateLocale) {
703
- return dateLocale.monthsShort[date.getMonth()]
765
+ return dateLocale.monthsShort[ date.getMonth() ]
704
766
  },
705
767
 
706
768
  // Month Name: January, February, ...
707
769
  MMMM (date, dateLocale) {
708
- return dateLocale.months[date.getMonth()]
770
+ return dateLocale.months[ date.getMonth() ]
709
771
  },
710
772
 
711
773
  // Quarter: 1, 2, 3, 4
@@ -755,12 +817,12 @@ const formatter = {
755
817
 
756
818
  // Day of week: Sun, Mon, ...
757
819
  ddd (date, dateLocale) {
758
- return dateLocale.daysShort[date.getDay()]
820
+ return dateLocale.daysShort[ date.getDay() ]
759
821
  },
760
822
 
761
823
  // Day of week: Sunday, Monday, ...
762
824
  dddd (date, dateLocale) {
763
- return dateLocale.days[date.getDay()]
825
+ return dateLocale.days[ date.getDay() ]
764
826
  },
765
827
 
766
828
  // Day of ISO week: 1, 2, ..., 7
@@ -909,7 +971,7 @@ export function formatDate (val, mask, dateLocale, __forcedYear, __forcedTimezon
909
971
  token,
910
972
  (match, text) => (
911
973
  match in formatter
912
- ? formatter[match](date, locale, __forcedYear, __forcedTimezoneOffset)
974
+ ? formatter[ match ](date, locale, __forcedYear, __forcedTimezoneOffset)
913
975
  : (text === void 0 ? match : text.split('\\]').join(']'))
914
976
  )
915
977
  )