@afeefa/vue-app 0.0.316 → 0.0.317

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.
@@ -1 +1 @@
1
- 0.0.316
1
+ 0.0.317
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@afeefa/vue-app",
3
- "version": "0.0.316",
3
+ "version": "0.0.317",
4
4
  "description": "",
5
5
  "author": "Afeefa Kollektiv <kollektiv@afeefa.de>",
6
6
  "license": "MIT",
@@ -251,13 +251,22 @@ export default class ADatePicker extends Mixins(ComponentWidthMixin, UsesPositio
251
251
  : value.substr(4, 4))
252
252
  value = `${day.padStart(2, '0')}.${month.padStart(2, '0')}.${year}`
253
253
  } else {
254
- // also accept DD.MM.YY and expand to YYYY (covers inputs like '1.2.20')
255
- const m = value.match(/^(\d{1,2})\.(\d{1,2})\.(\d{2})$/)
256
- if (m) {
257
- const day = m[1].padStart(2, '0')
258
- const month = m[2].padStart(2, '0')
259
- const year = (2000 + parseInt(m[3], 10)).toString()
254
+ // accept D.M. without year and expand to current year (covers inputs like '1.7.')
255
+ const mNoYear = value.match(/^(\d{1,2})\.(\d{1,2})\.$/)
256
+ if (mNoYear) {
257
+ const day = mNoYear[1].padStart(2, '0')
258
+ const month = mNoYear[2].padStart(2, '0')
259
+ const year = new Date().getFullYear().toString()
260
260
  value = `${day}.${month}.${year}`
261
+ } else {
262
+ // also accept DD.MM.YY and expand to YYYY (covers inputs like '1.2.20')
263
+ const m = value.match(/^(\d{1,2})\.(\d{1,2})\.(\d{2})$/)
264
+ if (m) {
265
+ const day = m[1].padStart(2, '0')
266
+ const month = m[2].padStart(2, '0')
267
+ const year = (2000 + parseInt(m[3], 10)).toString()
268
+ value = `${day}.${month}.${year}`
269
+ }
261
270
  }
262
271
  }
263
272