@anglr/datetime 2.0.0-beta.20220221103100 → 2.0.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.
- package/changelog.md +19 -0
- package/date-fns/package.json +7 -7
- package/date-fns/src/{date-fns.d.ts → index.d.ts} +4 -4
- package/date-fns/src/index.d.ts.map +1 -0
- package/date-fns/src/misc/tokens.d.ts +10 -10
- package/date-fns/src/services/dateFnsDateApi.service.d.ts +36 -33
- package/date-fns/src/services/dateFnsDateApi.service.d.ts.map +1 -1
- package/date-fns/src/services/dateFnsLocale.service.d.ts +10 -10
- package/es2015/date-fns/src/index.js +4 -0
- package/es2015/date-fns/src/index.js.map +1 -0
- package/es2015/date-fns/src/misc/tokens.js +20 -0
- package/es2015/date-fns/src/misc/tokens.js.map +1 -0
- package/es2015/date-fns/src/services/dateFnsDateApi.service.js +438 -0
- package/es2015/date-fns/src/services/dateFnsDateApi.service.js.map +1 -0
- package/es2015/date-fns/src/services/dateFnsLocale.service.js +2 -0
- package/es2015/date-fns/src/services/dateFnsLocale.service.js.map +1 -0
- package/es2015/karma.conf.js +57 -0
- package/es2015/karma.conf.js.map +1 -0
- package/{moment/src/moment.d.ts → es2015/moment/src/index.js} +3 -3
- package/es2015/moment/src/index.js.map +1 -0
- package/es2015/moment/src/misc/tokens.js +15 -0
- package/es2015/moment/src/misc/tokens.js.map +1 -0
- package/es2015/moment/src/services/momentDateApi.service.js +398 -0
- package/es2015/moment/src/services/momentDateApi.service.js.map +1 -0
- package/{src/datetime.d.ts → es2015/src/index.js} +19 -19
- package/es2015/src/index.js.map +1 -0
- package/es2015/src/misc/constants.js +33 -0
- package/es2015/src/misc/constants.js.map +1 -0
- package/es2015/src/misc/datetime.interface.js +2 -0
- package/es2015/src/misc/datetime.interface.js.map +1 -0
- package/es2015/src/misc/tokens.js +19 -0
- package/es2015/src/misc/tokens.js.map +1 -0
- package/es2015/src/misc/validators.js +58 -0
- package/es2015/src/misc/validators.js.map +1 -0
- package/es2015/src/modules/datePipes.module.js +33 -0
- package/es2015/src/modules/datePipes.module.js.map +1 -0
- package/es2015/src/picker/components/dayPicker/dayPicker.component.js +172 -0
- package/es2015/src/picker/components/dayPicker/dayPicker.component.js.map +1 -0
- package/es2015/src/picker/components/dayPicker/dayPicker.interfaces.js +2 -0
- package/es2015/src/picker/components/dayPicker/dayPicker.interfaces.js.map +1 -0
- package/es2015/src/picker/components/monthPicker/monthPicker.component.js +114 -0
- package/es2015/src/picker/components/monthPicker/monthPicker.component.js.map +1 -0
- package/es2015/src/picker/components/monthPicker/monthPicker.interfaces.js +2 -0
- package/es2015/src/picker/components/monthPicker/monthPicker.interfaces.js.map +1 -0
- package/es2015/src/picker/components/picker/picker.component.animations.js +71 -0
- package/es2015/src/picker/components/picker/picker.component.animations.js.map +1 -0
- package/es2015/src/picker/components/picker/picker.component.js +241 -0
- package/es2015/src/picker/components/picker/picker.component.js.map +1 -0
- package/es2015/src/picker/components/pickerBase.component.js +243 -0
- package/es2015/src/picker/components/pickerBase.component.js.map +1 -0
- package/es2015/src/picker/components/yearPicker/yearPicker.component.js +126 -0
- package/es2015/src/picker/components/yearPicker/yearPicker.component.js.map +1 -0
- package/es2015/src/picker/components/yearPicker/yearPicker.interfaces.js +2 -0
- package/es2015/src/picker/components/yearPicker/yearPicker.interfaces.js.map +1 -0
- package/es2015/src/picker/interfaces.js +5 -0
- package/es2015/src/picker/interfaces.js.map +1 -0
- package/es2015/src/picker/misc/datetimePicker.interface.js +2 -0
- package/es2015/src/picker/misc/datetimePicker.interface.js.map +1 -0
- package/es2015/src/picker/misc/tokens.js +6 -0
- package/es2015/src/picker/misc/tokens.js.map +1 -0
- package/es2015/src/picker/modules/picker.module.js +46 -0
- package/es2015/src/picker/modules/picker.module.js.map +1 -0
- package/es2015/src/picker/types.js +8 -0
- package/es2015/src/picker/types.js.map +1 -0
- package/es2015/src/pipes/asRequiredType.js +22 -0
- package/es2015/src/pipes/asRequiredType.js.map +1 -0
- package/es2015/src/pipes/dateConvert.pipe.js +35 -0
- package/es2015/src/pipes/dateConvert.pipe.js.map +1 -0
- package/es2015/src/pipes/dateFormat.pipe.js +45 -0
- package/es2015/src/pipes/dateFormat.pipe.js.map +1 -0
- package/es2015/src/selector/components/inputDateTime/inputDateTime.component.js +421 -0
- package/es2015/src/selector/components/inputDateTime/inputDateTime.component.js.map +1 -0
- package/es2015/src/selector/components/selector/selector.component.animations.js +15 -0
- package/es2015/src/selector/components/selector/selector.component.animations.js.map +1 -0
- package/es2015/src/selector/components/selector/selector.component.js +344 -0
- package/es2015/src/selector/components/selector/selector.component.js.map +1 -0
- package/es2015/src/selector/components/simpleInputDateTime/simpleInputDateTime.component.js +317 -0
- package/es2015/src/selector/components/simpleInputDateTime/simpleInputDateTime.component.js.map +1 -0
- package/es2015/src/selector/directives/datetimeMaxValidator/datetimeMaxValidator.directive.js +51 -0
- package/es2015/src/selector/directives/datetimeMaxValidator/datetimeMaxValidator.directive.js.map +1 -0
- package/es2015/src/selector/directives/datetimeMinValidator/datetimeMinValidator.directive.js +51 -0
- package/es2015/src/selector/directives/datetimeMinValidator/datetimeMinValidator.directive.js.map +1 -0
- package/es2015/src/selector/directives/datetimeValidator/datetimeValidator.directive.js +47 -0
- package/es2015/src/selector/directives/datetimeValidator/datetimeValidator.directive.js.map +1 -0
- package/es2015/src/selector/directives/selectorControlValueAccessor/selectorControlValueAccessor.directive.js +119 -0
- package/es2015/src/selector/directives/selectorControlValueAccessor/selectorControlValueAccessor.directive.js.map +1 -0
- package/es2015/src/selector/interfaces.js +2 -0
- package/es2015/src/selector/interfaces.js.map +1 -0
- package/es2015/src/selector/misc/datetimeSelector.interface.js +2 -0
- package/es2015/src/selector/misc/datetimeSelector.interface.js.map +1 -0
- package/es2015/src/selector/misc/tokens.js +6 -0
- package/es2015/src/selector/misc/tokens.js.map +1 -0
- package/es2015/src/selector/modules/basicSelector.module.js +20 -0
- package/es2015/src/selector/modules/basicSelector.module.js.map +1 -0
- package/es2015/src/selector/modules/selector.module.js +60 -0
- package/es2015/src/selector/modules/selector.module.js.map +1 -0
- package/es2015/src/selector/types.js +10 -0
- package/es2015/src/selector/types.js.map +1 -0
- package/es2015/src/services/dateApi.interface.js +2 -0
- package/es2015/src/services/dateApi.interface.js.map +1 -0
- package/es2015/src/services/datePositionParser.interface.js +2 -0
- package/es2015/src/services/datePositionParser.interface.js.map +1 -0
- package/es2015/src/services/datePositionParser.service.js +227 -0
- package/es2015/src/services/datePositionParser.service.js.map +1 -0
- package/es2015/src/services/dateTimeRelativeParser.service.js +66 -0
- package/es2015/src/services/dateTimeRelativeParser.service.js.map +1 -0
- package/es2015/src/services/dateValueProvider.service.js +58 -0
- package/es2015/src/services/dateValueProvider.service.js.map +1 -0
- package/es2015/src/services/formatProvider.interface.js +2 -0
- package/es2015/src/services/formatProvider.interface.js.map +1 -0
- package/es2015/src/services/index.js +4 -0
- package/es2015/src/services/index.js.map +1 -0
- package/es2020/date-fns/src/index.js +4 -0
- package/es2020/date-fns/src/index.js.map +1 -0
- package/es2020/date-fns/src/misc/tokens.js +20 -0
- package/es2020/date-fns/src/misc/tokens.js.map +1 -0
- package/es2020/date-fns/src/services/dateFnsDateApi.service.js +437 -0
- package/es2020/date-fns/src/services/dateFnsDateApi.service.js.map +1 -0
- package/es2020/date-fns/src/services/dateFnsLocale.service.js +2 -0
- package/es2020/date-fns/src/services/dateFnsLocale.service.js.map +1 -0
- package/es2020/karma.conf.js +57 -0
- package/es2020/karma.conf.js.map +1 -0
- package/es2020/moment/src/index.js +3 -0
- package/es2020/moment/src/index.js.map +1 -0
- package/es2020/moment/src/misc/tokens.js +15 -0
- package/es2020/moment/src/misc/tokens.js.map +1 -0
- package/es2020/moment/src/services/momentDateApi.service.js +398 -0
- package/es2020/moment/src/services/momentDateApi.service.js.map +1 -0
- package/es2020/src/index.js +19 -0
- package/es2020/src/index.js.map +1 -0
- package/es2020/src/misc/constants.js +33 -0
- package/es2020/src/misc/constants.js.map +1 -0
- package/es2020/src/misc/datetime.interface.js +2 -0
- package/es2020/src/misc/datetime.interface.js.map +1 -0
- package/es2020/src/misc/tokens.js +19 -0
- package/es2020/src/misc/tokens.js.map +1 -0
- package/es2020/src/misc/validators.js +58 -0
- package/es2020/src/misc/validators.js.map +1 -0
- package/es2020/src/modules/datePipes.module.js +33 -0
- package/es2020/src/modules/datePipes.module.js.map +1 -0
- package/es2020/src/picker/components/dayPicker/dayPicker.component.js +172 -0
- package/es2020/src/picker/components/dayPicker/dayPicker.component.js.map +1 -0
- package/es2020/src/picker/components/dayPicker/dayPicker.interfaces.js +2 -0
- package/es2020/src/picker/components/dayPicker/dayPicker.interfaces.js.map +1 -0
- package/es2020/src/picker/components/monthPicker/monthPicker.component.js +114 -0
- package/es2020/src/picker/components/monthPicker/monthPicker.component.js.map +1 -0
- package/es2020/src/picker/components/monthPicker/monthPicker.interfaces.js +2 -0
- package/es2020/src/picker/components/monthPicker/monthPicker.interfaces.js.map +1 -0
- package/es2020/src/picker/components/picker/picker.component.animations.js +71 -0
- package/es2020/src/picker/components/picker/picker.component.animations.js.map +1 -0
- package/es2020/src/picker/components/picker/picker.component.js +236 -0
- package/es2020/src/picker/components/picker/picker.component.js.map +1 -0
- package/es2020/src/picker/components/pickerBase.component.js +243 -0
- package/es2020/src/picker/components/pickerBase.component.js.map +1 -0
- package/es2020/src/picker/components/yearPicker/yearPicker.component.js +126 -0
- package/es2020/src/picker/components/yearPicker/yearPicker.component.js.map +1 -0
- package/es2020/src/picker/components/yearPicker/yearPicker.interfaces.js +2 -0
- package/es2020/src/picker/components/yearPicker/yearPicker.interfaces.js.map +1 -0
- package/es2020/src/picker/interfaces.js +5 -0
- package/es2020/src/picker/interfaces.js.map +1 -0
- package/es2020/src/picker/misc/datetimePicker.interface.js +2 -0
- package/es2020/src/picker/misc/datetimePicker.interface.js.map +1 -0
- package/es2020/src/picker/misc/tokens.js +6 -0
- package/es2020/src/picker/misc/tokens.js.map +1 -0
- package/es2020/src/picker/modules/picker.module.js +46 -0
- package/es2020/src/picker/modules/picker.module.js.map +1 -0
- package/es2020/src/picker/types.js +8 -0
- package/es2020/src/picker/types.js.map +1 -0
- package/es2020/src/pipes/asRequiredType.js +22 -0
- package/es2020/src/pipes/asRequiredType.js.map +1 -0
- package/es2020/src/pipes/dateConvert.pipe.js +35 -0
- package/es2020/src/pipes/dateConvert.pipe.js.map +1 -0
- package/es2020/src/pipes/dateFormat.pipe.js +45 -0
- package/es2020/src/pipes/dateFormat.pipe.js.map +1 -0
- package/es2020/src/selector/components/inputDateTime/inputDateTime.component.js +417 -0
- package/es2020/src/selector/components/inputDateTime/inputDateTime.component.js.map +1 -0
- package/es2020/src/selector/components/selector/selector.component.animations.js +15 -0
- package/es2020/src/selector/components/selector/selector.component.animations.js.map +1 -0
- package/es2020/src/selector/components/selector/selector.component.js +334 -0
- package/es2020/src/selector/components/selector/selector.component.js.map +1 -0
- package/es2020/src/selector/components/simpleInputDateTime/simpleInputDateTime.component.js +314 -0
- package/es2020/src/selector/components/simpleInputDateTime/simpleInputDateTime.component.js.map +1 -0
- package/es2020/src/selector/directives/datetimeMaxValidator/datetimeMaxValidator.directive.js +51 -0
- package/es2020/src/selector/directives/datetimeMaxValidator/datetimeMaxValidator.directive.js.map +1 -0
- package/es2020/src/selector/directives/datetimeMinValidator/datetimeMinValidator.directive.js +51 -0
- package/es2020/src/selector/directives/datetimeMinValidator/datetimeMinValidator.directive.js.map +1 -0
- package/es2020/src/selector/directives/datetimeValidator/datetimeValidator.directive.js +47 -0
- package/es2020/src/selector/directives/datetimeValidator/datetimeValidator.directive.js.map +1 -0
- package/es2020/src/selector/directives/selectorControlValueAccessor/selectorControlValueAccessor.directive.js +118 -0
- package/es2020/src/selector/directives/selectorControlValueAccessor/selectorControlValueAccessor.directive.js.map +1 -0
- package/es2020/src/selector/interfaces.js +2 -0
- package/es2020/src/selector/interfaces.js.map +1 -0
- package/es2020/src/selector/misc/datetimeSelector.interface.js +2 -0
- package/es2020/src/selector/misc/datetimeSelector.interface.js.map +1 -0
- package/es2020/src/selector/misc/tokens.js +6 -0
- package/es2020/src/selector/misc/tokens.js.map +1 -0
- package/es2020/src/selector/modules/basicSelector.module.js +20 -0
- package/es2020/src/selector/modules/basicSelector.module.js.map +1 -0
- package/es2020/src/selector/modules/selector.module.js +60 -0
- package/es2020/src/selector/modules/selector.module.js.map +1 -0
- package/es2020/src/selector/types.js +10 -0
- package/es2020/src/selector/types.js.map +1 -0
- package/es2020/src/services/dateApi.interface.js +2 -0
- package/es2020/src/services/dateApi.interface.js.map +1 -0
- package/es2020/src/services/datePositionParser.interface.js +2 -0
- package/es2020/src/services/datePositionParser.interface.js.map +1 -0
- package/es2020/src/services/datePositionParser.service.js +227 -0
- package/es2020/src/services/datePositionParser.service.js.map +1 -0
- package/es2020/src/services/dateTimeRelativeParser.service.js +65 -0
- package/es2020/src/services/dateTimeRelativeParser.service.js.map +1 -0
- package/es2020/src/services/dateValueProvider.service.js +58 -0
- package/es2020/src/services/dateValueProvider.service.js.map +1 -0
- package/es2020/src/services/formatProvider.interface.js +2 -0
- package/es2020/src/services/formatProvider.interface.js.map +1 -0
- package/es2020/src/services/index.js +4 -0
- package/es2020/src/services/index.js.map +1 -0
- package/karma.conf.d.ts +2 -0
- package/karma.conf.d.ts.map +1 -0
- package/moment/package.json +7 -7
- package/moment/src/index.d.ts +3 -0
- package/moment/src/index.d.ts.map +1 -0
- package/moment/src/misc/tokens.d.ts +5 -5
- package/moment/src/services/momentDateApi.service.d.ts +35 -32
- package/moment/src/services/momentDateApi.service.d.ts.map +1 -1
- package/package.json +100 -48
- package/src/index.d.ts +19 -0
- package/src/index.d.ts.map +1 -0
- package/src/misc/constants.d.ts +32 -32
- package/src/misc/datetime.interface.d.ts +34 -34
- package/src/misc/tokens.d.ts +10 -10
- package/src/misc/validators.d.ts +25 -25
- package/src/modules/datePipes.module.d.ts +12 -5
- package/src/modules/datePipes.module.d.ts.map +1 -1
- package/src/picker/components/dayPicker/dayPicker.component.d.ts +68 -65
- package/src/picker/components/dayPicker/dayPicker.component.d.ts.map +1 -1
- package/src/picker/components/dayPicker/dayPicker.component.html +7 -7
- package/src/picker/components/dayPicker/dayPicker.interfaces.d.ts +10 -10
- package/src/picker/components/monthPicker/monthPicker.component.d.ts +52 -49
- package/src/picker/components/monthPicker/monthPicker.component.d.ts.map +1 -1
- package/src/picker/components/monthPicker/monthPicker.component.html +6 -6
- package/src/picker/components/monthPicker/monthPicker.interfaces.d.ts +6 -6
- package/src/picker/components/picker/picker.component.animations.d.ts +4 -4
- package/src/picker/components/picker/picker.component.d.ts +104 -101
- package/src/picker/components/picker/picker.component.d.ts.map +1 -1
- package/src/picker/components/pickerBase.component.d.ts +169 -166
- package/src/picker/components/pickerBase.component.d.ts.map +1 -1
- package/src/picker/components/yearPicker/yearPicker.component.d.ts +57 -54
- package/src/picker/components/yearPicker/yearPicker.component.d.ts.map +1 -1
- package/src/picker/components/yearPicker/yearPicker.component.html +6 -6
- package/src/picker/components/yearPicker/yearPicker.interfaces.d.ts +6 -6
- package/src/picker/interfaces.d.ts +4 -4
- package/src/picker/misc/datetimePicker.interface.d.ts +188 -188
- package/src/picker/misc/tokens.d.ts +6 -6
- package/src/picker/modules/picker.module.d.ts +16 -5
- package/src/picker/modules/picker.module.d.ts.map +1 -1
- package/src/picker/types.d.ts +7 -7
- package/src/pipes/asRequiredType.d.ts +21 -0
- package/src/pipes/asRequiredType.d.ts.map +1 -0
- package/src/pipes/dateConvert.pipe.d.ts +18 -15
- package/src/pipes/dateConvert.pipe.d.ts.map +1 -1
- package/src/pipes/dateFormat.pipe.d.ts +20 -17
- package/src/pipes/dateFormat.pipe.d.ts.map +1 -1
- package/src/selector/components/inputDateTime/inputDateTime.component.d.ts +187 -184
- package/src/selector/components/inputDateTime/inputDateTime.component.d.ts.map +1 -1
- package/src/selector/components/selector/selector.component.animations.d.ts +4 -4
- package/src/selector/components/selector/selector.component.d.ts +155 -152
- package/src/selector/components/selector/selector.component.d.ts.map +1 -1
- package/src/selector/components/simpleInputDateTime/simpleInputDateTime.component.d.ts +170 -167
- package/src/selector/components/simpleInputDateTime/simpleInputDateTime.component.d.ts.map +1 -1
- package/src/selector/directives/datetimeMaxValidator/datetimeMaxValidator.directive.d.ts +22 -19
- package/src/selector/directives/datetimeMaxValidator/datetimeMaxValidator.directive.d.ts.map +1 -1
- package/src/selector/directives/datetimeMinValidator/datetimeMinValidator.directive.d.ts +22 -19
- package/src/selector/directives/datetimeMinValidator/datetimeMinValidator.directive.d.ts.map +1 -1
- package/src/selector/directives/datetimeValidator/datetimeValidator.directive.d.ts +21 -18
- package/src/selector/directives/datetimeValidator/datetimeValidator.directive.d.ts.map +1 -1
- package/src/selector/directives/selectorControlValueAccessor/selectorControlValueAccessor.directive.d.ts +53 -50
- package/src/selector/directives/selectorControlValueAccessor/selectorControlValueAccessor.directive.d.ts.map +1 -1
- package/src/selector/interfaces.d.ts +1 -1
- package/src/selector/misc/datetimeSelector.interface.d.ts +82 -82
- package/src/selector/misc/tokens.d.ts +6 -6
- package/src/selector/modules/basicSelector.module.d.ts +10 -5
- package/src/selector/modules/basicSelector.module.d.ts.map +1 -1
- package/src/selector/modules/selector.module.d.ts +18 -5
- package/src/selector/modules/selector.module.d.ts.map +1 -1
- package/src/selector/types.d.ts +9 -9
- package/src/services/dateApi.interface.d.ts +275 -275
- package/src/services/datePositionParser.interface.d.ts +40 -40
- package/src/services/datePositionParser.service.d.ts +60 -57
- package/src/services/datePositionParser.service.d.ts.map +1 -1
- package/src/services/dateTimeRelativeParser.service.d.ts +21 -18
- package/src/services/dateTimeRelativeParser.service.d.ts.map +1 -1
- package/src/services/dateValueProvider.service.d.ts +18 -15
- package/src/services/dateValueProvider.service.d.ts.map +1 -1
- package/src/services/formatProvider.interface.d.ts +17 -17
- package/src/services/index.d.ts +3 -3
- package/tsconfig.karma.json +5 -6
- package/version.bak +1 -1
- package/appveyor.yml +0 -70
- package/date-fns/dist/es2015/date-fns/index.js +0 -10
- package/date-fns/dist/es2015/date-fns/public_api.js +0 -7
- package/date-fns/dist/es2015/date-fns/src/date-fns.js +0 -9
- package/date-fns/dist/es2015/date-fns/src/misc/tokens.js +0 -32
- package/date-fns/dist/es2015/date-fns/src/services/dateFnsDateApi.service.js +0 -512
- package/date-fns/dist/es2015/date-fns/src/services/dateFnsLocale.service.js +0 -18
- package/date-fns/dist/es5/date-fns/index.js +0 -10
- package/date-fns/dist/es5/date-fns/public_api.js +0 -7
- package/date-fns/dist/es5/date-fns/src/date-fns.js +0 -9
- package/date-fns/dist/es5/date-fns/src/misc/tokens.js +0 -32
- package/date-fns/dist/es5/date-fns/src/services/dateFnsDateApi.service.js +0 -902
- package/date-fns/dist/es5/date-fns/src/services/dateFnsLocale.service.js +0 -18
- package/date-fns/index.d.ts +0 -5
- package/date-fns/index.d.ts.map +0 -1
- package/date-fns/index.metadata.json +0 -1
- package/date-fns/public_api.d.ts +0 -2
- package/date-fns/public_api.d.ts.map +0 -1
- package/date-fns/src/date-fns.d.ts.map +0 -1
- package/date-fns/src/services/dateFnsDateApi.service.ngfactory.d.ts.map +0 -1
- package/datetime.d.ts +0 -7
- package/datetime.d.ts.map +0 -1
- package/datetime.metadata.json +0 -1
- package/dist/es2015/datetime.js +0 -10
- package/dist/es2015/public_api.js +0 -7
- package/dist/es2015/src/datetime.js +0 -24
- package/dist/es2015/src/misc/constants.js +0 -46
- package/dist/es2015/src/misc/datetime.interface.js +0 -52
- package/dist/es2015/src/misc/tokens.js +0 -29
- package/dist/es2015/src/misc/validators.js +0 -80
- package/dist/es2015/src/modules/datePipes.module.js +0 -26
- package/dist/es2015/src/picker/components/dayPicker/dayPicker.component.js +0 -215
- package/dist/es2015/src/picker/components/dayPicker/dayPicker.interfaces.js +0 -18
- package/dist/es2015/src/picker/components/monthPicker/monthPicker.component.js +0 -138
- package/dist/es2015/src/picker/components/monthPicker/monthPicker.interfaces.js +0 -11
- package/dist/es2015/src/picker/components/picker/picker.component.animations.js +0 -77
- package/dist/es2015/src/picker/components/picker/picker.component.js +0 -386
- package/dist/es2015/src/picker/components/pickerBase.component.js +0 -406
- package/dist/es2015/src/picker/components/yearPicker/yearPicker.component.js +0 -158
- package/dist/es2015/src/picker/components/yearPicker/yearPicker.interfaces.js +0 -11
- package/dist/es2015/src/picker/interfaces.js +0 -10
- package/dist/es2015/src/picker/misc/datetimePicker.interface.js +0 -245
- package/dist/es2015/src/picker/misc/tokens.js +0 -12
- package/dist/es2015/src/picker/modules/picker.module.js +0 -35
- package/dist/es2015/src/picker/types.js +0 -13
- package/dist/es2015/src/pipes/dateConvert.pipe.js +0 -50
- package/dist/es2015/src/pipes/dateFormat.pipe.js +0 -64
- package/dist/es2015/src/selector/components/inputDateTime/inputDateTime.component.js +0 -588
- package/dist/es2015/src/selector/components/selector/selector.component.animations.js +0 -21
- package/dist/es2015/src/selector/components/selector/selector.component.js +0 -514
- package/dist/es2015/src/selector/components/simpleInputDateTime/simpleInputDateTime.component.js +0 -456
- package/dist/es2015/src/selector/directives/datetimeMaxValidator/datetimeMaxValidator.directive.js +0 -73
- package/dist/es2015/src/selector/directives/datetimeMinValidator/datetimeMinValidator.directive.js +0 -73
- package/dist/es2015/src/selector/directives/datetimeValidator/datetimeValidator.directive.js +0 -70
- package/dist/es2015/src/selector/directives/selectorControlValueAccessor/selectorControlValueAccessor.directive.js +0 -171
- package/dist/es2015/src/selector/interfaces.js +0 -7
- package/dist/es2015/src/selector/misc/datetimeSelector.interface.js +0 -106
- package/dist/es2015/src/selector/misc/tokens.js +0 -12
- package/dist/es2015/src/selector/modules/basicSelector.module.js +0 -20
- package/dist/es2015/src/selector/modules/selector.module.js +0 -45
- package/dist/es2015/src/selector/types.js +0 -15
- package/dist/es2015/src/services/dateApi.interface.js +0 -316
- package/dist/es2015/src/services/datePositionParser.interface.js +0 -56
- package/dist/es2015/src/services/datePositionParser.service.js +0 -297
- package/dist/es2015/src/services/dateTimeRelativeParser.service.js +0 -97
- package/dist/es2015/src/services/dateValueProvider.service.js +0 -79
- package/dist/es2015/src/services/formatProvider.interface.js +0 -28
- package/dist/es2015/src/services/index.js +0 -9
- package/dist/es5/datetime.js +0 -10
- package/dist/es5/public_api.js +0 -7
- package/dist/es5/src/datetime.js +0 -24
- package/dist/es5/src/misc/constants.js +0 -46
- package/dist/es5/src/misc/datetime.interface.js +0 -52
- package/dist/es5/src/misc/tokens.js +0 -29
- package/dist/es5/src/misc/validators.js +0 -124
- package/dist/es5/src/modules/datePipes.module.js +0 -30
- package/dist/es5/src/picker/components/dayPicker/dayPicker.component.js +0 -323
- package/dist/es5/src/picker/components/dayPicker/dayPicker.interfaces.js +0 -18
- package/dist/es5/src/picker/components/monthPicker/monthPicker.component.js +0 -233
- package/dist/es5/src/picker/components/monthPicker/monthPicker.interfaces.js +0 -11
- package/dist/es5/src/picker/components/picker/picker.component.animations.js +0 -77
- package/dist/es5/src/picker/components/picker/picker.component.js +0 -460
- package/dist/es5/src/picker/components/pickerBase.component.js +0 -561
- package/dist/es5/src/picker/components/yearPicker/yearPicker.component.js +0 -253
- package/dist/es5/src/picker/components/yearPicker/yearPicker.interfaces.js +0 -11
- package/dist/es5/src/picker/interfaces.js +0 -10
- package/dist/es5/src/picker/misc/datetimePicker.interface.js +0 -245
- package/dist/es5/src/picker/misc/tokens.js +0 -12
- package/dist/es5/src/picker/modules/picker.module.js +0 -39
- package/dist/es5/src/picker/types.js +0 -13
- package/dist/es5/src/pipes/dateConvert.pipe.js +0 -63
- package/dist/es5/src/pipes/dateFormat.pipe.js +0 -79
- package/dist/es5/src/selector/components/inputDateTime/inputDateTime.component.js +0 -808
- package/dist/es5/src/selector/components/selector/selector.component.animations.js +0 -21
- package/dist/es5/src/selector/components/selector/selector.component.js +0 -653
- package/dist/es5/src/selector/components/simpleInputDateTime/simpleInputDateTime.component.js +0 -656
- package/dist/es5/src/selector/directives/datetimeMaxValidator/datetimeMaxValidator.directive.js +0 -84
- package/dist/es5/src/selector/directives/datetimeMinValidator/datetimeMinValidator.directive.js +0 -84
- package/dist/es5/src/selector/directives/datetimeValidator/datetimeValidator.directive.js +0 -82
- package/dist/es5/src/selector/directives/selectorControlValueAccessor/selectorControlValueAccessor.directive.js +0 -230
- package/dist/es5/src/selector/interfaces.js +0 -7
- package/dist/es5/src/selector/misc/datetimeSelector.interface.js +0 -106
- package/dist/es5/src/selector/misc/tokens.js +0 -12
- package/dist/es5/src/selector/modules/basicSelector.module.js +0 -24
- package/dist/es5/src/selector/modules/selector.module.js +0 -49
- package/dist/es5/src/selector/types.js +0 -15
- package/dist/es5/src/services/dateApi.interface.js +0 -316
- package/dist/es5/src/services/datePositionParser.interface.js +0 -56
- package/dist/es5/src/services/datePositionParser.service.js +0 -366
- package/dist/es5/src/services/dateTimeRelativeParser.service.js +0 -108
- package/dist/es5/src/services/dateValueProvider.service.js +0 -92
- package/dist/es5/src/services/formatProvider.interface.js +0 -28
- package/dist/es5/src/services/index.js +0 -9
- package/moment/dist/es2015/moment/index.js +0 -10
- package/moment/dist/es2015/moment/public_api.js +0 -7
- package/moment/dist/es2015/moment/src/misc/tokens.js +0 -26
- package/moment/dist/es2015/moment/src/moment.js +0 -8
- package/moment/dist/es2015/moment/src/services/momentDateApi.service.js +0 -466
- package/moment/dist/es5/moment/index.js +0 -10
- package/moment/dist/es5/moment/public_api.js +0 -7
- package/moment/dist/es5/moment/src/misc/tokens.js +0 -26
- package/moment/dist/es5/moment/src/moment.js +0 -8
- package/moment/dist/es5/moment/src/services/momentDateApi.service.js +0 -858
- package/moment/index.d.ts +0 -5
- package/moment/index.d.ts.map +0 -1
- package/moment/index.metadata.json +0 -1
- package/moment/public_api.d.ts +0 -2
- package/moment/public_api.d.ts.map +0 -1
- package/moment/src/moment.d.ts.map +0 -1
- package/moment/src/services/momentDateApi.service.ngfactory.d.ts.map +0 -1
- package/public_api.d.ts +0 -2
- package/public_api.d.ts.map +0 -1
- package/src/datetime.d.ts.map +0 -1
- package/src/modules/datePipes.module.ngfactory.d.ts.map +0 -1
- package/src/picker/components/dayPicker/dayPicker.component.css.shim.ngstyle.d.ts.map +0 -1
- package/src/picker/components/dayPicker/dayPicker.component.ngfactory.d.ts.map +0 -1
- package/src/picker/components/monthPicker/monthPicker.component.css.shim.ngstyle.d.ts.map +0 -1
- package/src/picker/components/monthPicker/monthPicker.component.ngfactory.d.ts.map +0 -1
- package/src/picker/components/picker/picker.component.ngfactory.d.ts.map +0 -1
- package/src/picker/components/yearPicker/yearPicker.component.css.shim.ngstyle.d.ts.map +0 -1
- package/src/picker/components/yearPicker/yearPicker.component.ngfactory.d.ts.map +0 -1
- package/src/picker/modules/picker.module.ngfactory.d.ts.map +0 -1
- package/src/pipes/dateConvert.pipe.ngfactory.d.ts.map +0 -1
- package/src/pipes/dateFormat.pipe.ngfactory.d.ts.map +0 -1
- package/src/selector/components/inputDateTime/inputDateTime.component.css.shim.ngstyle.d.ts.map +0 -1
- package/src/selector/components/inputDateTime/inputDateTime.component.ngfactory.d.ts.map +0 -1
- package/src/selector/components/selector/selector.component.css.shim.ngstyle.d.ts.map +0 -1
- package/src/selector/components/selector/selector.component.ngfactory.d.ts.map +0 -1
- package/src/selector/components/simpleInputDateTime/simpleInputDateTime.component.css.shim.ngstyle.d.ts.map +0 -1
- package/src/selector/components/simpleInputDateTime/simpleInputDateTime.component.ngfactory.d.ts.map +0 -1
- package/src/selector/directives/datetimeMaxValidator/datetimeMaxValidator.directive.ngfactory.d.ts.map +0 -1
- package/src/selector/directives/datetimeMinValidator/datetimeMinValidator.directive.ngfactory.d.ts.map +0 -1
- package/src/selector/directives/datetimeValidator/datetimeValidator.directive.ngfactory.d.ts.map +0 -1
- package/src/selector/directives/selectorControlValueAccessor/selectorControlValueAccessor.directive.ngfactory.d.ts.map +0 -1
- package/src/selector/modules/basicSelector.module.ngfactory.d.ts.map +0 -1
- package/src/selector/modules/selector.module.ngfactory.d.ts.map +0 -1
- package/src/services/datePositionParser.service.ngfactory.d.ts.map +0 -1
- package/src/services/dateTimeRelativeParser.service.ngfactory.d.ts.map +0 -1
- package/src/services/dateValueProvider.service.ngfactory.d.ts.map +0 -1
package/changelog.md
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## Version 2.0.1 (2022-02-22)
|
|
4
|
+
|
|
5
|
+
### Bug Fixes
|
|
6
|
+
|
|
7
|
+
- fixed typings, not using rolled up typings for now
|
|
8
|
+
- fixed scss entry points
|
|
9
|
+
|
|
10
|
+
## Version 2.0.0 (2022-02-21)
|
|
11
|
+
|
|
12
|
+
### BREAKING CHANGES
|
|
13
|
+
|
|
14
|
+
- minimal supported version of *Angular* is `13.1.0`
|
|
15
|
+
- minimal supported version of `@jscrpt/common` is `2.2.0`
|
|
16
|
+
- minimal supported version of `@anglr/common` is `10.0.0`
|
|
17
|
+
- compiled as *Angular IVY* **only** with new *APF*
|
|
18
|
+
- removed support of *es5* target and using latest package.json features
|
|
19
|
+
- removed dependency `@anglr/types`, all mising types used directly here
|
|
20
|
+
- dropped support of `Node.js <= 12.20`
|
|
21
|
+
|
|
3
22
|
## Version 1.0.0 (2022-02-17)
|
|
4
23
|
|
|
5
24
|
### Features
|
package/date-fns/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
|
|
2
1
|
{
|
|
3
2
|
"name": "@anglr/datetime-date-fns",
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
"
|
|
7
|
-
"
|
|
8
|
-
"
|
|
9
|
-
|
|
3
|
+
"sideEffects": false,
|
|
4
|
+
"module": "../es2015/date-fns/src/index.js",
|
|
5
|
+
"es2015": "../es2015/date-fns/src/index.js",
|
|
6
|
+
"es2020": "../es2020/date-fns/src/index.js",
|
|
7
|
+
"esm2020": "../es2020/date-fns/src/index.js",
|
|
8
|
+
"typings": "./src/index.d.ts"
|
|
9
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export * from './services/dateFnsDateApi.service';
|
|
2
|
-
export * from './services/dateFnsLocale.service';
|
|
3
|
-
export * from './misc/tokens';
|
|
4
|
-
//# sourceMappingURL=
|
|
1
|
+
export * from './services/dateFnsDateApi.service';
|
|
2
|
+
export * from './services/dateFnsLocale.service';
|
|
3
|
+
export * from './misc/tokens';
|
|
4
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,cAAc,mCAAmC,CAAC;AAClD,cAAc,kCAAkC,CAAC;AACjD,cAAc,eAAe,CAAC"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { FactoryProvider, InjectionToken } from '@angular/core';
|
|
2
|
-
import { DateFnsLocale } from '../services/dateFnsLocale.service';
|
|
3
|
-
/**
|
|
4
|
-
* Injection token used for obtaining Date fns locale service
|
|
5
|
-
*/
|
|
6
|
-
export declare const DATE_FNS_LOCALE: InjectionToken<DateFnsLocale>;
|
|
7
|
-
/**
|
|
8
|
-
* Injection token used for obtaining date-fns FormatProvider implementation
|
|
9
|
-
*/
|
|
10
|
-
export declare const DATEFNS_FORMAT_PROVIDER: FactoryProvider;
|
|
1
|
+
import { FactoryProvider, InjectionToken } from '@angular/core';
|
|
2
|
+
import { DateFnsLocale } from '../services/dateFnsLocale.service';
|
|
3
|
+
/**
|
|
4
|
+
* Injection token used for obtaining Date fns locale service
|
|
5
|
+
*/
|
|
6
|
+
export declare const DATE_FNS_LOCALE: InjectionToken<DateFnsLocale>;
|
|
7
|
+
/**
|
|
8
|
+
* Injection token used for obtaining date-fns FormatProvider implementation
|
|
9
|
+
*/
|
|
10
|
+
export declare const DATEFNS_FORMAT_PROVIDER: FactoryProvider;
|
|
11
11
|
//# sourceMappingURL=tokens.d.ts.map
|
|
@@ -1,34 +1,37 @@
|
|
|
1
|
-
import { DateApi, DateValue, DateApiObject, DateTimeRelativeParser } from '@anglr/datetime';
|
|
2
|
-
import { DateFnsLocale } from './dateFnsLocale.service';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
protected
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
*
|
|
13
|
-
* @param
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
*
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
1
|
+
import { DateApi, DateValue, DateApiObject, DateTimeRelativeParser } from '@anglr/datetime';
|
|
2
|
+
import { DateFnsLocale } from './dateFnsLocale.service';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
/**
|
|
5
|
+
* Date api using DateFnsJS, used for obtaining DateApi wrapper object
|
|
6
|
+
*/
|
|
7
|
+
export declare class DateFnsDateApi implements DateApi<Date> {
|
|
8
|
+
protected _localeSvc: DateFnsLocale;
|
|
9
|
+
protected _relativeParser: DateTimeRelativeParser<Date>;
|
|
10
|
+
constructor(_localeSvc: DateFnsLocale, _relativeParser: DateTimeRelativeParser<Date>);
|
|
11
|
+
/**
|
|
12
|
+
* Gets wrapping object used for manipulation
|
|
13
|
+
* @param value - Value to be converted (parsed) and used for manipulation
|
|
14
|
+
* @param format - Format string used for parsing string value
|
|
15
|
+
*/
|
|
16
|
+
getValue(value: DateValue | Date, format?: string): DateApiObject<Date>;
|
|
17
|
+
/**
|
|
18
|
+
* Gets wrapping object used for manipulation instantiated to current date and time
|
|
19
|
+
*/
|
|
20
|
+
now(): DateApiObject<Date>;
|
|
21
|
+
/**
|
|
22
|
+
* Gets format string using pseudo format
|
|
23
|
+
* @param pseudoFormat - Pseudo format token, used for obtaining 'date' or 'time' format string
|
|
24
|
+
*/
|
|
25
|
+
getFormat(pseudoFormat: string): string;
|
|
26
|
+
/**
|
|
27
|
+
* Gets information
|
|
28
|
+
*/
|
|
29
|
+
weekStartsOnMonday(): boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Gets array of weekday names in short format, order of days is dependent on locale
|
|
32
|
+
*/
|
|
33
|
+
weekdaysShort(): string[];
|
|
34
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DateFnsDateApi, never>;
|
|
35
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<DateFnsDateApi>;
|
|
36
|
+
}
|
|
34
37
|
//# sourceMappingURL=dateFnsDateApi.service.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dateFnsDateApi.service.d.ts","sourceRoot":"","sources":["dateFnsDateApi.service.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,sBAAsB,EAAC,MAAM,iBAAiB,CAAC;AAK1F,OAAO,EAAC,aAAa,EAAC,MAAM,yBAAyB,CAAC
|
|
1
|
+
{"version":3,"file":"dateFnsDateApi.service.d.ts","sourceRoot":"","sources":["dateFnsDateApi.service.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,sBAAsB,EAAC,MAAM,iBAAiB,CAAC;AAK1F,OAAO,EAAC,aAAa,EAAC,MAAM,yBAAyB,CAAC;;AAihBtD;;GAEG;AACH,qBACa,cAAe,YAAW,OAAO,CAAC,IAAI,CAAC;IAGX,SAAS,CAAC,UAAU,EAAE,aAAa;IAC5D,SAAS,CAAC,eAAe,EAAE,sBAAsB,CAAC,IAAI,CAAC;gBADpB,UAAU,EAAE,aAAa,EAClD,eAAe,EAAE,sBAAsB,CAAC,IAAI,CAAC;IAMnE;;;;OAIG;IACI,QAAQ,CAAC,KAAK,EAAE,SAAS,GAAC,IAAI,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,aAAa,CAAC,IAAI,CAAC;IAK5E;;OAEG;IACI,GAAG,IAAI,aAAa,CAAC,IAAI,CAAC;IAKjC;;;OAGG;IACI,SAAS,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM;IAgC9C;;OAEG;IACI,kBAAkB,IAAI,OAAO;IAKpC;;OAEG;IACI,aAAa,IAAI,MAAM,EAAE;yCA3EvB,cAAc;6CAAd,cAAc;CAuF1B"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { Locale } from 'date-fns';
|
|
2
|
-
/**
|
|
3
|
-
* Date FNS locale service, used for obtaining locale
|
|
4
|
-
*/
|
|
5
|
-
export interface DateFnsLocale {
|
|
6
|
-
/**
|
|
7
|
-
* Gets current active locale for date fns
|
|
8
|
-
*/
|
|
9
|
-
readonly locale: Locale;
|
|
10
|
-
}
|
|
1
|
+
import { Locale } from 'date-fns';
|
|
2
|
+
/**
|
|
3
|
+
* Date FNS locale service, used for obtaining locale
|
|
4
|
+
*/
|
|
5
|
+
export interface DateFnsLocale {
|
|
6
|
+
/**
|
|
7
|
+
* Gets current active locale for date fns
|
|
8
|
+
*/
|
|
9
|
+
readonly locale: Locale;
|
|
10
|
+
}
|
|
11
11
|
//# sourceMappingURL=dateFnsLocale.service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../date-fns/src/index.ts"],"names":[],"mappings":"AAAA,cAAc,mCAAmC,CAAC;AAClD,cAAc,kCAAkC,CAAC;AACjD,cAAc,eAAe,CAAC","sourcesContent":["export * from './services/dateFnsDateApi.service';\nexport * from './services/dateFnsLocale.service';\nexport * from './misc/tokens';"]}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { InjectionToken } from '@angular/core';
|
|
2
|
+
import { FORMAT_PROVIDER } from '@anglr/datetime';
|
|
3
|
+
/**
|
|
4
|
+
* Injection token used for obtaining Date fns locale service
|
|
5
|
+
*/
|
|
6
|
+
export const DATE_FNS_LOCALE = new InjectionToken('DATE_FNS_LOCALE');
|
|
7
|
+
/**
|
|
8
|
+
* Injection token used for obtaining date-fns FormatProvider implementation
|
|
9
|
+
*/
|
|
10
|
+
export const DATEFNS_FORMAT_PROVIDER = {
|
|
11
|
+
provide: FORMAT_PROVIDER,
|
|
12
|
+
useFactory: () => {
|
|
13
|
+
return {
|
|
14
|
+
date: 'P',
|
|
15
|
+
dateTime: 'Pp',
|
|
16
|
+
time: 'p'
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
//# sourceMappingURL=tokens.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tokens.js","sourceRoot":"","sources":["../../../../date-fns/src/misc/tokens.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,cAAc,EAAC,MAAM,eAAe,CAAC;AAC9D,OAAO,EAAiB,eAAe,EAAC,MAAM,iBAAiB,CAAC;AAIhE;;GAEG;AACH,MAAM,CAAC,MAAM,eAAe,GAAkC,IAAI,cAAc,CAAgB,iBAAiB,CAAC,CAAC;AAEnH;;GAEG;AACH,MAAM,CAAC,MAAM,uBAAuB,GACpC;IACI,OAAO,EAAE,eAAe;IACxB,UAAU,EAAE,GAAG,EAAE;QAEb,OAAuB;YACnB,IAAI,EAAE,GAAG;YACT,QAAQ,EAAE,IAAI;YACd,IAAI,EAAE,GAAG;SACZ,CAAC;IACN,CAAC;CACJ,CAAC","sourcesContent":["import {FactoryProvider, InjectionToken} from '@angular/core';\nimport {FormatProvider, FORMAT_PROVIDER} from '@anglr/datetime';\n\nimport {DateFnsLocale} from '../services/dateFnsLocale.service';\n\n/**\n * Injection token used for obtaining Date fns locale service\n */\nexport const DATE_FNS_LOCALE: InjectionToken<DateFnsLocale> = new InjectionToken<DateFnsLocale>('DATE_FNS_LOCALE');\n\n/**\n * Injection token used for obtaining date-fns FormatProvider implementation\n */\nexport const DATEFNS_FORMAT_PROVIDER: FactoryProvider =\n{\n provide: FORMAT_PROVIDER,\n useFactory: () =>\n {\n return <FormatProvider>{\n date: 'P',\n dateTime: 'Pp',\n time: 'p'\n };\n }\n};"]}
|
|
@@ -0,0 +1,438 @@
|
|
|
1
|
+
import { Inject, Injectable } from '@angular/core';
|
|
2
|
+
import { DateTimeRelativeParser } from '@anglr/datetime';
|
|
3
|
+
import { isBlank, isPresent, isString } from '@jscrpt/common';
|
|
4
|
+
import { toDate, getDate, setDate, isAfter, isBefore, differenceInCalendarDays, format, startOfMonth, endOfMonth, startOfWeek, endOfWeek, startOfDay, endOfDay, addMonths, addWeeks, addDays, subMonths, subWeeks, subDays, getDaysInMonth, isSameDay, isSameWeek, isSameMonth, isValid, parse, parseISO, addYears, subYears, startOfYear, endOfYear, isWeekend, setYear, getYear, isSameYear, startOfDecade, endOfDecade, setMonth, getMonth, setISODay, getISODay } from 'date-fns';
|
|
5
|
+
import { DATE_FNS_LOCALE } from '../misc/tokens';
|
|
6
|
+
import * as i0 from "@angular/core";
|
|
7
|
+
import * as i1 from "@anglr/datetime";
|
|
8
|
+
/**
|
|
9
|
+
* Instance of object wrapping TDate, allowing manipulation with it
|
|
10
|
+
*/
|
|
11
|
+
class DateFnsDateApiObject {
|
|
12
|
+
//######################### constructor #########################
|
|
13
|
+
constructor(value, _localeSvc, format) {
|
|
14
|
+
this._localeSvc = _localeSvc;
|
|
15
|
+
if (isString(value)) {
|
|
16
|
+
//ISO string
|
|
17
|
+
if (/^\d+-\d+-\d+(T\d+:\d+:\d+)?/.test(value)) {
|
|
18
|
+
this._value = this._originalValue = parseISO(value);
|
|
19
|
+
}
|
|
20
|
+
else {
|
|
21
|
+
if (isBlank(format)) {
|
|
22
|
+
throw new Error('date-fns requires format parameter to be set for parsing non ISO string date!');
|
|
23
|
+
}
|
|
24
|
+
this._value = this._originalValue = parse(value, format, new Date(1970, 0));
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
else {
|
|
28
|
+
this._value = this._originalValue = toDate(value);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
//######################### public properties - implementation of DateApiObject #########################
|
|
32
|
+
/**
|
|
33
|
+
* Original value that is not changed unless 'updateOriginal' is called
|
|
34
|
+
*/
|
|
35
|
+
get originalValue() {
|
|
36
|
+
return this._originalValue;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Instance of date
|
|
40
|
+
*/
|
|
41
|
+
get value() {
|
|
42
|
+
return this._value;
|
|
43
|
+
}
|
|
44
|
+
//######################### public methods - implementation of DateApiObject #########################
|
|
45
|
+
/**
|
|
46
|
+
* Gets indication whether provided instance of date is valid
|
|
47
|
+
*/
|
|
48
|
+
isValid() {
|
|
49
|
+
return isValid(this._value);
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Gets indication whether provided instance of date is weekend day
|
|
53
|
+
*/
|
|
54
|
+
isWeekend() {
|
|
55
|
+
return isWeekend(this._value);
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Formats date value
|
|
59
|
+
* @param formatString - Format token used for creating formatted string
|
|
60
|
+
*/
|
|
61
|
+
format(formatString) {
|
|
62
|
+
return format(this._value, formatString, { locale: this._localeSvc.locale });
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Updates value to start date and time of current decade
|
|
66
|
+
* @returns Itself for fluent API
|
|
67
|
+
*/
|
|
68
|
+
startOfDecade() {
|
|
69
|
+
this._value = startOfDecade(this._value);
|
|
70
|
+
return this;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Updates value to end date and time of current decade
|
|
74
|
+
* @returns Itself for fluent API
|
|
75
|
+
*/
|
|
76
|
+
endOfDecade() {
|
|
77
|
+
this._value = endOfDecade(this._value);
|
|
78
|
+
return this;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Updates value to start date and time of current year
|
|
82
|
+
* @returns Itself for fluent API
|
|
83
|
+
*/
|
|
84
|
+
startOfYear() {
|
|
85
|
+
this._value = startOfYear(this._value);
|
|
86
|
+
return this;
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Updates value to end date and time of current year
|
|
90
|
+
* @returns Itself for fluent API
|
|
91
|
+
*/
|
|
92
|
+
endOfYear() {
|
|
93
|
+
this._value = endOfYear(this._value);
|
|
94
|
+
return this;
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Add years, if count not specified adds 1 year
|
|
98
|
+
* @param count - Number of years count
|
|
99
|
+
* @returns Itself for fluent API
|
|
100
|
+
*/
|
|
101
|
+
addYears(count) {
|
|
102
|
+
this._value = addYears(this._value, count !== null && count !== void 0 ? count : 1);
|
|
103
|
+
return this;
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Subtract years, if count not specified subtract 1 year
|
|
107
|
+
* @param count - Number of years count
|
|
108
|
+
* @returns Itself for fluent API
|
|
109
|
+
*/
|
|
110
|
+
subtractYears(count) {
|
|
111
|
+
this._value = subYears(this._value, count !== null && count !== void 0 ? count : 1);
|
|
112
|
+
return this;
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Updates value to start date and time of current month
|
|
116
|
+
* @returns Itself for fluent API
|
|
117
|
+
*/
|
|
118
|
+
startOfMonth() {
|
|
119
|
+
this._value = startOfMonth(this._value);
|
|
120
|
+
return this;
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Updates value to end date and time of current month
|
|
124
|
+
* @returns Itself for fluent API
|
|
125
|
+
*/
|
|
126
|
+
endOfMonth() {
|
|
127
|
+
this._value = endOfMonth(this._value);
|
|
128
|
+
return this;
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Add months, if count not specified adds 1 month
|
|
132
|
+
* @param count - Number of months count
|
|
133
|
+
* @returns Itself for fluent API
|
|
134
|
+
*/
|
|
135
|
+
addMonths(count) {
|
|
136
|
+
this._value = addMonths(this._value, count !== null && count !== void 0 ? count : 1);
|
|
137
|
+
return this;
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* Subtract months, if count not specified subtract 1 month
|
|
141
|
+
* @param count - Number of months count
|
|
142
|
+
* @returns Itself for fluent API
|
|
143
|
+
*/
|
|
144
|
+
subtractMonths(count) {
|
|
145
|
+
this._value = subMonths(this._value, count !== null && count !== void 0 ? count : 1);
|
|
146
|
+
return this;
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* Updates value to start date and time of current week
|
|
150
|
+
* @returns Itself for fluent API
|
|
151
|
+
*/
|
|
152
|
+
startOfWeek() {
|
|
153
|
+
this._value = startOfWeek(this._value, { locale: this._localeSvc.locale });
|
|
154
|
+
return this;
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* Updates value to end date and time of current week
|
|
158
|
+
* @returns Itself for fluent API
|
|
159
|
+
*/
|
|
160
|
+
endOfWeek() {
|
|
161
|
+
this._value = endOfWeek(this._value, { locale: this._localeSvc.locale });
|
|
162
|
+
return this;
|
|
163
|
+
}
|
|
164
|
+
/**
|
|
165
|
+
* Add weeks, if count not specified adds 1 week
|
|
166
|
+
* @param count - Number of weeks count
|
|
167
|
+
* @returns Itself for fluent API
|
|
168
|
+
*/
|
|
169
|
+
addWeeks(count) {
|
|
170
|
+
this._value = addWeeks(this._value, count !== null && count !== void 0 ? count : 1);
|
|
171
|
+
return this;
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* Subtract weeks, if count not specified subtract 1 week
|
|
175
|
+
* @param count - Number of weeks count
|
|
176
|
+
* @returns Itself for fluent API
|
|
177
|
+
*/
|
|
178
|
+
subtractWeeks(count) {
|
|
179
|
+
this._value = subWeeks(this._value, count !== null && count !== void 0 ? count : 1);
|
|
180
|
+
return this;
|
|
181
|
+
}
|
|
182
|
+
/**
|
|
183
|
+
* Updates value to start date and time of current day
|
|
184
|
+
* @returns Itself for fluent API
|
|
185
|
+
*/
|
|
186
|
+
startOfDay() {
|
|
187
|
+
this._value = startOfDay(this._value);
|
|
188
|
+
return this;
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* Updates value to end date and time of current day
|
|
192
|
+
* @returns Itself for fluent API
|
|
193
|
+
*/
|
|
194
|
+
endOfDay() {
|
|
195
|
+
this._value = endOfDay(this._value);
|
|
196
|
+
return this;
|
|
197
|
+
}
|
|
198
|
+
/**
|
|
199
|
+
* Add days, if count not specified adds 1 day
|
|
200
|
+
* @param count - Number of days count
|
|
201
|
+
* @returns Itself for fluent API
|
|
202
|
+
*/
|
|
203
|
+
addDays(count) {
|
|
204
|
+
this._value = addDays(this._value, count !== null && count !== void 0 ? count : 1);
|
|
205
|
+
return this;
|
|
206
|
+
}
|
|
207
|
+
/**
|
|
208
|
+
* Subtract days, if count not specified subtract 1 day
|
|
209
|
+
* @param count - Number of days count
|
|
210
|
+
* @returns Itself for fluent API
|
|
211
|
+
*/
|
|
212
|
+
subtractDays(count) {
|
|
213
|
+
this._value = subDays(this._value, count !== null && count !== void 0 ? count : 1);
|
|
214
|
+
return this;
|
|
215
|
+
}
|
|
216
|
+
/**
|
|
217
|
+
* Gets number of days in month
|
|
218
|
+
*/
|
|
219
|
+
daysInMonth() {
|
|
220
|
+
return getDaysInMonth(this._value);
|
|
221
|
+
}
|
|
222
|
+
/**
|
|
223
|
+
* Gets or sets year
|
|
224
|
+
* @param year - If specified, sets year
|
|
225
|
+
*/
|
|
226
|
+
year(year) {
|
|
227
|
+
if (isPresent(year)) {
|
|
228
|
+
this._value = setYear(this._value, year);
|
|
229
|
+
return this;
|
|
230
|
+
}
|
|
231
|
+
return getYear(this._value);
|
|
232
|
+
}
|
|
233
|
+
/**
|
|
234
|
+
* Gets or sets month
|
|
235
|
+
* @param month - If specified, sets month
|
|
236
|
+
*/
|
|
237
|
+
month(month) {
|
|
238
|
+
if (isPresent(month)) {
|
|
239
|
+
this._value = setMonth(this._value, month);
|
|
240
|
+
return this;
|
|
241
|
+
}
|
|
242
|
+
return getMonth(this._value);
|
|
243
|
+
}
|
|
244
|
+
/**
|
|
245
|
+
* Gets or sets day of month one based
|
|
246
|
+
* @param day - If specified, sets day of month
|
|
247
|
+
*/
|
|
248
|
+
dayOfMonth(day) {
|
|
249
|
+
if (isPresent(day)) {
|
|
250
|
+
this._value = setDate(this._value, day);
|
|
251
|
+
return this;
|
|
252
|
+
}
|
|
253
|
+
return getDate(this._value);
|
|
254
|
+
}
|
|
255
|
+
/**
|
|
256
|
+
* Gets or sets day of week zero based, first is monday
|
|
257
|
+
* @param day - If specified, sets day of week
|
|
258
|
+
*/
|
|
259
|
+
dayOfWeek(day) {
|
|
260
|
+
if (isPresent(day)) {
|
|
261
|
+
this._value = setISODay(this._value, day + 1);
|
|
262
|
+
return this;
|
|
263
|
+
}
|
|
264
|
+
return getISODay(this._value) - 1;
|
|
265
|
+
}
|
|
266
|
+
/**
|
|
267
|
+
* Gets indication whether current value is before 'date'
|
|
268
|
+
* @param date - Date which is this date compared to
|
|
269
|
+
*/
|
|
270
|
+
isBefore(date) {
|
|
271
|
+
return isBefore(this._value, date);
|
|
272
|
+
}
|
|
273
|
+
/**
|
|
274
|
+
* Gets indication whether current value is after 'date'
|
|
275
|
+
* @param date - Date which is this date compared to
|
|
276
|
+
*/
|
|
277
|
+
isAfter(date) {
|
|
278
|
+
return isAfter(this._value, date);
|
|
279
|
+
}
|
|
280
|
+
/**
|
|
281
|
+
* Gets number of days between this and provided date
|
|
282
|
+
* @param date - Date which is used for computation of diff against
|
|
283
|
+
*/
|
|
284
|
+
diffDays(date) {
|
|
285
|
+
return differenceInCalendarDays(this._value, date);
|
|
286
|
+
}
|
|
287
|
+
/**
|
|
288
|
+
* Compares whether this date is same week as provided date
|
|
289
|
+
* @param date - Date which is used for comparison of same week
|
|
290
|
+
*/
|
|
291
|
+
isSameWeek(date) {
|
|
292
|
+
return isSameWeek(this._value, date, { locale: this._localeSvc.locale });
|
|
293
|
+
}
|
|
294
|
+
/**
|
|
295
|
+
* Compares whether this date is same decade as provided date
|
|
296
|
+
* @param date - Date which is used for comparison of same decade
|
|
297
|
+
*/
|
|
298
|
+
isSameDecade(date) {
|
|
299
|
+
const year = getYear(this._value);
|
|
300
|
+
const start = year - (year % 10);
|
|
301
|
+
const end = start + 10;
|
|
302
|
+
return getYear(date) >= start && getYear(date) < end;
|
|
303
|
+
}
|
|
304
|
+
/**
|
|
305
|
+
* Compares whether this date is same year as provided date
|
|
306
|
+
* @param date - Date which is used for comparison of same year
|
|
307
|
+
*/
|
|
308
|
+
isSameYear(date) {
|
|
309
|
+
return isSameYear(this._value, date);
|
|
310
|
+
}
|
|
311
|
+
/**
|
|
312
|
+
* Compares whether this date is same month as provided date
|
|
313
|
+
* @param date - Date which is used for comparison of same month
|
|
314
|
+
*/
|
|
315
|
+
isSameMonth(date) {
|
|
316
|
+
return isSameMonth(this._value, date);
|
|
317
|
+
}
|
|
318
|
+
/**
|
|
319
|
+
* Compares whether this date is same day as provided date
|
|
320
|
+
* @param date - Date which is used for comparison of same day
|
|
321
|
+
*/
|
|
322
|
+
isSameDay(date) {
|
|
323
|
+
return isSameDay(this._value, date);
|
|
324
|
+
}
|
|
325
|
+
/**
|
|
326
|
+
* Creates clone of this instance, value and originalValue have same value and are cloned from value
|
|
327
|
+
*/
|
|
328
|
+
clone() {
|
|
329
|
+
return new DateFnsDateApiObject(new Date(this._value), this._localeSvc);
|
|
330
|
+
}
|
|
331
|
+
/**
|
|
332
|
+
* Creates clone of this instance, value and originalValue have same value and are cloned from originalValue
|
|
333
|
+
*/
|
|
334
|
+
cloneOriginal() {
|
|
335
|
+
return new DateFnsDateApiObject(new Date(this._originalValue), this._localeSvc);
|
|
336
|
+
}
|
|
337
|
+
/**
|
|
338
|
+
* Updates originalValue, if value is not provided originalValue is set to value
|
|
339
|
+
* @param value - Value to be set as original, or null (value will be used as value)
|
|
340
|
+
* @returns Itself for fluent API
|
|
341
|
+
*/
|
|
342
|
+
updateOriginal(value) {
|
|
343
|
+
if (isBlank(value)) {
|
|
344
|
+
this._originalValue = this._value;
|
|
345
|
+
}
|
|
346
|
+
else {
|
|
347
|
+
this._value = this._originalValue = value;
|
|
348
|
+
}
|
|
349
|
+
return this;
|
|
350
|
+
}
|
|
351
|
+
/**
|
|
352
|
+
* Changes value to same value as originalValue
|
|
353
|
+
* @returns Itself for fluent API
|
|
354
|
+
*/
|
|
355
|
+
resetOriginal() {
|
|
356
|
+
this._value = this._originalValue;
|
|
357
|
+
return this;
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
/**
|
|
361
|
+
* Date api using DateFnsJS, used for obtaining DateApi wrapper object
|
|
362
|
+
*/
|
|
363
|
+
export class DateFnsDateApi {
|
|
364
|
+
//######################### constructor #########################
|
|
365
|
+
constructor(_localeSvc, _relativeParser) {
|
|
366
|
+
this._localeSvc = _localeSvc;
|
|
367
|
+
this._relativeParser = _relativeParser;
|
|
368
|
+
}
|
|
369
|
+
//######################### public methods - implementation of DateApi #########################
|
|
370
|
+
/**
|
|
371
|
+
* Gets wrapping object used for manipulation
|
|
372
|
+
* @param value - Value to be converted (parsed) and used for manipulation
|
|
373
|
+
* @param format - Format string used for parsing string value
|
|
374
|
+
*/
|
|
375
|
+
getValue(value, format) {
|
|
376
|
+
return new DateFnsDateApiObject(this._relativeParser.parse(value), this._localeSvc, format);
|
|
377
|
+
}
|
|
378
|
+
/**
|
|
379
|
+
* Gets wrapping object used for manipulation instantiated to current date and time
|
|
380
|
+
*/
|
|
381
|
+
now() {
|
|
382
|
+
return new DateFnsDateApiObject(new Date(), this._localeSvc);
|
|
383
|
+
}
|
|
384
|
+
/**
|
|
385
|
+
* Gets format string using pseudo format
|
|
386
|
+
* @param pseudoFormat - Pseudo format token, used for obtaining 'date' or 'time' format string
|
|
387
|
+
*/
|
|
388
|
+
getFormat(pseudoFormat) {
|
|
389
|
+
if (/^p+$/i.test(pseudoFormat)) {
|
|
390
|
+
const widths = {
|
|
391
|
+
1: 'short',
|
|
392
|
+
2: 'medium',
|
|
393
|
+
3: 'long',
|
|
394
|
+
4: 'full'
|
|
395
|
+
};
|
|
396
|
+
//date time format
|
|
397
|
+
if (pseudoFormat.indexOf('Pp') >= 0 && pseudoFormat.length <= 8) {
|
|
398
|
+
return this._localeSvc.locale.formatLong.dateTime({ width: widths[pseudoFormat.length / 2] });
|
|
399
|
+
}
|
|
400
|
+
//date format
|
|
401
|
+
else if (pseudoFormat.indexOf('P') >= 0 && pseudoFormat.length <= 4) {
|
|
402
|
+
return this._localeSvc.locale.formatLong.date({ width: widths[pseudoFormat.length] });
|
|
403
|
+
}
|
|
404
|
+
//time format
|
|
405
|
+
else if (pseudoFormat.indexOf('p') >= 0 && pseudoFormat.length <= 4) {
|
|
406
|
+
return this._localeSvc.locale.formatLong.time({ width: widths[pseudoFormat.length] });
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
return pseudoFormat;
|
|
410
|
+
}
|
|
411
|
+
/**
|
|
412
|
+
* Gets information
|
|
413
|
+
*/
|
|
414
|
+
weekStartsOnMonday() {
|
|
415
|
+
var _a;
|
|
416
|
+
return ((_a = this._localeSvc.locale.options) === null || _a === void 0 ? void 0 : _a.weekStartsOn) === 1;
|
|
417
|
+
}
|
|
418
|
+
/**
|
|
419
|
+
* Gets array of weekday names in short format, order of days is dependent on locale
|
|
420
|
+
*/
|
|
421
|
+
weekdaysShort() {
|
|
422
|
+
let startIndex = this._localeSvc.locale.options.weekStartsOn;
|
|
423
|
+
const weekdays = [];
|
|
424
|
+
for (let x = 0; x < 7; x++) {
|
|
425
|
+
weekdays.push(this._localeSvc.locale.localize.day(startIndex++ % 7, { width: 'short' }));
|
|
426
|
+
}
|
|
427
|
+
return weekdays;
|
|
428
|
+
}
|
|
429
|
+
}
|
|
430
|
+
DateFnsDateApi.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: DateFnsDateApi, deps: [{ token: DATE_FNS_LOCALE }, { token: i1.DateTimeRelativeParser }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
431
|
+
DateFnsDateApi.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: DateFnsDateApi });
|
|
432
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: DateFnsDateApi, decorators: [{
|
|
433
|
+
type: Injectable
|
|
434
|
+
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|
|
435
|
+
type: Inject,
|
|
436
|
+
args: [DATE_FNS_LOCALE]
|
|
437
|
+
}] }, { type: i1.DateTimeRelativeParser }]; } });
|
|
438
|
+
//# sourceMappingURL=dateFnsDateApi.service.js.map
|