@anglr/datetime 6.1.0 → 7.0.0-beta.20230817095054
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 +40 -9
- package/date-fns/package.json +3 -4
- package/{es2020 → es2022}/date-fns/src/services/dateFnsDateApi.service.js +31 -17
- package/es2022/date-fns/src/services/dateFnsDateApi.service.js.map +1 -0
- package/{es2020 → es2022}/moment/src/services/momentDateApi.service.js +20 -8
- package/es2022/moment/src/services/momentDateApi.service.js.map +1 -0
- package/{es2015/src/modules/dateTime/directives/dateTimeInput/dateTimeInput.directive.js → es2022/src/directives/buttonDateTimeInput/buttonDateTimeInput.directive.js} +56 -73
- package/es2022/src/directives/buttonDateTimeInput/buttonDateTimeInput.directive.js.map +1 -0
- package/{es2015 → es2022}/src/directives/datePickerInput/datePickerInput.directive.js +5 -4
- package/es2022/src/directives/datePickerInput/datePickerInput.directive.js.map +1 -0
- package/{es2020 → es2022}/src/directives/dateTimeInputHandler/dateTimeInputHandler.directive.js +29 -18
- package/{es2015 → es2022}/src/directives/dateTimeInputHandler/dateTimeInputHandler.directive.js.map +1 -1
- package/{es2020 → es2022}/src/directives/dateTimePickerInput/dateTimePickerInput.directive.js +5 -4
- package/es2022/src/directives/dateTimePickerInput/dateTimePickerInput.directive.js.map +1 -0
- package/{es2020 → es2022}/src/directives/simpleDatePickerInput/simpleDatePickerInput.directive.js +5 -4
- package/es2022/src/directives/simpleDatePickerInput/simpleDatePickerInput.directive.js.map +1 -0
- package/{es2020 → es2022}/src/directives/simpleDateTimeInputHandler/simpleDateTimeInputHandler.directive.js +9 -4
- package/es2022/src/directives/simpleDateTimeInputHandler/simpleDateTimeInputHandler.directive.js.map +1 -0
- package/{es2020 → es2022}/src/directives/simpleDateTimePickerInput/simpleDateTimePickerInput.directive.js +5 -4
- package/es2022/src/directives/simpleDateTimePickerInput/simpleDateTimePickerInput.directive.js.map +1 -0
- package/{es2020 → es2022}/src/directives/withNow/withNow.directive.js +10 -9
- package/es2022/src/directives/withNow/withNow.directive.js.map +1 -0
- package/{es2015 → es2022}/src/directives/withTime/withTime.directive.js +5 -4
- package/es2022/src/directives/withTime/withTime.directive.js.map +1 -0
- package/{es2020 → es2022}/src/directives/withToday/withToday.directive.js +10 -9
- package/es2022/src/directives/withToday/withToday.directive.js.map +1 -0
- package/{es2020 → es2022}/src/misc/validators.js +2 -2
- package/es2022/src/misc/validators.js.map +1 -0
- package/{es2020 → es2022}/src/modules/calendar/components/monthCalendar/monthCalendar.component.js +65 -39
- package/es2022/src/modules/calendar/components/monthCalendar/monthCalendar.component.js.map +1 -0
- package/{es2020 → es2022}/src/modules/calendar/directives/calendarDayTemplate/calendarDayTemplate.directive.js +6 -4
- package/es2022/src/modules/calendar/directives/calendarDayTemplate/calendarDayTemplate.directive.js.map +1 -0
- package/{es2015 → es2022}/src/modules/calendar/modules/monthCalendar.module.js +8 -7
- package/es2022/src/modules/calendar/modules/monthCalendar.module.js.map +1 -0
- package/{es2020 → es2022}/src/modules/calendar/services/eventParser/eventParser.service.js +6 -4
- package/es2022/src/modules/calendar/services/eventParser/eventParser.service.js.map +1 -0
- package/es2022/src/modules/datePipes.module.js +29 -0
- package/es2022/src/modules/datePipes.module.js.map +1 -0
- package/{es2020 → es2022}/src/modules/dateTime/directives/dateTime/dateTime.directive.js +69 -41
- package/es2022/src/modules/dateTime/directives/dateTime/dateTime.directive.js.map +1 -0
- package/{es2015 → es2022}/src/modules/dateTime/directives/dateTimeBase.js +27 -22
- package/es2022/src/modules/dateTime/directives/dateTimeBase.js.map +1 -0
- package/{es2020 → es2022}/src/modules/dateTime/directives/dateTimeControlValueAccessor/dateTimeControlValueAccessor.directive.js +17 -15
- package/es2022/src/modules/dateTime/directives/dateTimeControlValueAccessor/dateTimeControlValueAccessor.directive.js.map +1 -0
- package/{es2020 → es2022}/src/modules/dateTime/directives/dateTimeInput/dateTimeInput.directive.js +36 -27
- package/es2022/src/modules/dateTime/directives/dateTimeInput/dateTimeInput.directive.js.map +1 -0
- package/{es2015 → es2022}/src/modules/dateTime/directives/dateTimeMaxValidator/dateTimeMaxValidator.directive.js +17 -15
- package/es2022/src/modules/dateTime/directives/dateTimeMaxValidator/dateTimeMaxValidator.directive.js.map +1 -0
- package/{es2020 → es2022}/src/modules/dateTime/directives/dateTimeMinValidator/dateTimeMinValidator.directive.js +17 -15
- package/es2022/src/modules/dateTime/directives/dateTimeMinValidator/dateTimeMinValidator.directive.js.map +1 -0
- package/{es2020 → es2022}/src/modules/dateTime/directives/dateTimeValidator/dateTimeValidator.directive.js +17 -15
- package/es2022/src/modules/dateTime/directives/dateTimeValidator/dateTimeValidator.directive.js.map +1 -0
- package/{es2015 → es2022}/src/modules/dateTime/modules/dateTime.module.js +16 -15
- package/es2022/src/modules/dateTime/modules/dateTime.module.js.map +1 -0
- package/{es2020 → es2022}/src/modules/dateTimePicker/components/dateTimePeriodPickerBase.js +58 -39
- package/es2022/src/modules/dateTimePicker/components/dateTimePeriodPickerBase.js.map +1 -0
- package/{es2020 → es2022}/src/modules/dateTimePicker/components/dateTimePicker/dateTimePicker.component.js +61 -24
- package/es2022/src/modules/dateTimePicker/components/dateTimePicker/dateTimePicker.component.js.map +1 -0
- package/{es2020 → es2022}/src/modules/dateTimePicker/components/dayPicker/dayPicker.component.js +15 -14
- package/es2022/src/modules/dateTimePicker/components/dayPicker/dayPicker.component.js.map +1 -0
- package/{es2020 → es2022}/src/modules/dateTimePicker/components/monthPicker/monthPicker.component.js +6 -4
- package/es2022/src/modules/dateTimePicker/components/monthPicker/monthPicker.component.js.map +1 -0
- package/{es2020 → es2022}/src/modules/dateTimePicker/components/rollerTimePicker/rollerTimePicker.component.js +24 -27
- package/es2022/src/modules/dateTimePicker/components/rollerTimePicker/rollerTimePicker.component.js.map +1 -0
- package/{es2020 → es2022}/src/modules/dateTimePicker/components/yearPicker/yearPicker.component.js +10 -12
- package/es2022/src/modules/dateTimePicker/components/yearPicker/yearPicker.component.js.map +1 -0
- package/{es2020 → es2022}/src/modules/dateTimePicker/directives/dateTimePicker/dateTimePicker.directive.js +52 -21
- package/es2022/src/modules/dateTimePicker/directives/dateTimePicker/dateTimePicker.directive.js.map +1 -0
- package/{es2020 → es2022}/src/modules/dateTimePicker/directives/dateTimePicker/dateTimePicker.interface.js.map +1 -1
- package/{es2020 → es2022}/src/modules/dateTimePicker/directives/loopScroll/loopScroll.directive.js +57 -41
- package/es2022/src/modules/dateTimePicker/directives/loopScroll/loopScroll.directive.js.map +1 -0
- package/es2022/src/modules/dateTimePicker/directives/loopScrollData/loopScrollData.directive.js +37 -0
- package/es2022/src/modules/dateTimePicker/directives/loopScrollData/loopScrollData.directive.js.map +1 -0
- package/{es2015 → es2022}/src/modules/dateTimePicker/modules/dateTimePicker.module.js +7 -6
- package/es2022/src/modules/dateTimePicker/modules/dateTimePicker.module.js.map +1 -0
- package/{es2015 → es2022}/src/pipes/dateConvert.pipe.js +6 -4
- package/es2022/src/pipes/dateConvert.pipe.js.map +1 -0
- package/{es2015 → es2022}/src/pipes/dateFormat.pipe.js +7 -4
- package/es2022/src/pipes/dateFormat.pipe.js.map +1 -0
- package/{es2020 → es2022}/src/services/datePositionParser/datePositionParser.service.js +19 -17
- package/es2022/src/services/datePositionParser/datePositionParser.service.js.map +1 -0
- package/{es2020 → es2022}/src/services/dateTimeRelativeParser/dateTimeRelativeParser.service.js +11 -4
- package/es2022/src/services/dateTimeRelativeParser/dateTimeRelativeParser.service.js.map +1 -0
- package/{es2020 → es2022}/src/services/dateValueProvider/dateValueProvider.service.js +6 -4
- package/es2022/src/services/dateValueProvider/dateValueProvider.service.js.map +1 -0
- package/moment/package.json +3 -4
- package/package.json +50 -58
- package/src/directives/buttonDateTimeInput/buttonDateTimeInput.directive.d.ts +67 -0
- package/src/directives/buttonDateTimeInput/buttonDateTimeInput.directive.d.ts.map +1 -0
- package/src/misc/types.d.ts +2 -2
- package/src/misc/types.d.ts.map +1 -1
- package/src/modules/calendar/components/monthCalendar/monthCalendar.component.d.ts +1 -1
- package/src/modules/dateTime/directives/dateTime/dateTime.directive.d.ts +1 -1
- package/src/modules/dateTimePicker/components/dateTimePicker/dateTimePicker.component.d.ts +1 -1
- package/src/modules/dateTimePicker/directives/dateTimePicker/dateTimePicker.directive.d.ts +1 -1
- package/src/modules/dateTimePicker/directives/dateTimePicker/dateTimePicker.directive.d.ts.map +1 -1
- package/src/modules/dateTimePicker/directives/dateTimePicker/dateTimePicker.interface.d.ts +6 -0
- package/src/modules/dateTimePicker/directives/dateTimePicker/dateTimePicker.interface.d.ts.map +1 -1
- package/src/modules/dateTimePicker/directives/loopScroll/loopScroll.directive.d.ts +1 -1
- package/src/modules/dateTimePicker/directives/loopScrollData/loopScrollData.directive.d.ts +1 -1
- package/src/services/dateApi/dateApi.interface.d.ts +2 -2
- package/src/services/dateApi/dateApi.interface.d.ts.map +1 -1
- package/version.bak +1 -1
- package/es2015/date-fns/src/services/dateFnsDateApi.service.js +0 -590
- package/es2015/date-fns/src/services/dateFnsDateApi.service.js.map +0 -1
- package/es2015/moment/src/services/momentDateApi.service.js +0 -547
- package/es2015/moment/src/services/momentDateApi.service.js.map +0 -1
- package/es2015/src/directives/datePickerInput/datePickerInput.directive.js.map +0 -1
- package/es2015/src/directives/dateTimeInputHandler/dateTimeInputHandler.directive.js +0 -325
- package/es2015/src/directives/dateTimePickerInput/dateTimePickerInput.directive.js +0 -29
- package/es2015/src/directives/dateTimePickerInput/dateTimePickerInput.directive.js.map +0 -1
- package/es2015/src/directives/simpleDatePickerInput/simpleDatePickerInput.directive.js +0 -37
- package/es2015/src/directives/simpleDatePickerInput/simpleDatePickerInput.directive.js.map +0 -1
- package/es2015/src/directives/simpleDateTimeInputHandler/simpleDateTimeInputHandler.directive.js +0 -137
- package/es2015/src/directives/simpleDateTimeInputHandler/simpleDateTimeInputHandler.directive.js.map +0 -1
- package/es2015/src/directives/simpleDateTimePickerInput/simpleDateTimePickerInput.directive.js +0 -29
- package/es2015/src/directives/simpleDateTimePickerInput/simpleDateTimePickerInput.directive.js.map +0 -1
- package/es2015/src/directives/withNow/withNow.directive.js +0 -44
- package/es2015/src/directives/withNow/withNow.directive.js.map +0 -1
- package/es2015/src/directives/withTime/withTime.directive.js.map +0 -1
- package/es2015/src/directives/withToday/withToday.directive.js +0 -44
- package/es2015/src/directives/withToday/withToday.directive.js.map +0 -1
- package/es2015/src/misc/utils.js +0 -164
- package/es2015/src/misc/utils.js.map +0 -1
- package/es2015/src/misc/validators.js +0 -142
- package/es2015/src/misc/validators.js.map +0 -1
- package/es2015/src/modules/calendar/components/monthCalendar/monthCalendar.component.js +0 -198
- package/es2015/src/modules/calendar/components/monthCalendar/monthCalendar.component.js.map +0 -1
- package/es2015/src/modules/calendar/directives/calendarDayTemplate/calendarDayTemplate.directive.js +0 -27
- package/es2015/src/modules/calendar/directives/calendarDayTemplate/calendarDayTemplate.directive.js.map +0 -1
- package/es2015/src/modules/calendar/modules/monthCalendar.module.js.map +0 -1
- package/es2015/src/modules/calendar/services/eventParser/eventParser.service.js +0 -75
- package/es2015/src/modules/calendar/services/eventParser/eventParser.service.js.map +0 -1
- package/es2015/src/modules/datePipes.module.js +0 -28
- package/es2015/src/modules/datePipes.module.js.map +0 -1
- package/es2015/src/modules/dateTime/directives/dateTime/dateTime.directive.js +0 -254
- package/es2015/src/modules/dateTime/directives/dateTime/dateTime.directive.js.map +0 -1
- package/es2015/src/modules/dateTime/directives/dateTimeBase.js.map +0 -1
- package/es2015/src/modules/dateTime/directives/dateTimeControlValueAccessor/dateTimeControlValueAccessor.directive.js +0 -77
- package/es2015/src/modules/dateTime/directives/dateTimeControlValueAccessor/dateTimeControlValueAccessor.directive.js.map +0 -1
- package/es2015/src/modules/dateTime/directives/dateTimeInput/dateTimeInput.directive.js.map +0 -1
- package/es2015/src/modules/dateTime/directives/dateTimeMaxValidator/dateTimeMaxValidator.directive.js.map +0 -1
- package/es2015/src/modules/dateTime/directives/dateTimeMinValidator/dateTimeMinValidator.directive.js +0 -70
- package/es2015/src/modules/dateTime/directives/dateTimeMinValidator/dateTimeMinValidator.directive.js.map +0 -1
- package/es2015/src/modules/dateTime/directives/dateTimeValidator/dateTimeValidator.directive.js +0 -63
- package/es2015/src/modules/dateTime/directives/dateTimeValidator/dateTimeValidator.directive.js.map +0 -1
- package/es2015/src/modules/dateTime/modules/dateTime.module.js.map +0 -1
- package/es2015/src/modules/dateTimePicker/components/dateTimePeriodPickerBase.js +0 -186
- package/es2015/src/modules/dateTimePicker/components/dateTimePeriodPickerBase.js.map +0 -1
- package/es2015/src/modules/dateTimePicker/components/dateTimePicker/dateTimePicker.component.js +0 -299
- package/es2015/src/modules/dateTimePicker/components/dateTimePicker/dateTimePicker.component.js.map +0 -1
- package/es2015/src/modules/dateTimePicker/components/dayPicker/dayPicker.component.js +0 -151
- package/es2015/src/modules/dateTimePicker/components/dayPicker/dayPicker.component.js.map +0 -1
- package/es2015/src/modules/dateTimePicker/components/monthPicker/monthPicker.component.js +0 -123
- package/es2015/src/modules/dateTimePicker/components/monthPicker/monthPicker.component.js.map +0 -1
- package/es2015/src/modules/dateTimePicker/components/rollerTimePicker/rollerTimePicker.component.js +0 -137
- package/es2015/src/modules/dateTimePicker/components/rollerTimePicker/rollerTimePicker.component.js.map +0 -1
- package/es2015/src/modules/dateTimePicker/components/yearPicker/yearPicker.component.js +0 -126
- package/es2015/src/modules/dateTimePicker/components/yearPicker/yearPicker.component.js.map +0 -1
- package/es2015/src/modules/dateTimePicker/directives/dateTimePicker/dateTimePicker.directive.js +0 -261
- package/es2015/src/modules/dateTimePicker/directives/dateTimePicker/dateTimePicker.directive.js.map +0 -1
- package/es2015/src/modules/dateTimePicker/directives/dateTimePicker/dateTimePicker.interface.js.map +0 -1
- package/es2015/src/modules/dateTimePicker/directives/loopScroll/loopScroll.directive.js +0 -222
- package/es2015/src/modules/dateTimePicker/directives/loopScroll/loopScroll.directive.js.map +0 -1
- package/es2015/src/modules/dateTimePicker/directives/loopScrollData/loopScrollData.directive.js +0 -30
- package/es2015/src/modules/dateTimePicker/directives/loopScrollData/loopScrollData.directive.js.map +0 -1
- package/es2015/src/modules/dateTimePicker/modules/dateTimePicker.module.js.map +0 -1
- package/es2015/src/pipes/dateConvert.pipe.js.map +0 -1
- package/es2015/src/pipes/dateFormat.pipe.js.map +0 -1
- package/es2015/src/services/datePositionParser/datePositionParser.service.js +0 -243
- package/es2015/src/services/datePositionParser/datePositionParser.service.js.map +0 -1
- package/es2015/src/services/dateTimeRelativeParser/dateTimeRelativeParser.service.js +0 -81
- package/es2015/src/services/dateTimeRelativeParser/dateTimeRelativeParser.service.js.map +0 -1
- package/es2015/src/services/dateValueProvider/dateValueProvider.service.js +0 -69
- package/es2015/src/services/dateValueProvider/dateValueProvider.service.js.map +0 -1
- package/es2020/date-fns/src/index.js +0 -4
- package/es2020/date-fns/src/index.js.map +0 -1
- package/es2020/date-fns/src/misc/tokens.js +0 -31
- package/es2020/date-fns/src/misc/tokens.js.map +0 -1
- package/es2020/date-fns/src/services/dateFnsDateApi.service.js.map +0 -1
- package/es2020/date-fns/src/services/dateFnsLocale.service.js +0 -2
- package/es2020/date-fns/src/services/dateFnsLocale.service.js.map +0 -1
- package/es2020/moment/src/index.js +0 -3
- package/es2020/moment/src/index.js.map +0 -1
- package/es2020/moment/src/misc/tokens.js +0 -26
- package/es2020/moment/src/misc/tokens.js.map +0 -1
- package/es2020/moment/src/services/momentDateApi.service.js.map +0 -1
- package/es2020/src/directives/datePickerInput/datePickerInput.directive.js +0 -37
- package/es2020/src/directives/datePickerInput/datePickerInput.directive.js.map +0 -1
- package/es2020/src/directives/dateTimeInputHandler/dateTimeInputHandler.directive.js.map +0 -1
- package/es2020/src/directives/dateTimePickerInput/dateTimePickerInput.directive.js.map +0 -1
- package/es2020/src/directives/index.js +0 -10
- package/es2020/src/directives/index.js.map +0 -1
- package/es2020/src/directives/simpleDatePickerInput/simpleDatePickerInput.directive.js.map +0 -1
- package/es2020/src/directives/simpleDateTimeInputHandler/simpleDateTimeInputHandler.directive.js.map +0 -1
- package/es2020/src/directives/simpleDateTimePickerInput/simpleDateTimePickerInput.directive.js.map +0 -1
- package/es2020/src/directives/withNow/withNow.directive.js.map +0 -1
- package/es2020/src/directives/withTime/withTime.directive.js +0 -32
- package/es2020/src/directives/withTime/withTime.directive.js.map +0 -1
- package/es2020/src/directives/withToday/withToday.directive.js.map +0 -1
- package/es2020/src/index.js +0 -13
- package/es2020/src/index.js.map +0 -1
- package/es2020/src/interfaces/dateTime/datetime.interface.js +0 -2
- package/es2020/src/interfaces/dateTime/datetime.interface.js.map +0 -1
- package/es2020/src/interfaces/dateTimeInput/dateTimeInput.interface.js +0 -2
- package/es2020/src/interfaces/dateTimeInput/dateTimeInput.interface.js.map +0 -1
- package/es2020/src/interfaces/formatProvider/formatProvider.interface.js +0 -2
- package/es2020/src/interfaces/formatProvider/formatProvider.interface.js.map +0 -1
- package/es2020/src/interfaces/index.js +0 -4
- package/es2020/src/interfaces/index.js.map +0 -1
- package/es2020/src/legacy/picker/components/picker/picker.component.animations.js +0 -94
- package/es2020/src/legacy/picker/components/picker/picker.component.animations.js.map +0 -1
- package/es2020/src/misc/constants.js +0 -33
- package/es2020/src/misc/constants.js.map +0 -1
- package/es2020/src/misc/enums.js +0 -23
- package/es2020/src/misc/enums.js.map +0 -1
- package/es2020/src/misc/tokens.js +0 -38
- package/es2020/src/misc/tokens.js.map +0 -1
- package/es2020/src/misc/types.js +0 -2
- package/es2020/src/misc/types.js.map +0 -1
- package/es2020/src/misc/validators.js.map +0 -1
- package/es2020/src/modules/calendar/components/index.js +0 -2
- package/es2020/src/modules/calendar/components/index.js.map +0 -1
- package/es2020/src/modules/calendar/components/monthCalendar/monthCalendar.component.js.map +0 -1
- package/es2020/src/modules/calendar/directives/calendarDayTemplate/calendarDayTemplate.context.js +0 -2
- package/es2020/src/modules/calendar/directives/calendarDayTemplate/calendarDayTemplate.context.js.map +0 -1
- package/es2020/src/modules/calendar/directives/calendarDayTemplate/calendarDayTemplate.directive.js.map +0 -1
- package/es2020/src/modules/calendar/directives/index.js +0 -3
- package/es2020/src/modules/calendar/directives/index.js.map +0 -1
- package/es2020/src/modules/calendar/index.js +0 -7
- package/es2020/src/modules/calendar/index.js.map +0 -1
- package/es2020/src/modules/calendar/interfaces/calendarDayData.interface.js +0 -2
- package/es2020/src/modules/calendar/interfaces/calendarDayData.interface.js.map +0 -1
- package/es2020/src/modules/calendar/interfaces/calendarEventDayMetadata.interface.js +0 -2
- package/es2020/src/modules/calendar/interfaces/calendarEventDayMetadata.interface.js.map +0 -1
- package/es2020/src/modules/calendar/interfaces/eventData.interface.js +0 -2
- package/es2020/src/modules/calendar/interfaces/eventData.interface.js.map +0 -1
- package/es2020/src/modules/calendar/interfaces/index.js +0 -4
- package/es2020/src/modules/calendar/interfaces/index.js.map +0 -1
- package/es2020/src/modules/calendar/misc/enums/calendarDayAspectRatio.enum.js +0 -27
- package/es2020/src/modules/calendar/misc/enums/calendarDayAspectRatio.enum.js.map +0 -1
- package/es2020/src/modules/calendar/misc/enums/index.js +0 -3
- package/es2020/src/modules/calendar/misc/enums/index.js.map +0 -1
- package/es2020/src/modules/calendar/misc/enums/monthCalendarDayFormat.enum.js +0 -19
- package/es2020/src/modules/calendar/misc/enums/monthCalendarDayFormat.enum.js.map +0 -1
- package/es2020/src/modules/calendar/misc/index.js +0 -2
- package/es2020/src/modules/calendar/misc/index.js.map +0 -1
- package/es2020/src/modules/calendar/modules/index.js +0 -2
- package/es2020/src/modules/calendar/modules/index.js.map +0 -1
- package/es2020/src/modules/calendar/modules/monthCalendar.module.js +0 -32
- package/es2020/src/modules/calendar/modules/monthCalendar.module.js.map +0 -1
- package/es2020/src/modules/calendar/services/eventParser/eventParser.service.js.map +0 -1
- package/es2020/src/modules/calendar/services/index.js +0 -2
- package/es2020/src/modules/calendar/services/index.js.map +0 -1
- package/es2020/src/modules/datePipes.module.js +0 -28
- package/es2020/src/modules/datePipes.module.js.map +0 -1
- package/es2020/src/modules/dateTime/directives/dateTime/dateTime.directive.js.map +0 -1
- package/es2020/src/modules/dateTime/directives/dateTimeBase.js +0 -61
- package/es2020/src/modules/dateTime/directives/dateTimeBase.js.map +0 -1
- package/es2020/src/modules/dateTime/directives/dateTimeControlValueAccessor/dateTimeControlValueAccessor.directive.js.map +0 -1
- package/es2020/src/modules/dateTime/directives/dateTimeInput/dateTimeInput.directive.js.map +0 -1
- package/es2020/src/modules/dateTime/directives/dateTimeMaxValidator/dateTimeMaxValidator.directive.js +0 -70
- package/es2020/src/modules/dateTime/directives/dateTimeMaxValidator/dateTimeMaxValidator.directive.js.map +0 -1
- package/es2020/src/modules/dateTime/directives/dateTimeMinValidator/dateTimeMinValidator.directive.js.map +0 -1
- package/es2020/src/modules/dateTime/directives/dateTimeValidator/dateTimeValidator.directive.js.map +0 -1
- package/es2020/src/modules/dateTime/directives/index.js +0 -8
- package/es2020/src/modules/dateTime/directives/index.js.map +0 -1
- package/es2020/src/modules/dateTime/index.js +0 -3
- package/es2020/src/modules/dateTime/index.js.map +0 -1
- package/es2020/src/modules/dateTime/modules/dateTime.module.js +0 -43
- package/es2020/src/modules/dateTime/modules/dateTime.module.js.map +0 -1
- package/es2020/src/modules/dateTime/modules/index.js +0 -2
- package/es2020/src/modules/dateTime/modules/index.js.map +0 -1
- package/es2020/src/modules/dateTimePicker/components/dateTimePeriodPickerBase.js.map +0 -1
- package/es2020/src/modules/dateTimePicker/components/dateTimePicker/dateTimePicker.component.js.map +0 -1
- package/es2020/src/modules/dateTimePicker/components/dateTimePicker/dateTimePicker.interface.js +0 -2
- package/es2020/src/modules/dateTimePicker/components/dateTimePicker/dateTimePicker.interface.js.map +0 -1
- package/es2020/src/modules/dateTimePicker/components/dayPicker/dayPicker.component.js.map +0 -1
- package/es2020/src/modules/dateTimePicker/components/index.js +0 -9
- package/es2020/src/modules/dateTimePicker/components/index.js.map +0 -1
- package/es2020/src/modules/dateTimePicker/components/monthPicker/monthPicker.component.js.map +0 -1
- package/es2020/src/modules/dateTimePicker/components/rollerTimePicker/rollerTimePicker.component.js.map +0 -1
- package/es2020/src/modules/dateTimePicker/components/rollerTimePicker/rollerTimePicker.data.js +0 -347
- package/es2020/src/modules/dateTimePicker/components/rollerTimePicker/rollerTimePicker.data.js.map +0 -1
- package/es2020/src/modules/dateTimePicker/components/yearPicker/yearPicker.component.js.map +0 -1
- package/es2020/src/modules/dateTimePicker/directives/dateTimePicker/dateTimePicker.directive.js.map +0 -1
- package/es2020/src/modules/dateTimePicker/directives/dateTimePicker/dateTimePicker.interface.js +0 -2
- package/es2020/src/modules/dateTimePicker/directives/index.js +0 -6
- package/es2020/src/modules/dateTimePicker/directives/index.js.map +0 -1
- package/es2020/src/modules/dateTimePicker/directives/loopScroll/loopScroll.directive.js.map +0 -1
- package/es2020/src/modules/dateTimePicker/directives/loopScroll/loopScroll.interface.js +0 -2
- package/es2020/src/modules/dateTimePicker/directives/loopScroll/loopScroll.interface.js.map +0 -1
- package/es2020/src/modules/dateTimePicker/directives/loopScrollData/loopScrollData.directive.js +0 -30
- package/es2020/src/modules/dateTimePicker/directives/loopScrollData/loopScrollData.directive.js.map +0 -1
- package/es2020/src/modules/dateTimePicker/index.js +0 -6
- package/es2020/src/modules/dateTimePicker/index.js.map +0 -1
- package/es2020/src/modules/dateTimePicker/interfaces/dateTimePicker/dateTimePicker.interface.js +0 -2
- package/es2020/src/modules/dateTimePicker/interfaces/dateTimePicker/dateTimePicker.interface.js.map +0 -1
- package/es2020/src/modules/dateTimePicker/interfaces/index.js +0 -3
- package/es2020/src/modules/dateTimePicker/interfaces/index.js.map +0 -1
- package/es2020/src/modules/dateTimePicker/interfaces/periodData/periodData.interface.js +0 -2
- package/es2020/src/modules/dateTimePicker/interfaces/periodData/periodData.interface.js.map +0 -1
- package/es2020/src/modules/dateTimePicker/misc/tokens.js +0 -10
- package/es2020/src/modules/dateTimePicker/misc/tokens.js.map +0 -1
- package/es2020/src/modules/dateTimePicker/modules/dateTimePicker.module.js +0 -29
- package/es2020/src/modules/dateTimePicker/modules/dateTimePicker.module.js.map +0 -1
- package/es2020/src/modules/dateTimePicker/modules/index.js +0 -2
- package/es2020/src/modules/dateTimePicker/modules/index.js.map +0 -1
- package/es2020/src/modules/index.js +0 -5
- package/es2020/src/modules/index.js.map +0 -1
- package/es2020/src/pipes/dateConvert.pipe.js +0 -35
- package/es2020/src/pipes/dateConvert.pipe.js.map +0 -1
- package/es2020/src/pipes/dateFormat.pipe.js +0 -39
- package/es2020/src/pipes/dateFormat.pipe.js.map +0 -1
- package/es2020/src/services/dateApi/dateApi.interface.js +0 -2
- package/es2020/src/services/dateApi/dateApi.interface.js.map +0 -1
- package/es2020/src/services/datePositionParser/datePositionParser.interface.js +0 -2
- package/es2020/src/services/datePositionParser/datePositionParser.interface.js.map +0 -1
- package/es2020/src/services/datePositionParser/datePositionParser.service.js.map +0 -1
- package/es2020/src/services/dateTimeRelativeParser/dateTimeRelativeParser.service.js.map +0 -1
- package/es2020/src/services/dateValueProvider/dateValueProvider.service.js.map +0 -1
- package/es2020/src/services/index.js +0 -6
- package/es2020/src/services/index.js.map +0 -1
- package/src/dark.scss +0 -38
- package/src/default.scss +0 -33
- package/src/theme.scss +0 -80
- /package/{es2015 → es2022}/date-fns/src/index.js +0 -0
- /package/{es2015 → es2022}/date-fns/src/index.js.map +0 -0
- /package/{es2015 → es2022}/date-fns/src/misc/tokens.js +0 -0
- /package/{es2015 → es2022}/date-fns/src/misc/tokens.js.map +0 -0
- /package/{es2015 → es2022}/date-fns/src/services/dateFnsLocale.service.js +0 -0
- /package/{es2015 → es2022}/date-fns/src/services/dateFnsLocale.service.js.map +0 -0
- /package/{es2015 → es2022}/moment/src/index.js +0 -0
- /package/{es2015 → es2022}/moment/src/index.js.map +0 -0
- /package/{es2015 → es2022}/moment/src/misc/tokens.js +0 -0
- /package/{es2015 → es2022}/moment/src/misc/tokens.js.map +0 -0
- /package/{es2015 → es2022}/src/directives/index.js +0 -0
- /package/{es2015 → es2022}/src/directives/index.js.map +0 -0
- /package/{es2015 → es2022}/src/index.js +0 -0
- /package/{es2015 → es2022}/src/index.js.map +0 -0
- /package/{es2015 → es2022}/src/interfaces/dateTime/datetime.interface.js +0 -0
- /package/{es2015 → es2022}/src/interfaces/dateTime/datetime.interface.js.map +0 -0
- /package/{es2015 → es2022}/src/interfaces/dateTimeInput/dateTimeInput.interface.js +0 -0
- /package/{es2015 → es2022}/src/interfaces/dateTimeInput/dateTimeInput.interface.js.map +0 -0
- /package/{es2015 → es2022}/src/interfaces/formatProvider/formatProvider.interface.js +0 -0
- /package/{es2015 → es2022}/src/interfaces/formatProvider/formatProvider.interface.js.map +0 -0
- /package/{es2015 → es2022}/src/interfaces/index.js +0 -0
- /package/{es2015 → es2022}/src/interfaces/index.js.map +0 -0
- /package/{es2015 → es2022}/src/legacy/picker/components/picker/picker.component.animations.js +0 -0
- /package/{es2015 → es2022}/src/legacy/picker/components/picker/picker.component.animations.js.map +0 -0
- /package/{es2015 → es2022}/src/misc/constants.js +0 -0
- /package/{es2015 → es2022}/src/misc/constants.js.map +0 -0
- /package/{es2015 → es2022}/src/misc/enums.js +0 -0
- /package/{es2015 → es2022}/src/misc/enums.js.map +0 -0
- /package/{es2015 → es2022}/src/misc/tokens.js +0 -0
- /package/{es2015 → es2022}/src/misc/tokens.js.map +0 -0
- /package/{es2015 → es2022}/src/misc/types.js +0 -0
- /package/{es2015 → es2022}/src/misc/types.js.map +0 -0
- /package/{es2020 → es2022}/src/misc/utils.js +0 -0
- /package/{es2020 → es2022}/src/misc/utils.js.map +0 -0
- /package/{es2015 → es2022}/src/modules/calendar/components/index.js +0 -0
- /package/{es2015 → es2022}/src/modules/calendar/components/index.js.map +0 -0
- /package/{es2015 → es2022}/src/modules/calendar/directives/calendarDayTemplate/calendarDayTemplate.context.js +0 -0
- /package/{es2015 → es2022}/src/modules/calendar/directives/calendarDayTemplate/calendarDayTemplate.context.js.map +0 -0
- /package/{es2015 → es2022}/src/modules/calendar/directives/index.js +0 -0
- /package/{es2015 → es2022}/src/modules/calendar/directives/index.js.map +0 -0
- /package/{es2015 → es2022}/src/modules/calendar/index.js +0 -0
- /package/{es2015 → es2022}/src/modules/calendar/index.js.map +0 -0
- /package/{es2015 → es2022}/src/modules/calendar/interfaces/calendarDayData.interface.js +0 -0
- /package/{es2015 → es2022}/src/modules/calendar/interfaces/calendarDayData.interface.js.map +0 -0
- /package/{es2015 → es2022}/src/modules/calendar/interfaces/calendarEventDayMetadata.interface.js +0 -0
- /package/{es2015 → es2022}/src/modules/calendar/interfaces/calendarEventDayMetadata.interface.js.map +0 -0
- /package/{es2015 → es2022}/src/modules/calendar/interfaces/eventData.interface.js +0 -0
- /package/{es2015 → es2022}/src/modules/calendar/interfaces/eventData.interface.js.map +0 -0
- /package/{es2015 → es2022}/src/modules/calendar/interfaces/index.js +0 -0
- /package/{es2015 → es2022}/src/modules/calendar/interfaces/index.js.map +0 -0
- /package/{es2015 → es2022}/src/modules/calendar/misc/enums/calendarDayAspectRatio.enum.js +0 -0
- /package/{es2015 → es2022}/src/modules/calendar/misc/enums/calendarDayAspectRatio.enum.js.map +0 -0
- /package/{es2015 → es2022}/src/modules/calendar/misc/enums/index.js +0 -0
- /package/{es2015 → es2022}/src/modules/calendar/misc/enums/index.js.map +0 -0
- /package/{es2015 → es2022}/src/modules/calendar/misc/enums/monthCalendarDayFormat.enum.js +0 -0
- /package/{es2015 → es2022}/src/modules/calendar/misc/enums/monthCalendarDayFormat.enum.js.map +0 -0
- /package/{es2015 → es2022}/src/modules/calendar/misc/index.js +0 -0
- /package/{es2015 → es2022}/src/modules/calendar/misc/index.js.map +0 -0
- /package/{es2015 → es2022}/src/modules/calendar/modules/index.js +0 -0
- /package/{es2015 → es2022}/src/modules/calendar/modules/index.js.map +0 -0
- /package/{es2015 → es2022}/src/modules/calendar/services/index.js +0 -0
- /package/{es2015 → es2022}/src/modules/calendar/services/index.js.map +0 -0
- /package/{es2015 → es2022}/src/modules/dateTime/directives/index.js +0 -0
- /package/{es2015 → es2022}/src/modules/dateTime/directives/index.js.map +0 -0
- /package/{es2015 → es2022}/src/modules/dateTime/index.js +0 -0
- /package/{es2015 → es2022}/src/modules/dateTime/index.js.map +0 -0
- /package/{es2015 → es2022}/src/modules/dateTime/modules/index.js +0 -0
- /package/{es2015 → es2022}/src/modules/dateTime/modules/index.js.map +0 -0
- /package/{es2015 → es2022}/src/modules/dateTimePicker/components/dateTimePicker/dateTimePicker.interface.js +0 -0
- /package/{es2015 → es2022}/src/modules/dateTimePicker/components/dateTimePicker/dateTimePicker.interface.js.map +0 -0
- /package/{es2015 → es2022}/src/modules/dateTimePicker/components/index.js +0 -0
- /package/{es2015 → es2022}/src/modules/dateTimePicker/components/index.js.map +0 -0
- /package/{es2015 → es2022}/src/modules/dateTimePicker/components/rollerTimePicker/rollerTimePicker.data.js +0 -0
- /package/{es2015 → es2022}/src/modules/dateTimePicker/components/rollerTimePicker/rollerTimePicker.data.js.map +0 -0
- /package/{es2015 → es2022}/src/modules/dateTimePicker/directives/dateTimePicker/dateTimePicker.interface.js +0 -0
- /package/{es2015 → es2022}/src/modules/dateTimePicker/directives/index.js +0 -0
- /package/{es2015 → es2022}/src/modules/dateTimePicker/directives/index.js.map +0 -0
- /package/{es2015 → es2022}/src/modules/dateTimePicker/directives/loopScroll/loopScroll.interface.js +0 -0
- /package/{es2015 → es2022}/src/modules/dateTimePicker/directives/loopScroll/loopScroll.interface.js.map +0 -0
- /package/{es2015 → es2022}/src/modules/dateTimePicker/index.js +0 -0
- /package/{es2015 → es2022}/src/modules/dateTimePicker/index.js.map +0 -0
- /package/{es2015 → es2022}/src/modules/dateTimePicker/interfaces/dateTimePicker/dateTimePicker.interface.js +0 -0
- /package/{es2015 → es2022}/src/modules/dateTimePicker/interfaces/dateTimePicker/dateTimePicker.interface.js.map +0 -0
- /package/{es2015 → es2022}/src/modules/dateTimePicker/interfaces/index.js +0 -0
- /package/{es2015 → es2022}/src/modules/dateTimePicker/interfaces/index.js.map +0 -0
- /package/{es2015 → es2022}/src/modules/dateTimePicker/interfaces/periodData/periodData.interface.js +0 -0
- /package/{es2015 → es2022}/src/modules/dateTimePicker/interfaces/periodData/periodData.interface.js.map +0 -0
- /package/{es2015 → es2022}/src/modules/dateTimePicker/misc/tokens.js +0 -0
- /package/{es2015 → es2022}/src/modules/dateTimePicker/misc/tokens.js.map +0 -0
- /package/{es2015 → es2022}/src/modules/dateTimePicker/modules/index.js +0 -0
- /package/{es2015 → es2022}/src/modules/dateTimePicker/modules/index.js.map +0 -0
- /package/{es2015 → es2022}/src/modules/index.js +0 -0
- /package/{es2015 → es2022}/src/modules/index.js.map +0 -0
- /package/{es2015 → es2022}/src/services/dateApi/dateApi.interface.js +0 -0
- /package/{es2015 → es2022}/src/services/dateApi/dateApi.interface.js.map +0 -0
- /package/{es2015 → es2022}/src/services/datePositionParser/datePositionParser.interface.js +0 -0
- /package/{es2015 → es2022}/src/services/datePositionParser/datePositionParser.interface.js.map +0 -0
- /package/{es2015 → es2022}/src/services/index.js +0 -0
- /package/{es2015 → es2022}/src/services/index.js.map +0 -0
package/changelog.md
CHANGED
|
@@ -1,5 +1,36 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## Version 7.0.0 (2023-08-17)
|
|
4
|
+
|
|
5
|
+
### Features
|
|
6
|
+
|
|
7
|
+
- new `ButtonDateTimeInputSADirective` directive, that is used for setting up date time input for button
|
|
8
|
+
- **extends** `DateTimeBase`
|
|
9
|
+
- **implements**
|
|
10
|
+
- `DateTimeInput`
|
|
11
|
+
- `OnDestroy`
|
|
12
|
+
- **inputs**
|
|
13
|
+
- `value` current value of date time, could be string, unix timestamp, Date, TDate object, or ranged DateTimeValue
|
|
14
|
+
- **properties**
|
|
15
|
+
- `rawValue` value of date time, raw string value which is visible to user
|
|
16
|
+
- `disabled` indication whether is date time disabled1
|
|
17
|
+
- `element` html element that represents input itself
|
|
18
|
+
- `focus` occurs when input gains focus
|
|
19
|
+
- `blur` occurs when input loses focus
|
|
20
|
+
- updated `DateTimePickerDirectiveOptions` interface
|
|
21
|
+
- new **properties**
|
|
22
|
+
- `targetElement` string that defines element in which should be picker rendered, if not specified, body is used, working only with `absolute` set to `true`
|
|
23
|
+
|
|
24
|
+
### BREAKING CHANGES
|
|
25
|
+
|
|
26
|
+
- minimal supported version of `@angular` is `16.0.3`
|
|
27
|
+
- minimal supported version of `@anglr/common` is `17.0.0`
|
|
28
|
+
- minimal supported version of `@jscrpt/common` is `4.0.0`
|
|
29
|
+
- minimal supported version of `@rxjs` is `7.5.7`
|
|
30
|
+
- minimal supported version of `date-fns` is `2.30.0`
|
|
31
|
+
- minimal supported version of `tslib` is `2.6.1`
|
|
32
|
+
- dropped support of `NodeJs` lower than `16.14`
|
|
33
|
+
|
|
3
34
|
## Version 6.1.0 (2023-01-04)
|
|
4
35
|
|
|
5
36
|
### Bug Fixes
|
|
@@ -38,7 +69,7 @@
|
|
|
38
69
|
- `dayAspectRatio` aspect ratio for displayed calendar day cell
|
|
39
70
|
- `events` array of events that should be displayed
|
|
40
71
|
- **content children**
|
|
41
|
-
- **child** `CalendarDayTemplateDirective`
|
|
72
|
+
- **child** `CalendarDayTemplateDirective`
|
|
42
73
|
- new `CalendarDayTemplateContext` interface, that is context passed to template of calendar day
|
|
43
74
|
- **properties**
|
|
44
75
|
- `$implicit` data that are used for displaying calendar day
|
|
@@ -117,7 +148,7 @@
|
|
|
117
148
|
- updated `MomentDateApi`
|
|
118
149
|
- now implements also new `isSame` and `formatISO` methods, and supports new `DateObject<TDate>` argument
|
|
119
150
|
- *subpackage* `@anglr/datetime/date-fns`
|
|
120
|
-
- updated `DateFnsDateApi`
|
|
151
|
+
- updated `DateFnsDateApi`
|
|
121
152
|
- now implements also new `isSame` and `formatISO` methods, and supports new `DateObject<TDate>` argument
|
|
122
153
|
|
|
123
154
|
### BREAKING CHANGES
|
|
@@ -358,7 +389,7 @@
|
|
|
358
389
|
- updated `MomentDateApi`
|
|
359
390
|
- now implements also new `unixTimestamp`
|
|
360
391
|
- *subpackage* `@anglr/datetime/date-fns`
|
|
361
|
-
- updated `DateFnsDateApi`
|
|
392
|
+
- updated `DateFnsDateApi`
|
|
362
393
|
- now implements also new `unixTimestamp`
|
|
363
394
|
|
|
364
395
|
### BREAKING CHANGES
|
|
@@ -398,13 +429,13 @@
|
|
|
398
429
|
- updated `DateApi` interface
|
|
399
430
|
- new generic parameter `TDateApiObject` which allows to get specific `DateApiObject` implementation
|
|
400
431
|
- *subpackage* `@anglr/datetime/moment`
|
|
401
|
-
- updated `MomentDateApi`
|
|
432
|
+
- updated `MomentDateApi`
|
|
402
433
|
- now creates `DateApiObject` using `DATE_API_OBJECT_TYPE`
|
|
403
434
|
- new `momentDateApiObjectType` type that represents creation of DateApiObject for moment
|
|
404
435
|
- new `MOMENT_DATE_API_OBJECT_TYPE` injection token used for injecting type that creates instance of DateApiObject for moment
|
|
405
436
|
- `MomentDateApiObject` made part of public API
|
|
406
437
|
- *subpackage* `@anglr/datetime/date-fns`
|
|
407
|
-
- updated `DateFnsDateApi`
|
|
438
|
+
- updated `DateFnsDateApi`
|
|
408
439
|
- now creates `DateApiObject` using `DATE_API_OBJECT_TYPE`
|
|
409
440
|
- new `dateFnsDateApiObjectType` type that represents creation of DateApiObject for date-fns
|
|
410
441
|
- new `DATE_FNS_DATE_API_OBJECT_TYPE` injection token used for injecting type that creates instance of DateApiObject for date-fns
|
|
@@ -450,7 +481,7 @@
|
|
|
450
481
|
- new `hour` property, that is format token for displaying hour (24h format) double digit number
|
|
451
482
|
- new `minute` property, that is format token for displaying minute double digit number
|
|
452
483
|
- new `second` property, that is format token for displaying second double digit number
|
|
453
|
-
- new `dayName` property, that is format token for displaying standalone day full name
|
|
484
|
+
- new `dayName` property, that is format token for displaying standalone day full name
|
|
454
485
|
- new `dayNameShort` property, that is format token for displaying standalone day short name
|
|
455
486
|
- new `monthName` property, that is format token for displaying standalone month full name
|
|
456
487
|
- new `monthNameShort` property, that is format token for displaying standalone month short name
|
|
@@ -492,12 +523,12 @@
|
|
|
492
523
|
- updated `InputDateTimeSelectorComponent` now supports *hours* and *minutes*
|
|
493
524
|
- updated `DateValueProvider` now supports *hours* and *minutes*
|
|
494
525
|
- *subpackage* `@anglr/datetime/moment`
|
|
495
|
-
- updated `MomentDateApi`
|
|
526
|
+
- updated `MomentDateApi`
|
|
496
527
|
- to correspond with `DateApi` interface
|
|
497
528
|
- updated `MomentDateApiObject` to correspond with `DateApiObject` interface
|
|
498
529
|
- updated `MOMENT_FORMAT_PROVIDER` to correspond with `FormatProvider` interface
|
|
499
530
|
- *subpackage* `@anglr/datetime/date-fns`
|
|
500
|
-
- updated `DateFnsDateApi`
|
|
531
|
+
- updated `DateFnsDateApi`
|
|
501
532
|
- to correspond with `DateApi` interface
|
|
502
533
|
- updated `DateFnsDateApiObject` to correspond with `DateApiObject` interface
|
|
503
534
|
- updated `DATEFNS_FORMAT_PROVIDER` to correspond with `FormatProvider` interface
|
|
@@ -554,7 +585,7 @@
|
|
|
554
585
|
- `InputDateTimeSelectorComponent` component used for selecting datetime in input field, allowing splitting of value into period/parts
|
|
555
586
|
- `SimpleInputDateTimeSelectorComponent` component used for selecting datetime in input field, simple input
|
|
556
587
|
- `DateTimeSelectorControlValueAccessor` directive for enabling *Angular Forms* binding to selector, also allowing gaining value as string, or simple value or range value
|
|
557
|
-
- `DateTimeSelectorModule` module containing selector
|
|
588
|
+
- `DateTimeSelectorModule` module containing selector
|
|
558
589
|
- `DateTimeBasicSelectorModule` module containing simple input selector
|
|
559
590
|
- customizable `DateTimePicker`, allowing to pick datetime value
|
|
560
591
|
- `DateTimePickerCssClasses` css classes applied to datetime picker
|
package/date-fns/package.json
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@anglr/datetime-date-fns",
|
|
3
3
|
"sideEffects": false,
|
|
4
|
-
"module": "../
|
|
5
|
-
"
|
|
6
|
-
"
|
|
7
|
-
"esm2020": "../es2020/date-fns/src/index.js",
|
|
4
|
+
"module": "../es2022/date-fns/src/index.js",
|
|
5
|
+
"es2022": "../es2022/date-fns/src/index.js",
|
|
6
|
+
"esm2022": "../es2022/date-fns/src/index.js",
|
|
8
7
|
"typings": "./src/index.d.ts"
|
|
9
8
|
}
|
|
@@ -9,6 +9,29 @@ import * as i1 from "@anglr/datetime";
|
|
|
9
9
|
* Instance of object wrapping TDate, allowing manipulation with it
|
|
10
10
|
*/
|
|
11
11
|
export class DateFnsDateApiObject {
|
|
12
|
+
_localeSvc;
|
|
13
|
+
//######################### protected fields #########################
|
|
14
|
+
/**
|
|
15
|
+
* Original value that is not changed unless 'updateOriginal' is called
|
|
16
|
+
*/
|
|
17
|
+
_originalValue;
|
|
18
|
+
/**
|
|
19
|
+
* Instance of date
|
|
20
|
+
*/
|
|
21
|
+
_value;
|
|
22
|
+
//######################### public properties - implementation of DateApiObject #########################
|
|
23
|
+
/**
|
|
24
|
+
* Original value that is not changed unless 'updateOriginal' is called
|
|
25
|
+
*/
|
|
26
|
+
get originalValue() {
|
|
27
|
+
return this._originalValue;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Instance of date
|
|
31
|
+
*/
|
|
32
|
+
get value() {
|
|
33
|
+
return this._value;
|
|
34
|
+
}
|
|
12
35
|
//######################### constructor #########################
|
|
13
36
|
constructor(value, format, _localeSvc) {
|
|
14
37
|
this._localeSvc = _localeSvc;
|
|
@@ -28,19 +51,6 @@ export class DateFnsDateApiObject {
|
|
|
28
51
|
this._value = this._originalValue = toDate(value);
|
|
29
52
|
}
|
|
30
53
|
}
|
|
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
54
|
//######################### public methods - implementation of DateApiObject #########################
|
|
45
55
|
/**
|
|
46
56
|
* Gets indication whether provided instance of date is valid
|
|
@@ -487,7 +497,10 @@ export class DateFnsDateApiObject {
|
|
|
487
497
|
/**
|
|
488
498
|
* Date api using DateFnsJS, used for obtaining DateApi wrapper object
|
|
489
499
|
*/
|
|
490
|
-
|
|
500
|
+
class DateFnsDateApi {
|
|
501
|
+
_localeSvc;
|
|
502
|
+
_relativeParser;
|
|
503
|
+
_dateApiObjecType;
|
|
491
504
|
//######################### constructor #########################
|
|
492
505
|
constructor(_localeSvc, _relativeParser, _dateApiObjecType) {
|
|
493
506
|
this._localeSvc = _localeSvc;
|
|
@@ -563,10 +576,11 @@ export class DateFnsDateApi {
|
|
|
563
576
|
isDate(value) {
|
|
564
577
|
return isDate(value);
|
|
565
578
|
}
|
|
579
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.1", ngImport: i0, type: DateFnsDateApi, deps: [{ token: DATE_FNS_LOCALE }, { token: i1.DateTimeRelativeParser }, { token: DATE_API_OBJECT_TYPE }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
580
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.1", ngImport: i0, type: DateFnsDateApi });
|
|
566
581
|
}
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: DateFnsDateApi, decorators: [{
|
|
582
|
+
export { DateFnsDateApi };
|
|
583
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.1", ngImport: i0, type: DateFnsDateApi, decorators: [{
|
|
570
584
|
type: Injectable
|
|
571
585
|
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|
|
572
586
|
type: Inject,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dateFnsDateApi.service.js","sourceRoot":"","sources":["../../../../date-fns/src/services/date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ED;;OAEG;IACI,MAAM,CAAC,KAAc;QAExB,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC;IACzB,CAAC;uGAtGQ,cAAc,kBAGH,eAAe,mDAEf,oBAAoB;2GAL/B,cAAc;;SAAd,cAAc;2FAAd,cAAc;kBAD1B,UAAU;;0BAIM,MAAM;2BAAC,eAAe;;0BAEtB,MAAM;2BAAC,oBAAoB;;AAoG5C;;GAEG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAkD,oBAAoB,CAAC;AAE5G;;GAEG;AACH,MAAM,CAAC,MAAM,6BAA6B,GAC1C;IACI,OAAO,EAAE,oBAAoB;IAC7B,QAAQ,EAAE,wBAAwB;CACrC,CAAC","sourcesContent":["import {Inject, Injectable, ValueProvider} from '@angular/core';\nimport {DateApi, DateValue, DateApiObject, DateTimeRelativeParser, DateApiObjectCtor, DATE_API_OBJECT_TYPE, DateObject} from '@anglr/datetime';\nimport {isBlank, isPresent, isString} from '@jscrpt/common';\nimport {toDate, getDate, setDate, isAfter, isBefore, isEqual, differenceInCalendarDays, format, formatISO, 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, subHours, addHours, endOfHour, startOfHour, startOfMinute, endOfMinute, addMinutes, subMinutes, getHours, setHours, getMinutes, setMinutes, isDate, getUnixTime} from 'date-fns';\n\nimport {DATE_FNS_LOCALE} from '../misc/tokens';\nimport {DateFnsLocale} from './dateFnsLocale.service';\n\n/**\n * Instance of object wrapping TDate, allowing manipulation with it\n */\nexport class DateFnsDateApiObject implements DateApiObject<Date>\n{\n //######################### protected fields #########################\n\n /**\n * Original value that is not changed unless 'updateOriginal' is called\n */\n protected _originalValue: Date;\n\n /**\n * Instance of date\n */\n protected _value: Date;\n\n //######################### public properties - implementation of DateApiObject #########################\n\n /**\n * Original value that is not changed unless 'updateOriginal' is called\n */\n public get originalValue(): Date\n {\n return this._originalValue;\n }\n\n /**\n * Instance of date\n */\n public get value(): Date\n {\n return this._value;\n }\n\n //######################### constructor #########################\n constructor(value: DateValue|Date,\n format: string|null|undefined,\n protected _localeSvc: DateFnsLocale)\n {\n if(isString(value))\n {\n //ISO string\n if(/^\\d+-\\d+-\\d+(T\\d+:\\d+:\\d+)?/.test(value))\n {\n this._value = this._originalValue = parseISO(value);\n }\n else\n {\n if(isBlank(format))\n {\n throw new Error('date-fns requires format parameter to be set for parsing non ISO string date!');\n }\n\n this._value = this._originalValue = parse(value, format, new Date(1970, 0));\n }\n }\n else\n {\n this._value = this._originalValue = toDate(value);\n }\n }\n\n //######################### public methods - implementation of DateApiObject #########################\n\n /**\n * Gets indication whether provided instance of date is valid\n */\n public isValid(): boolean\n {\n return isValid(this._value);\n }\n\n /**\n * Gets indication whether provided instance of date is weekend day\n */\n public isWeekend(): boolean\n {\n return isWeekend(this._value);\n }\n\n /**\n * Formats date value\n * @param formatString - Format token used for creating formatted string\n */\n public format(formatString: string): string\n {\n return format(this._value, formatString, {locale: this._localeSvc.locale});\n }\n\n /**\n * @inheritdoc\n */\n public formatISO(): string\n {\n return formatISO(this._value);\n }\n\n /**\n * @inheritdoc\n */\n public unixTimestamp(): number\n {\n return getUnixTime(this._value);\n }\n\n /**\n * Updates value to start date and time of current decade\n * @returns Itself for fluent API\n */\n public startOfDecade(): DateApiObject<Date>\n {\n this._value = startOfDecade(this._value);\n\n return this;\n }\n\n /**\n * Updates value to end date and time of current decade\n * @returns Itself for fluent API\n */\n public endOfDecade(): DateApiObject<Date>\n {\n this._value = endOfDecade(this._value);\n\n return this;\n }\n\n /**\n * Updates value to start date and time of current year\n * @returns Itself for fluent API\n */\n public startOfYear(): DateApiObject<Date>\n {\n this._value = startOfYear(this._value);\n\n return this;\n }\n\n /**\n * Updates value to end date and time of current year\n * @returns Itself for fluent API\n */\n public endOfYear(): DateApiObject<Date>\n {\n this._value = endOfYear(this._value);\n\n return this;\n }\n\n /**\n * Add years, if count not specified adds 1 year\n * @param count - Number of years count\n * @returns Itself for fluent API\n */\n public addYears(count?: number): DateApiObject<Date>\n {\n this._value = addYears(this._value, count ?? 1);\n\n return this;\n }\n\n /**\n * Subtract years, if count not specified subtract 1 year\n * @param count - Number of years count\n * @returns Itself for fluent API\n */\n public subtractYears(count?: number): DateApiObject<Date>\n {\n this._value = subYears(this._value, count ?? 1);\n\n return this;\n }\n\n /**\n * Updates value to start date and time of current month\n * @returns Itself for fluent API\n */\n public startOfMonth(): DateApiObject<Date>\n {\n this._value = startOfMonth(this._value);\n\n return this;\n }\n\n /**\n * Updates value to end date and time of current month\n * @returns Itself for fluent API\n */\n public endOfMonth(): DateApiObject<Date>\n {\n this._value = endOfMonth(this._value);\n\n return this;\n }\n\n /**\n * Add months, if count not specified adds 1 month\n * @param count - Number of months count\n * @returns Itself for fluent API\n */\n public addMonths(count?: number): DateApiObject<Date>\n {\n this._value = addMonths(this._value, count ?? 1);\n\n return this;\n }\n\n /**\n * Subtract months, if count not specified subtract 1 month\n * @param count - Number of months count\n * @returns Itself for fluent API\n */\n public subtractMonths(count?: number): DateApiObject<Date>\n {\n this._value = subMonths(this._value, count ?? 1);\n\n return this;\n }\n\n /**\n * Updates value to start date and time of current week\n * @returns Itself for fluent API\n */\n public startOfWeek(): DateApiObject<Date>\n {\n this._value = startOfWeek(this._value, {locale: this._localeSvc.locale});\n\n return this;\n }\n\n /**\n * Updates value to end date and time of current week\n * @returns Itself for fluent API\n */\n public endOfWeek(): DateApiObject<Date>\n {\n this._value = endOfWeek(this._value, {locale: this._localeSvc.locale});\n\n return this;\n }\n\n /**\n * Add weeks, if count not specified adds 1 week\n * @param count - Number of weeks count\n * @returns Itself for fluent API\n */\n public addWeeks(count?: number): DateApiObject<Date>\n {\n this._value = addWeeks(this._value, count ?? 1);\n\n return this;\n }\n\n /**\n * Subtract weeks, if count not specified subtract 1 week\n * @param count - Number of weeks count\n * @returns Itself for fluent API\n */\n public subtractWeeks(count?: number): DateApiObject<Date>\n {\n this._value = subWeeks(this._value, count ?? 1);\n\n return this;\n }\n\n /**\n * Updates value to start date and time of current day\n * @returns Itself for fluent API\n */\n public startOfDay(): DateApiObject<Date>\n {\n this._value = startOfDay(this._value);\n\n return this;\n }\n\n /**\n * Updates value to end date and time of current day\n * @returns Itself for fluent API\n */\n public endOfDay(): DateApiObject<Date>\n {\n this._value = endOfDay(this._value);\n\n return this;\n }\n\n /**\n * Add days, if count not specified adds 1 day\n * @param count - Number of days count\n * @returns Itself for fluent API\n */\n public addDays(count?: number): DateApiObject<Date>\n {\n this._value = addDays(this._value, count ?? 1);\n\n return this;\n }\n\n /**\n * Subtract days, if count not specified subtract 1 day\n * @param count - Number of days count\n * @returns Itself for fluent API\n */\n public subtractDays(count?: number): DateApiObject<Date>\n {\n this._value = subDays(this._value, count ?? 1);\n\n return this;\n }\n\n /**\n * Updates value to start date and time of current hour\n * @returns Itself for fluent API\n */\n public startOfHour(): DateApiObject<Date>\n {\n this._value = startOfHour(this._value);\n\n return this;\n }\n\n /**\n * Updates value to end date and time of current hour\n * @returns Itself for fluent API\n */\n public endOfHour(): DateApiObject<Date>\n {\n this._value = endOfHour(this._value);\n\n return this;\n }\n\n /**\n * Add hours, if count not specified adds 1 hour\n * @param count - Number of hours count\n * @returns Itself for fluent API\n */\n public addHours(count?: number): DateApiObject<Date>\n {\n this._value = addHours(this._value, count ?? 1);\n\n return this;\n }\n\n /**\n * Subtract hours, if count not specified subtract 1 hour\n * @param count - Number of hours count\n * @returns Itself for fluent API\n */\n public subtractHours(count?: number): DateApiObject<Date>\n {\n this._value = subHours(this._value, count ?? 1);\n\n return this;\n }\n\n /**\n * Updates value to start date and time of current minute\n * @returns Itself for fluent API\n */\n public startOfMinute(): DateApiObject<Date>\n {\n this._value = startOfMinute(this._value);\n\n return this;\n }\n\n /**\n * Updates value to end date and time of current minute\n * @returns Itself for fluent API\n */\n public endOfMinute(): DateApiObject<Date>\n {\n this._value = endOfMinute(this._value);\n\n return this;\n }\n\n /**\n * Add minutes, if count not specified adds 1 minute\n * @param count - Number of minutes count\n * @returns Itself for fluent API\n */\n public addMinutes(count?: number): DateApiObject<Date>\n {\n this._value = addMinutes(this._value, count ?? 1);\n\n return this;\n }\n\n /**\n * Subtract minutes, if count not specified subtract 1 minute\n * @param count - Number of minutes count\n * @returns Itself for fluent API\n */\n public subtractMinutes(count?: number): DateApiObject<Date>\n {\n this._value = subMinutes(this._value, count ?? 1);\n\n return this;\n }\n\n /**\n * Gets number of days in month\n */\n public daysInMonth(): number\n {\n return getDaysInMonth(this._value);\n }\n\n /**\n * Gets year\n */\n public year(): number;\n /**\n * Sets year\n * @param year - Year to be set\n */\n public year(year: number): DateApiObject<Date>;\n /**\n * Gets or sets year\n * @param year - If specified, sets year\n */\n public year(year?: number): DateApiObject<Date>|number\n {\n if(isPresent(year))\n {\n this._value = setYear(this._value, year);\n\n return this;\n }\n\n return getYear(this._value);\n }\n\n /**\n * Gets month\n */\n public month(): number\n /**\n * Sets month\n * @param month - Month to be set\n */\n public month(month: number): DateApiObject<Date>\n /**\n * Gets or sets month\n * @param month - If specified, sets month\n */\n public month(month?: number): DateApiObject<Date>|number\n {\n if(isPresent(month))\n {\n this._value = setMonth(this._value, month);\n\n return this;\n }\n\n return getMonth(this._value);\n }\n\n /**\n * Gets day of month one based\n */\n public dayOfMonth(): number;\n /**\n * Sets day of month one based\n * @param day - Day of month to be set\n */\n public dayOfMonth(day: number): DateApiObject<Date>;\n /**\n * Gets or sets day of month one based\n * @param day - If specified, sets day of month\n */\n public dayOfMonth(day?: number): DateApiObject<Date>|number\n {\n if(isPresent(day))\n {\n this._value = setDate(this._value, day);\n\n return this;\n }\n\n return getDate(this._value);\n }\n\n /**\n * Gets day of week zero based, first is monday\n */\n public dayOfWeek(): number;\n /**\n * Sets day of week zero based, first is monday\n * @param day - Day of week to be set\n */\n public dayOfWeek(day: number): DateApiObject<Date>;\n /**\n * Gets or sets day of week zero based, first is monday\n * @param day - If specified, sets day of week\n */\n public dayOfWeek(day?: number): number|DateApiObject<Date>\n {\n if(isPresent(day))\n {\n this._value = setISODay(this._value, day + 1);\n\n return this;\n }\n\n return getISODay(this._value) - 1;\n }\n\n /**\n * Gets hours zero based\n */\n public hour(): number;\n /**\n * Sets hours zero based\n * @param hour - hour to be set\n */\n public hour(hour: number): DateApiObject<Date>;\n /**\n * Gets or sets hours zero based\n * @param hour - If specified, sets hour\n */\n public hour(hour?: number): DateApiObject<Date>|number\n {\n if(isPresent(hour))\n {\n this._value = setHours(this._value, hour);\n\n return this;\n }\n\n return getHours(this._value);\n }\n\n /**\n * Gets minutes zero based\n */\n public minute(): number;\n /**\n * Sets minutes zero based\n * @param minute - minutes to be set\n */\n public minute(minute: number): DateApiObject<Date>;\n /**\n * Gets or sets minutes zero based\n * @param minute - If specified, sets minutes\n */\n public minute(minute?: number): DateApiObject<Date>|number\n {\n if(isPresent(minute))\n {\n this._value = setMinutes(this._value, minute);\n\n return this;\n }\n\n return getMinutes(this._value);\n }\n\n /**\n * Gets indication whether current value is before 'date'\n * @param date - Date which is this date compared to\n */\n public isBefore(date: DateObject<Date>): boolean\n {\n date = this.getDate(date);\n\n return isBefore(this._value, date);\n }\n\n /**\n * Gets indication whether current value is after 'date'\n * @param date - Date which is this date compared to\n */\n public isAfter(date: DateObject<Date>): boolean\n {\n date = this.getDate(date);\n\n return isAfter(this._value, date);\n }\n\n /**\n * Gets number of days between this and provided date\n * @param date - Date which is used for computation of diff against\n */\n public diffDays(date: DateObject<Date>): number\n {\n date = this.getDate(date);\n\n return differenceInCalendarDays(this._value, date);\n }\n\n /**\n * Compares whether this date is same week as provided date\n * @param date - Date which is used for comparison of same week\n */\n public isSameWeek(date: DateObject<Date>): boolean\n {\n date = this.getDate(date);\n\n return isSameWeek(this._value, date, {locale: this._localeSvc.locale});\n }\n\n /**\n * Compares whether this date is same decade as provided date\n * @param date - Date which is used for comparison of same decade\n */\n public isSameDecade(date: DateObject<Date>): boolean\n {\n date = this.getDate(date);\n\n const year = getYear(this._value);\n const start = year - (year % 10);\n const end = start + 10;\n\n return getYear(date) >= start && getYear(date) < end;\n }\n\n /**\n * Compares whether this date is same year as provided date\n * @param date - Date which is used for comparison of same year\n */\n public isSameYear(date: DateObject<Date>): boolean\n {\n date = this.getDate(date);\n\n return isSameYear(this._value, date);\n }\n\n /**\n * Compares whether this date is same month as provided date\n * @param date - Date which is used for comparison of same month\n */\n public isSameMonth(date: DateObject<Date>): boolean\n {\n date = this.getDate(date);\n\n return isSameMonth(this._value, date);\n }\n\n /**\n * @inheritdoc\n */\n public isSameDay(date: DateObject<Date>): boolean\n {\n date = this.getDate(date);\n\n return isSameDay(this._value, date);\n }\n\n /**\n * @inheritdoc\n */\n public isSame(date: DateObject<Date>): boolean\n {\n date = this.getDate(date);\n\n return isEqual(this._value, date);\n }\n\n /**\n * Creates clone of this instance, value and originalValue have same value and are cloned from value\n */\n public clone(): DateApiObject<Date>\n {\n return new DateFnsDateApiObject(new Date(this._value), null, this._localeSvc);\n }\n\n /**\n * Creates clone of this instance, value and originalValue have same value and are cloned from originalValue\n */\n public cloneOriginal(): DateApiObject<Date>\n {\n return new DateFnsDateApiObject(new Date(this._originalValue), null, this._localeSvc);\n }\n\n /**\n * Updates originalValue, if value is not provided originalValue is set to value\n * @param value - Value to be set as original, or null (value will be used as value)\n * @returns Itself for fluent API\n */\n public updateOriginal(value?: Date): DateApiObject<Date>\n {\n if(isBlank(value))\n {\n this._originalValue = this._value;\n }\n else\n {\n this._value = this._originalValue = value;\n }\n\n return this;\n }\n\n /**\n * Changes value to same value as originalValue\n * @returns Itself for fluent API\n */\n public resetOriginal(): DateApiObject<Date>\n {\n this._value = this._originalValue;\n\n return this;\n }\n\n //######################### protected methods #########################\n\n /**\n * Converts date object to date\n * @param value - Value to be converted to date\n */\n protected getDate(value: DateObject<Date>): Date\n {\n if(value instanceof Date)\n {\n return value;\n }\n\n return value.value;\n }\n}\n\n/**\n * Date api using DateFnsJS, used for obtaining DateApi wrapper object\n */\n@Injectable()\nexport class DateFnsDateApi implements DateApi<Date>\n{\n //######################### constructor #########################\n constructor(@Inject(DATE_FNS_LOCALE) protected _localeSvc: DateFnsLocale,\n protected _relativeParser: DateTimeRelativeParser<Date>,\n @Inject(DATE_API_OBJECT_TYPE) protected _dateApiObjecType: DateApiObjectCtor<Date, DateFnsDateApiObject>)\n {\n }\n\n //######################### public methods - implementation of DateApi #########################\n\n /**\n * Gets wrapping object used for manipulation\n * @param value - Value to be converted (parsed) and used for manipulation\n * @param format - Format string used for parsing string value\n */\n public getValue(value: DateValue|Date, format?: string): DateApiObject<Date>\n {\n return new this._dateApiObjecType(this._relativeParser.parse(value), format, this._localeSvc);\n }\n\n /**\n * Gets wrapping object used for manipulation instantiated to current date and time\n */\n public now(): DateApiObject<Date>\n {\n return new this._dateApiObjecType(new Date(), null ?? undefined, this._localeSvc);\n }\n\n /**\n * Gets format string using pseudo format\n * @param pseudoFormat - Pseudo format token, used for obtaining 'date' or 'time' format string\n */\n public getFormat(pseudoFormat: string): string\n {\n if(/^p+$/i.test(pseudoFormat))\n {\n if(!this._localeSvc.locale.formatLong)\n {\n throw new Error('Missing long formats for locale in DateApi');\n }\n\n const widths: {[index: number]: string} =\n {\n 1: 'short',\n 2: 'medium',\n 3: 'long',\n 4: 'full'\n };\n\n //date time format\n if(pseudoFormat.indexOf('Pp') >= 0 && pseudoFormat.length <= 8)\n {\n const partLength = pseudoFormat.length / 2;\n\n return `${this._localeSvc.locale.formatLong.date({width: widths[partLength]})} ${this._localeSvc.locale.formatLong.time({width: widths[partLength]})}`;\n }\n //date format\n else if(pseudoFormat.indexOf('P') >= 0 && pseudoFormat.length <= 4)\n {\n return this._localeSvc.locale.formatLong.date({width: widths[pseudoFormat.length]});\n }\n //time format\n else if(pseudoFormat.indexOf('p') >= 0 && pseudoFormat.length <= 4)\n {\n return this._localeSvc.locale.formatLong.time({width: widths[pseudoFormat.length]});\n }\n }\n\n return pseudoFormat;\n }\n\n /**\n * Gets information\n */\n public weekStartsOnMonday(): boolean\n {\n return this._localeSvc.locale.options?.weekStartsOn === 1;\n }\n\n /**\n * Gets array of weekday names in short format, order of days is dependent on locale\n */\n public weekdaysShort(): string[]\n {\n let startIndex = this._localeSvc.locale.options!.weekStartsOn!;\n const weekdays: string[] = [];\n\n for(let x = 0; x < 7; x++)\n {\n weekdays.push(this._localeSvc.locale.localize!.day(startIndex++ % 7, {width: 'short'}));\n }\n\n return weekdays;\n }\n\n /**\n * @inheritdoc\n */\n public isDate(value: unknown): value is Date\n {\n return isDate(value);\n }\n}\n\n/**\n * Type that represents creation of DateApiObject for date-fns\n */\nexport const dateFnsDateApiObjectType: DateApiObjectCtor<Date, DateFnsDateApiObject> = DateFnsDateApiObject;\n\n/**\n * Injection token used for injecting type that creates instance of DateApiObject for date-fns\n */\nexport const DATE_FNS_DATE_API_OBJECT_TYPE: ValueProvider =\n{\n provide: DATE_API_OBJECT_TYPE,\n useValue: dateFnsDateApiObjectType\n};"]}
|
|
@@ -8,10 +8,15 @@ import * as i1 from "@anglr/datetime";
|
|
|
8
8
|
* Instance of object wrapping TDate, allowing manipulation with it
|
|
9
9
|
*/
|
|
10
10
|
export class MomentDateApiObject {
|
|
11
|
-
//#########################
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
//######################### protected fields #########################
|
|
12
|
+
/**
|
|
13
|
+
* Original value that is not changed unless 'updateOriginal' is called
|
|
14
|
+
*/
|
|
15
|
+
_originalValue;
|
|
16
|
+
/**
|
|
17
|
+
* Instance of date
|
|
18
|
+
*/
|
|
19
|
+
_value;
|
|
15
20
|
//######################### public properties - implementation of DateApiObject #########################
|
|
16
21
|
/**
|
|
17
22
|
* Original value that is not changed unless 'updateOriginal' is called
|
|
@@ -25,6 +30,10 @@ export class MomentDateApiObject {
|
|
|
25
30
|
get value() {
|
|
26
31
|
return this._value;
|
|
27
32
|
}
|
|
33
|
+
//######################### constructor #########################
|
|
34
|
+
constructor(value, format) {
|
|
35
|
+
this._value = this._originalValue = moment(value, format);
|
|
36
|
+
}
|
|
28
37
|
//######################### public methods - implementation of DateApiObject #########################
|
|
29
38
|
/**
|
|
30
39
|
* Gets indication whether provided instance of date is valid
|
|
@@ -475,7 +484,9 @@ export class MomentDateApiObject {
|
|
|
475
484
|
/**
|
|
476
485
|
* Date api using MomentJS, used for obtaining DateApi wrapper object
|
|
477
486
|
*/
|
|
478
|
-
|
|
487
|
+
class MomentDateApi {
|
|
488
|
+
_relativeParser;
|
|
489
|
+
_dateApiObjecType;
|
|
479
490
|
//######################### constructor #########################
|
|
480
491
|
constructor(_relativeParser, _dateApiObjecType) {
|
|
481
492
|
this._relativeParser = _relativeParser;
|
|
@@ -524,10 +535,11 @@ export class MomentDateApi {
|
|
|
524
535
|
isDate(value) {
|
|
525
536
|
return value instanceof moment;
|
|
526
537
|
}
|
|
538
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.1", ngImport: i0, type: MomentDateApi, deps: [{ token: i1.DateTimeRelativeParser }, { token: DATE_API_OBJECT_TYPE }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
539
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.1", ngImport: i0, type: MomentDateApi });
|
|
527
540
|
}
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: MomentDateApi, decorators: [{
|
|
541
|
+
export { MomentDateApi };
|
|
542
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.1", ngImport: i0, type: MomentDateApi, decorators: [{
|
|
531
543
|
type: Injectable
|
|
532
544
|
}], ctorParameters: function () { return [{ type: i1.DateTimeRelativeParser }, { type: undefined, decorators: [{
|
|
533
545
|
type: Inject,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"momentDateApi.service.js","sourceRoot":"","sources":["../../../../moment/src/services/momentDateApi.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,MAAM,EAAE,UAAU,EAAgB,MAAM,eAAe,CAAC;AAChE,OAAO,EAAoC,sBAAsB,EAAqB,oBAAoB,EAAa,MAAM,iBAAiB,CAAC;AAC/I,OAAO,EAAC,OAAO,EAAE,SAAS,EAAC,MAAM,gBAAgB,CAAC;AAClD,OAAO,MAA2B,MAAM,QAAQ,CAAC;;;AAEjD;;GAEG;AACH,MAAM,OAAO,mBAAmB;IAE5B,sEAAsE;IAEtE;;OAEG;IACO,cAAc,CAAgB;IAExC;;OAEG;IACO,MAAM,CAAgB;IAEhC,yGAAyG;IAEzG;;OAEG;IACH,IAAW,aAAa;QAEpB,OAAO,IAAI,CAAC,cAAc,CAAC;IAC/B,CAAC;IAED;;OAEG;IACH,IAAW,KAAK;QAEZ,OAAO,IAAI,CAAC,MAAM,CAAC;IACvB,CAAC;IAED,iEAAiE;IACjE,YAAY,KAA8B,EAAE,MAAe;QAEvD,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,cAAc,GAAG,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IAC9D,CAAC;IAED,sGAAsG;IAEtG;;OAEG;IACI,OAAO;QAEV,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;IACjC,CAAC;IAED;;OAEG;IACI,SAAS;QAEZ,MAAM,OAAO,GAAG,IAAI,CAAC,MAAM,CAAC,UAAU,EAAE,CAAC;QAEzC,OAAO,OAAO,IAAI,CAAC,IAAI,OAAO,IAAI,CAAC,CAAC;IACxC,CAAC;IAED;;;OAGG;IACI,MAAM,CAAC,MAAc;QAExB,OAAO,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,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QAAQ,EAAE,uBAAuB;CACpC,CAAC","sourcesContent":["import {Inject, Injectable, ValueProvider} from '@angular/core';\nimport {DateApi, DateValue, DateApiObject, DateTimeRelativeParser, DateApiObjectCtor, DATE_API_OBJECT_TYPE, DateObject} from '@anglr/datetime';\nimport {isBlank, isPresent} from '@jscrpt/common';\nimport moment, {LongDateFormatKey} from 'moment';\n\n/**\n * Instance of object wrapping TDate, allowing manipulation with it\n */\nexport class MomentDateApiObject implements DateApiObject<moment.Moment>\n{\n //######################### protected fields #########################\n\n /**\n * Original value that is not changed unless 'updateOriginal' is called\n */\n protected _originalValue: moment.Moment;\n\n /**\n * Instance of date\n */\n protected _value: moment.Moment;\n\n //######################### public properties - implementation of DateApiObject #########################\n\n /**\n * Original value that is not changed unless 'updateOriginal' is called\n */\n public get originalValue(): moment.Moment\n {\n return this._originalValue;\n }\n\n /**\n * Instance of date\n */\n public get value(): moment.Moment\n {\n return this._value;\n }\n\n //######################### constructor #########################\n constructor(value: DateValue|moment.Moment, format?: string)\n {\n this._value = this._originalValue = moment(value, format);\n }\n\n //######################### public methods - implementation of DateApiObject #########################\n\n /**\n * Gets indication whether provided instance of date is valid\n */\n public isValid(): boolean\n {\n return this._value.isValid();\n }\n\n /**\n * Gets indication whether provided instance of date is weekend day\n */\n public isWeekend(): boolean\n {\n const weekday = this._value.isoWeekday();\n\n return weekday == 6 || weekday == 7;\n }\n\n /**\n * Formats date value\n * @param format - Format token used for creating formatted string\n */\n public format(format: string): string\n {\n return this._value.format(format.replace(/y/g, 'Y').replace(/d/g, 'D'));\n }\n\n /**\n * @inheritdoc\n */\n public formatISO(): string\n {\n return this._value.format();\n }\n\n /**\n * @inheritdoc\n */\n public unixTimestamp(): number\n {\n return this._value.unix();\n }\n\n /**\n * Updates value to start date and time of current decade\n * @returns Itself for fluent API\n */\n public startOfDecade(): DateApiObject<moment.Moment>\n {\n const diff = (this._value.year() % 10);\n\n this._value = moment(this._value).subtract(diff, 'years').startOf('year');\n \n return this;\n }\n\n /**\n * Updates value to end date and time of current decade\n * @returns Itself for fluent API\n */\n public endOfDecade(): DateApiObject<moment.Moment>\n {\n const diff = 9 - (this._value.year() % 10);\n\n this._value = moment(this._value).add(diff, 'years').endOf('year');\n \n return this;\n }\n\n /**\n * Updates value to start date and time of current year\n * @returns Itself for fluent API\n */\n public startOfYear(): DateApiObject<moment.Moment>\n {\n this._value = moment(this._value).startOf('year');\n\n return this;\n }\n\n /**\n * Updates value to end date and time of current year\n * @returns Itself for fluent API\n */\n public endOfYear(): DateApiObject<moment.Moment>\n {\n this._value = moment(this._value).endOf('year');\n\n return this;\n }\n\n /**\n * Add years, if count not specified adds 1 year\n * @param count - Number of years count\n * @returns Itself for fluent API\n */\n public addYears(count?: number): DateApiObject<moment.Moment>\n {\n this._value = moment(this._value).add(count ?? 1, 'years');\n\n return this;\n }\n\n /**\n * Subtract years, if count not specified subtract 1 year\n * @param count - Number of years count\n * @returns Itself for fluent API\n */\n public subtractYears(count?: number): DateApiObject<moment.Moment>\n {\n this._value = moment(this._value).subtract(count ?? 1, 'years');\n\n return this;\n }\n\n /**\n * Updates value to start date and time of current month\n * @returns Itself for fluent API\n */\n public startOfMonth(): DateApiObject<moment.Moment>\n {\n this._value = moment(this._value).startOf('month');\n\n return this;\n }\n\n /**\n * Updates value to end date and time of current month\n * @returns Itself for fluent API\n */\n public endOfMonth(): DateApiObject<moment.Moment>\n {\n this._value = moment(this._value).endOf('month');\n\n return this;\n }\n\n /**\n * Add months, if count not specified adds 1 month\n * @param count - Number of months count\n * @returns Itself for fluent API\n */\n public addMonths(count?: number): DateApiObject<moment.Moment>\n {\n this._value = moment(this._value).add(count ?? 1, 'months');\n\n return this;\n }\n\n /**\n * Subtract months, if count not specified subtract 1 month\n * @param count - Number of months count\n * @returns Itself for fluent API\n */\n public subtractMonths(count?: number): DateApiObject<moment.Moment>\n {\n this._value = moment(this._value).subtract(count ?? 1, 'months');\n\n return this;\n }\n\n /**\n * Updates value to start date and time of current week\n * @returns Itself for fluent API\n */\n public startOfWeek(): DateApiObject<moment.Moment>\n {\n this._value = moment(this._value).startOf('week');\n\n return this;\n }\n\n /**\n * Updates value to end date and time of current week\n * @returns Itself for fluent API\n */\n public endOfWeek(): DateApiObject<moment.Moment>\n {\n this._value = moment(this._value).endOf('week');\n\n return this;\n }\n\n /**\n * Add weeks, if count not specified adds 1 week\n * @param count - Number of weeks count\n * @returns Itself for fluent API\n */\n public addWeeks(count?: number): DateApiObject<moment.Moment>\n {\n this._value = moment(this._value).add(count ?? 1, 'weeks');\n\n return this;\n }\n\n /**\n * Subtract weeks, if count not specified subtract 1 week\n * @param count - Number of weeks count\n * @returns Itself for fluent API\n */\n public subtractWeeks(count?: number): DateApiObject<moment.Moment>\n {\n this._value = moment(this._value).subtract(count ?? 1, 'weeks');\n\n return this;\n }\n\n /**\n * Updates value to start date and time of current day\n * @returns Itself for fluent API\n */\n public startOfDay(): DateApiObject<moment.Moment>\n {\n this._value = moment(this._value).startOf('day');\n\n return this;\n }\n\n /**\n * Updates value to end date and time of current day\n * @returns Itself for fluent API\n */\n public endOfDay(): DateApiObject<moment.Moment>\n {\n this._value = moment(this._value).endOf('day');\n\n return this;\n }\n\n /**\n * Add days, if count not specified adds 1 day\n * @param count - Number of days count\n * @returns Itself for fluent API\n */\n public addDays(count?: number): DateApiObject<moment.Moment>\n {\n this._value = moment(this._value).add(count ?? 1, 'days');\n\n return this;\n }\n\n /**\n * Subtract days, if count not specified subtract 1 day\n * @param count - Number of days count\n * @returns Itself for fluent API\n */\n public subtractDays(count?: number): DateApiObject<moment.Moment>\n {\n this._value = moment(this._value).subtract(count ?? 1, 'days');\n\n return this;\n }\n\n /**\n * Updates value to start date and time of current hour\n * @returns Itself for fluent API\n */\n public startOfHour(): DateApiObject<moment.Moment>\n {\n this._value = moment(this._value).startOf('hour');\n\n return this;\n }\n\n /**\n * Updates value to end date and time of current hour\n * @returns Itself for fluent API\n */\n public endOfHour(): DateApiObject<moment.Moment>\n {\n this._value = moment(this._value).endOf('hour');\n\n return this;\n }\n\n /**\n * Add hours, if count not specified adds 1 hour\n * @param count - Number of hours count\n * @returns Itself for fluent API\n */\n public addHours(count?: number): DateApiObject<moment.Moment>\n {\n this._value = moment(this._value).add(count ?? 1, 'hours');\n\n return this;\n }\n\n /**\n * Subtract hours, if count not specified subtract 1 hour\n * @param count - Number of hours count\n * @returns Itself for fluent API\n */\n public subtractHours(count?: number): DateApiObject<moment.Moment>\n {\n this._value = moment(this._value).subtract(count ?? 1, 'hours');\n\n return this;\n }\n\n /**\n * Updates value to start date and time of current minute\n * @returns Itself for fluent API\n */\n public startOfMinute(): DateApiObject<moment.Moment>\n {\n this._value = moment(this._value).startOf('minute');\n\n return this;\n }\n\n /**\n * Updates value to end date and time of current minute\n * @returns Itself for fluent API\n */\n public endOfMinute(): DateApiObject<moment.Moment>\n {\n this._value = moment(this._value).endOf('minute');\n\n return this;\n }\n\n /**\n * Add minutes, if count not specified adds 1 minute\n * @param count - Number of minutes count\n * @returns Itself for fluent API\n */\n public addMinutes(count?: number): DateApiObject<moment.Moment>\n {\n this._value = moment(this._value).add(count ?? 1, 'minutes');\n\n return this;\n }\n\n /**\n * Subtract minutes, if count not specified subtract 1 minute\n * @param count - Number of minutes count\n * @returns Itself for fluent API\n */\n public subtractMinutes(count?: number): DateApiObject<moment.Moment>\n {\n this._value = moment(this._value).subtract(count ?? 1, 'minutes');\n\n return this;\n }\n\n /**\n * Gets number of days in month\n */\n public daysInMonth(): number\n {\n return this._value.daysInMonth();\n }\n\n /**\n * Gets year\n */\n public year(): number;\n /**\n * Sets year\n * @param year - Year to be set\n */\n public year(year: number): DateApiObject<moment.Moment>;\n /**\n * Gets or sets year\n * @param year - If specified, sets year\n */\n public year(year?: number): DateApiObject<moment.Moment>|number\n {\n if(isPresent(year))\n {\n this._value = moment(this._value).year(year);\n\n return this;\n }\n\n return this._value.year();\n }\n\n /**\n * Gets month\n */\n public month(): number\n /**\n * Sets month\n * @param month - Month to be set\n */\n public month(month: number): DateApiObject<moment.Moment>\n /**\n * Gets or sets month\n * @param month - If specified, sets month\n */\n public month(month?: number): DateApiObject<moment.Moment>|number\n {\n if(isPresent(month))\n {\n this._value = moment(this._value).month(month);\n\n return this;\n }\n\n return this._value.month();\n }\n\n /**\n * Gets day of month one based\n */\n public dayOfMonth(): number;\n /**\n * Sets day of month one based\n * @param day - Day of month to be set\n */\n public dayOfMonth(day: number): DateApiObject<moment.Moment>;\n /**\n * Gets or sets day of month one based\n * @param day - If specified, sets day of month\n */\n public dayOfMonth(day?: number): DateApiObject<moment.Moment>|number\n {\n if(isPresent(day))\n {\n this._value = moment(this._value).date(day);\n\n return this;\n }\n\n return this._value.date();\n }\n\n /**\n * Gets day of week zero based, first is monday\n */\n public dayOfWeek(): number;\n /**\n * Sets day of week zero based, first is monday\n * @param day - Day of week to be set\n */\n public dayOfWeek(day: number): DateApiObject<moment.Moment>;\n /**\n * Gets or sets day of week zero based, first is monday\n * @param day - If specified, sets day of week\n */\n public dayOfWeek(day?: number): number|DateApiObject<moment.Moment>\n {\n if(isPresent(day))\n {\n this._value = moment(this._value).weekday(day);\n\n return this;\n }\n\n return this._value.weekday();\n }\n\n /**\n * Gets hours zero based\n */\n public hour(): number;\n /**\n * Sets hours zero\n * @param hour - hour to be set\n */\n public hour(hour: number): DateApiObject<moment.Moment>;\n /**\n * Gets or sets hours zero\n * @param hour - If specified, sets hour\n */\n public hour(hour?: number): DateApiObject<moment.Moment>|number\n {\n if(isPresent(hour))\n {\n this._value = moment(this._value).hours(hour);\n\n return this;\n }\n\n return this._value.hours();\n }\n\n /**\n * Gets minutes zero based\n */\n public minute(): number;\n /**\n * Sets minutes zero based\n * @param minute - minutes to be set\n */\n public minute(minute: number): DateApiObject<moment.Moment>;\n /**\n * Gets or sets minutes zero based\n * @param minute - If specified, sets minutes\n */\n public minute(minute?: number): DateApiObject<moment.Moment>|number\n {\n if(isPresent(minute))\n {\n this._value = moment(this._value).minutes(minute);\n\n return this;\n }\n\n return this._value.minutes();\n }\n\n /**\n * Gets indication whether current value is before 'date'\n * @param date - Date which is this date compared to\n */\n public isBefore(date: DateObject<moment.Moment>): boolean\n {\n date = this.getDate(date);\n\n return this._value.isBefore(date);\n }\n\n /**\n * Gets indication whether current value is after 'date'\n * @param date - Date which is this date compared to\n */\n public isAfter(date: DateObject<moment.Moment>): boolean\n {\n date = this.getDate(date);\n\n return this._value.isAfter(date);\n }\n\n /**\n * Gets number of days between this and provided date\n * @param date - Date which is used for computation of diff against\n */\n public diffDays(date: DateObject<moment.Moment>): number\n {\n date = this.getDate(date);\n\n return moment(this._value).startOf('day').diff(moment(date).startOf('day'), 'days');\n }\n\n /**\n * Compares whether this date is same week as provided date\n * @param date - Date which is used for comparison of same week\n */\n public isSameWeek(date: DateObject<moment.Moment>): boolean\n {\n date = this.getDate(date);\n\n return this._value.isSame(date, 'week');\n }\n\n /**\n * Compares whether this date is same decade as provided date\n * @param date - Date which is used for comparison of same decade\n */\n public isSameDecade(date: DateObject<moment.Moment>): boolean\n {\n date = this.getDate(date);\n\n const year = this._value.year();\n const start = year - (year % 10);\n const end = start + 10;\n\n return date.year() >= start && date.year() < end;\n }\n\n /**\n * Compares whether this date is same year as provided date\n * @param date - Date which is used for comparison of same year\n */\n public isSameYear(date: DateObject<moment.Moment>): boolean\n {\n date = this.getDate(date);\n\n return this._value.isSame(date, 'year');\n }\n\n /**\n * Compares whether this date is same month as provided date\n * @param date - Date which is used for comparison of same month\n */\n public isSameMonth(date: DateObject<moment.Moment>): boolean\n {\n date = this.getDate(date);\n\n return this._value.isSame(date, 'month');\n }\n\n /**\n * Compares whether this date is same day as provided date\n * @param date - Date which is used for comparison of same day\n */\n public isSameDay(date: DateObject<moment.Moment>): boolean\n {\n date = this.getDate(date);\n\n return this._value.isSame(date, 'day');\n }\n\n /**\n * @inheritdoc\n */\n public isSame(date: DateObject<moment.Moment>): boolean\n {\n date = this.getDate(date);\n\n return this._value.isSame(date);\n }\n\n /**\n * Creates clone of this instance, value and originalValue have same value and are cloned from value\n */\n public clone(): DateApiObject<moment.Moment>\n {\n return new MomentDateApiObject(moment(this._value));\n }\n\n /**\n * Creates clone of this instance, value and originalValue have same value and are cloned from originalValue\n */\n public cloneOriginal(): DateApiObject<moment.Moment>\n {\n return new MomentDateApiObject(moment(this._originalValue));\n }\n\n /**\n * Updates originalValue, if value is not provided originalValue is set to value\n * @param value - Value to be set as original, or null (value will be used as value)\n * @returns Itself for fluent API\n */\n public updateOriginal(value?: moment.Moment): DateApiObject<moment.Moment>\n {\n if(isBlank(value))\n {\n this._originalValue = this._value;\n }\n else\n {\n this._value = this._originalValue = value!;\n }\n\n return this;\n }\n\n /**\n * Changes value to same value as originalValue\n * @returns Itself for fluent API\n */\n public resetOriginal(): DateApiObject<moment.Moment>\n {\n this._value = this._originalValue;\n\n return this;\n }\n\n //######################### protected methods #########################\n\n /**\n * Converts date object to date\n * @param value - Value to be converted to date\n */\n protected getDate(value: DateObject<moment.Moment>): moment.Moment\n {\n if(value instanceof moment)\n {\n return value as moment.Moment;\n }\n\n return (value as DateApiObject<moment.Moment>).value;\n }\n}\n\n/**\n * Date api using MomentJS, used for obtaining DateApi wrapper object\n */\n@Injectable()\nexport class MomentDateApi implements DateApi<moment.Moment>\n{\n //######################### constructor #########################\n constructor(protected _relativeParser: DateTimeRelativeParser<moment.Moment>,\n @Inject(DATE_API_OBJECT_TYPE) protected _dateApiObjecType: DateApiObjectCtor<moment.Moment, MomentDateApiObject>)\n {\n }\n\n //######################### public methods #########################\n\n /**\n * Gets wrapping object used for manipulation\n * @param value - Value to be converted (parsed) and used for manipulation\n * @param format - Format string used for parsing string value\n */\n public getValue(value: DateValue|moment.Moment, format?: string): DateApiObject<moment.Moment>\n {\n return new this._dateApiObjecType(this._relativeParser.parse(value), format);\n }\n\n /**\n * Gets wrapping object used for manipulation instantiated to current date and time\n */\n public now(): DateApiObject<moment.Moment>\n {\n return new this._dateApiObjecType(moment());\n }\n\n /**\n * Gets format string using pseudo format\n * @param pseudoFormat - Pseudo format token, used for obtaining 'date' or 'time' format string\n */\n public getFormat(pseudoFormat: string): string\n {\n if(/^((LT|LTS|L+|l+)\\s*)*$/g.test(pseudoFormat))\n {\n return pseudoFormat.split(' ').map(itm => moment.localeData().longDateFormat(itm as LongDateFormatKey)).join(' ');\n }\n\n return pseudoFormat;\n }\n\n /**\n * Gets information \n */\n public weekStartsOnMonday(): boolean\n {\n return moment.localeData().firstDayOfWeek() === 1;\n }\n\n /**\n * Gets array of weekday names in short format, order of days is dependent on locale\n */\n public weekdaysShort(): string[]\n {\n return moment.weekdaysShort(true);\n }\n\n /**\n * @inheritdoc\n */\n public isDate(value: unknown): value is moment.Moment\n {\n return value instanceof moment;\n }\n}\n\n/**\n * Type that represents creation of DateApiObject for moment\n */\nexport const momentDateApiObjectType: DateApiObjectCtor<moment.Moment, MomentDateApiObject> = MomentDateApiObject;\n\n/**\n * Injection token used for injecting type that creates instance of DateApiObject for moment\n */\nexport const MOMENT_DATE_API_OBJECT_TYPE: ValueProvider =\n{\n provide: DATE_API_OBJECT_TYPE,\n useValue: momentDateApiObjectType\n};\n"]}
|
|
@@ -1,45 +1,29 @@
|
|
|
1
1
|
import { __decorate, __metadata } from "tslib";
|
|
2
|
-
import { Directive, ElementRef, EventEmitter, forwardRef, Inject } from '@angular/core';
|
|
2
|
+
import { Directive, ElementRef, EventEmitter, forwardRef, Inject, Input } from '@angular/core';
|
|
3
3
|
import { BindThis, isBlank } from '@jscrpt/common';
|
|
4
|
-
import { DATE_API, DATE_TIME_INPUT } from '
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
4
|
+
import { DATE_API, DATE_TIME_INPUT } from '../../misc/tokens';
|
|
5
|
+
import { DateTimeBase } from '../../modules/dateTime/directives/dateTimeBase';
|
|
6
|
+
import { formatDateTime, parseDateTime } from '../../misc/utils';
|
|
7
|
+
import { DateValueProvider } from '../../services';
|
|
8
8
|
import * as i0 from "@angular/core";
|
|
9
|
-
import * as i1 from "
|
|
10
|
-
//TODO: range is unimplemented
|
|
9
|
+
import * as i1 from "../../services";
|
|
11
10
|
/**
|
|
12
|
-
* Directive that is used for setting up date time input
|
|
11
|
+
* Directive that is used for setting up date time input for button
|
|
13
12
|
*/
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
*/
|
|
24
|
-
this.focus = new EventEmitter();
|
|
25
|
-
/**
|
|
26
|
-
* @inheritdoc
|
|
27
|
-
*/
|
|
28
|
-
this.blur = new EventEmitter();
|
|
29
|
-
this.elementRef.nativeElement.addEventListener('input', this.handleInput);
|
|
30
|
-
this.elementRef.nativeElement.addEventListener('focus', this.handleFocus);
|
|
31
|
-
this.elementRef.nativeElement.addEventListener('blur', this.handleBlur);
|
|
32
|
-
}
|
|
13
|
+
class ButtonDateTimeInputSADirective extends DateTimeBase {
|
|
14
|
+
elementRef;
|
|
15
|
+
dateApi;
|
|
16
|
+
valueProvider;
|
|
17
|
+
//######################### protected properties #########################
|
|
18
|
+
/**
|
|
19
|
+
* Internal representation of current date time value
|
|
20
|
+
*/
|
|
21
|
+
internalValue;
|
|
33
22
|
//######################### public properties - implementation of DateTimeInput #########################
|
|
34
23
|
/**
|
|
35
24
|
* @inheritdoc
|
|
36
25
|
*/
|
|
37
|
-
|
|
38
|
-
return this.elementRef.nativeElement.value;
|
|
39
|
-
}
|
|
40
|
-
set rawValue(value) {
|
|
41
|
-
this.elementRef.nativeElement.value = value !== null && value !== void 0 ? value : '';
|
|
42
|
-
}
|
|
26
|
+
rawValue;
|
|
43
27
|
/**
|
|
44
28
|
* @inheritdoc
|
|
45
29
|
*/
|
|
@@ -47,13 +31,12 @@ export class DateTimeInputSADirective extends DateTimeBase {
|
|
|
47
31
|
return this.ɵValue;
|
|
48
32
|
}
|
|
49
33
|
set value(value) {
|
|
50
|
-
var _a;
|
|
51
34
|
//accepts all available formats
|
|
52
35
|
this.setInternalValue(value);
|
|
53
36
|
this.ɵValue = formatDateTime(this.internalValue, this.dateTimeData.valueFormat, this.dateTimeData.customFormat);
|
|
54
37
|
//not range value
|
|
55
38
|
if (!Array.isArray(this.internalValue)) {
|
|
56
|
-
this.rawValue =
|
|
39
|
+
this.rawValue = this.internalValue?.format(this.dateTimeData.customFormat);
|
|
57
40
|
}
|
|
58
41
|
else {
|
|
59
42
|
//TODO: add support for ranges
|
|
@@ -63,25 +46,42 @@ export class DateTimeInputSADirective extends DateTimeBase {
|
|
|
63
46
|
* @inheritdoc
|
|
64
47
|
*/
|
|
65
48
|
get disabled() {
|
|
49
|
+
//TODO: check if anchor
|
|
66
50
|
return this.elementRef.nativeElement.disabled;
|
|
67
51
|
}
|
|
68
52
|
set disabled(value) {
|
|
69
53
|
this.elementRef.nativeElement.disabled = value;
|
|
70
54
|
}
|
|
71
55
|
/**
|
|
72
|
-
*
|
|
56
|
+
* @inheritdoc
|
|
73
57
|
*/
|
|
74
58
|
get element() {
|
|
75
59
|
return this.elementRef.nativeElement;
|
|
76
60
|
}
|
|
61
|
+
/**
|
|
62
|
+
* @inheritdoc
|
|
63
|
+
*/
|
|
64
|
+
focus = new EventEmitter();
|
|
65
|
+
/**
|
|
66
|
+
* @inheritdoc
|
|
67
|
+
*/
|
|
68
|
+
blur = new EventEmitter();
|
|
69
|
+
//######################### constructors #########################
|
|
70
|
+
constructor(elementRef, dateApi, valueProvider) {
|
|
71
|
+
super();
|
|
72
|
+
this.elementRef = elementRef;
|
|
73
|
+
this.dateApi = dateApi;
|
|
74
|
+
this.valueProvider = valueProvider;
|
|
75
|
+
this.elementRef.nativeElement.addEventListener('click', this.handleClick);
|
|
76
|
+
this.elementRef.nativeElement.addEventListener('blur', this.handleBlur);
|
|
77
|
+
}
|
|
77
78
|
//######################### public methods - implementation of OnDestroy #########################
|
|
78
79
|
/**
|
|
79
80
|
* Called when component is destroyed
|
|
80
81
|
*/
|
|
81
82
|
ngOnDestroy() {
|
|
82
83
|
super.ngOnDestroy();
|
|
83
|
-
this.elementRef.nativeElement.removeEventListener('
|
|
84
|
-
this.elementRef.nativeElement.removeEventListener('focus', this.handleFocus);
|
|
84
|
+
this.elementRef.nativeElement.removeEventListener('click', this.handleClick);
|
|
85
85
|
this.elementRef.nativeElement.removeEventListener('blur', this.handleBlur);
|
|
86
86
|
}
|
|
87
87
|
//######################### protected methods #########################
|
|
@@ -118,25 +118,11 @@ export class DateTimeInputSADirective extends DateTimeBase {
|
|
|
118
118
|
}
|
|
119
119
|
}
|
|
120
120
|
}
|
|
121
|
-
/**
|
|
122
|
-
* Handles input event on input
|
|
123
|
-
*/
|
|
124
|
-
handleInput() {
|
|
125
|
-
if (!this.rawValue) {
|
|
126
|
-
this.internalValue = null;
|
|
127
|
-
this.ɵValue = null;
|
|
128
|
-
this.valueChange.next();
|
|
129
|
-
return;
|
|
130
|
-
}
|
|
131
|
-
this.setInternalValue(this.rawValue);
|
|
132
|
-
this.ɵValue = formatDateTime(this.internalValue, this.dateTimeData.valueFormat, this.dateTimeData.customFormat);
|
|
133
|
-
this.valueChange.next();
|
|
134
|
-
}
|
|
135
121
|
/**
|
|
136
122
|
* Handles focus event on input
|
|
137
123
|
* @param event - Event that occured
|
|
138
124
|
*/
|
|
139
|
-
|
|
125
|
+
handleClick(event) {
|
|
140
126
|
this.focus.emit(event);
|
|
141
127
|
}
|
|
142
128
|
/**
|
|
@@ -146,40 +132,35 @@ export class DateTimeInputSADirective extends DateTimeBase {
|
|
|
146
132
|
handleBlur(event) {
|
|
147
133
|
this.blur.emit(event);
|
|
148
134
|
}
|
|
135
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.1", ngImport: i0, type: ButtonDateTimeInputSADirective, deps: [{ token: i0.ElementRef }, { token: DATE_API }, { token: i1.DateValueProvider }], target: i0.ɵɵFactoryTarget.Directive });
|
|
136
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.1", type: ButtonDateTimeInputSADirective, isStandalone: true, selector: "button[dateTime][dateTimeInput],a[dateTime][dateTimeInput]", inputs: { value: "value" }, providers: [
|
|
137
|
+
{
|
|
138
|
+
provide: DATE_TIME_INPUT,
|
|
139
|
+
useExisting: forwardRef(() => ButtonDateTimeInputSADirective),
|
|
140
|
+
},
|
|
141
|
+
], exportAs: ["dateTime"], usesInheritance: true, ngImport: i0 });
|
|
149
142
|
}
|
|
150
|
-
DateTimeInputSADirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: DateTimeInputSADirective, deps: [{ token: i0.ElementRef }, { token: DATE_API }, { token: i1.DateValueProvider }], target: i0.ɵɵFactoryTarget.Directive });
|
|
151
|
-
DateTimeInputSADirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.0.4", type: DateTimeInputSADirective, isStandalone: true, selector: "input[dateTime][dateTimeInput]", providers: [
|
|
152
|
-
{
|
|
153
|
-
provide: DATE_TIME_INPUT,
|
|
154
|
-
useExisting: forwardRef(() => DateTimeInputSADirective),
|
|
155
|
-
},
|
|
156
|
-
], exportAs: ["dateTime"], usesInheritance: true, ngImport: i0 });
|
|
157
|
-
__decorate([
|
|
158
|
-
BindThis,
|
|
159
|
-
__metadata("design:type", Function),
|
|
160
|
-
__metadata("design:paramtypes", []),
|
|
161
|
-
__metadata("design:returntype", void 0)
|
|
162
|
-
], DateTimeInputSADirective.prototype, "handleInput", null);
|
|
163
143
|
__decorate([
|
|
164
144
|
BindThis,
|
|
165
145
|
__metadata("design:type", Function),
|
|
166
146
|
__metadata("design:paramtypes", [FocusEvent]),
|
|
167
147
|
__metadata("design:returntype", void 0)
|
|
168
|
-
],
|
|
148
|
+
], ButtonDateTimeInputSADirective.prototype, "handleClick", null);
|
|
169
149
|
__decorate([
|
|
170
150
|
BindThis,
|
|
171
151
|
__metadata("design:type", Function),
|
|
172
152
|
__metadata("design:paramtypes", [FocusEvent]),
|
|
173
153
|
__metadata("design:returntype", void 0)
|
|
174
|
-
],
|
|
175
|
-
|
|
154
|
+
], ButtonDateTimeInputSADirective.prototype, "handleBlur", null);
|
|
155
|
+
export { ButtonDateTimeInputSADirective };
|
|
156
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.1", ngImport: i0, type: ButtonDateTimeInputSADirective, decorators: [{
|
|
176
157
|
type: Directive,
|
|
177
158
|
args: [{
|
|
178
|
-
selector: '
|
|
159
|
+
selector: 'button[dateTime][dateTimeInput],a[dateTime][dateTimeInput]',
|
|
179
160
|
providers: [
|
|
180
161
|
{
|
|
181
162
|
provide: DATE_TIME_INPUT,
|
|
182
|
-
useExisting: forwardRef(() =>
|
|
163
|
+
useExisting: forwardRef(() => ButtonDateTimeInputSADirective),
|
|
183
164
|
},
|
|
184
165
|
],
|
|
185
166
|
standalone: true,
|
|
@@ -188,5 +169,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImpor
|
|
|
188
169
|
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: undefined, decorators: [{
|
|
189
170
|
type: Inject,
|
|
190
171
|
args: [DATE_API]
|
|
191
|
-
}] }, { type: i1.DateValueProvider }]; }, propDecorators: {
|
|
192
|
-
|
|
172
|
+
}] }, { type: i1.DateValueProvider }]; }, propDecorators: { value: [{
|
|
173
|
+
type: Input
|
|
174
|
+
}], handleClick: [], handleBlur: [] } });
|
|
175
|
+
//# sourceMappingURL=buttonDateTimeInput.directive.js.map
|