@imihai/angular-datetime-picker 21.0.0 → 21.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +3 -3
- package/projects/picker/package.json +1 -6
- package/LICENSE +0 -22
- package/README.md +0 -194
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@imihai/angular-datetime-picker",
|
|
3
|
-
"version": "21.0.
|
|
3
|
+
"version": "21.0.1",
|
|
4
4
|
"description": "Angular Date Time Picker",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"scripts": {
|
|
@@ -11,8 +11,8 @@
|
|
|
11
11
|
"test:ci": "ng test --watch=false --no-progress --browsers=ChromeHeadlessCI --code-coverage=true picker",
|
|
12
12
|
"lint": "ng lint",
|
|
13
13
|
"e2e": "ng e2e",
|
|
14
|
-
"build_lib_onWindows": "ng build picker --configuration production
|
|
15
|
-
"build_lib_onLinux": "ng build picker --configuration production
|
|
14
|
+
"build_lib_onWindows": "ng build picker --configuration production",
|
|
15
|
+
"build_lib_onLinux": "ng build picker --configuration production",
|
|
16
16
|
"build_css_onWindows": "mkdir \"dist/picker/assets/style\" && sass --style=compressed projects/picker/src/sass/picker.scss > dist/picker/assets/style/picker.min.css",
|
|
17
17
|
"build_css_onLinux": "mkdir -p dist/picker/assets/style && sass --style=compressed projects/picker/src/sass/picker.scss > dist/picker/assets/style/picker.min.css",
|
|
18
18
|
"npm_pack": "cd dist/picker && npm pack",
|
|
@@ -1,13 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@imihai/angular-datetime-picker",
|
|
3
|
-
"version": "21.0.
|
|
3
|
+
"version": "21.0.1",
|
|
4
4
|
"description": "Angular Date Time Picker",
|
|
5
5
|
"license": "MIT",
|
|
6
|
-
"repository": {
|
|
7
|
-
"type": "git",
|
|
8
|
-
"url": "https://github.com/danielmoncada/date-time-picker.git"
|
|
9
|
-
},
|
|
10
|
-
"homepage": "https://github.com/danielmoncada/date-time-picker",
|
|
11
6
|
"publishConfig": {
|
|
12
7
|
"access": "public"
|
|
13
8
|
},
|
package/LICENSE
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
The MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2014-2016 Daniel YK Pan.
|
|
4
|
-
Copyright (c) 2020 Daniel Moncada.
|
|
5
|
-
|
|
6
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
8
|
-
in the Software without restriction, including without limitation the rights
|
|
9
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
11
|
-
furnished to do so, subject to the following conditions:
|
|
12
|
-
|
|
13
|
-
The above copyright notice and this permission notice shall be included in
|
|
14
|
-
all copies or substantial portions of the Software.
|
|
15
|
-
|
|
16
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
22
|
-
THE SOFTWARE.
|
package/README.md
DELETED
|
@@ -1,194 +0,0 @@
|
|
|
1
|
-
# :date: :clock1: Angular Date/Time Picker
|
|
2
|
-
|
|
3
|
-
[](https://www.npmjs.com/package/@danielmoncada/angular-datetime-picker)
|
|
4
|
-
[](https://www.npmjs.com/package/@danielmoncada/angular-datetime-picker)
|
|
5
|
-
|
|
6
|
-
**The current version of this package supports Angular 21**
|
|
7
|
-
|
|
8
|
-
If you need support for other Angular version, see _Breaking Changes_ below.
|
|
9
|
-
|
|
10
|
-
## Breaking Changes
|
|
11
|
-
|
|
12
|
-
- Version 21.x.x is the official release for Angular 21 and it also supports Angular 20.
|
|
13
|
-
- Version 20.x.x is the official release for Angular 20 and it also supports Angular 19.
|
|
14
|
-
- Version 19.x.x >= no longer supports ng 18. If you need ng 18 support, stick with version 18.x.x.
|
|
15
|
-
- Version 18.x.x >= no longer supports ng 17. If you need ng 17 support, stick with version 17.x.x.
|
|
16
|
-
- Version 17.x.x >= no longer supports ng 16 - 13. If you need ng 16-13 support, stick with version 16.x.x.
|
|
17
|
-
- Version 14.x.x >= no longer supports < ng 13. If you need View Engine support, stick with version 13.x.x.
|
|
18
|
-
- Version 13.1.0+ no longer supports the `MomentJs` time adapter natively. If you want to use the MomentJs adapter, see [GitHub](https://github.com/danielmoncada/date-time-picker-moment-adapter) or [npm](https://www.npmjs.com/package/@danielmoncada/angular-datetime-picker-moment-adapter).
|
|
19
|
-
- If you need ng 8 support, please stick with: https://github.com/DanielYKPan/date-time-picker
|
|
20
|
-
|
|
21
|
-
## Description
|
|
22
|
-
|
|
23
|
-
Simple Angular date time picker. Online doc is [here](https://daniel-projects.firebaseapp.com/owlng/date-time-picker), Online demos(StackBlitz) are [here](https://stackblitz.com/edit/angular-vvp849) and [here](https://stackblitz.com/edit/angular-i7ykf5).
|
|
24
|
-
This picker is responsive design, so feel free to try it in your desktops, tablets and mobile devices.
|
|
25
|
-
|
|
26
|
-
## How to Use
|
|
27
|
-
|
|
28
|
-
1. Install with [npm](https://www.npmjs.com): `npm install @danielmoncada/angular-datetime-picker --save`
|
|
29
|
-
2. Add styles.
|
|
30
|
-
If you are using Angular CLI, you can add this to your styles.css:
|
|
31
|
-
```css
|
|
32
|
-
@import '@danielmoncada/angular-datetime-picker/assets/style/picker.min.css';
|
|
33
|
-
```
|
|
34
|
-
If you are not using the Angular CLI, you can include the picker.min.css via a `<link>` element in your index.html.
|
|
35
|
-
3. Add **OwlDateTimeModule** and **OwlNativeDateTimeModule** to your **@NgModule** like example below
|
|
36
|
-
|
|
37
|
-
```typescript
|
|
38
|
-
import { NgModule } from '@angular/core';
|
|
39
|
-
import { BrowserModule } from '@angular/platform-browser';
|
|
40
|
-
import { MyTestApp } from './my-test-app';
|
|
41
|
-
import { OwlDateTimeModule, OwlNativeDateTimeModule } from '@danielmoncada/angular-datetime-picker';
|
|
42
|
-
|
|
43
|
-
@NgModule({
|
|
44
|
-
imports: [BrowserModule, OwlDateTimeModule, OwlNativeDateTimeModule],
|
|
45
|
-
declarations: [MyTestApp],
|
|
46
|
-
bootstrap: [MyTestApp],
|
|
47
|
-
})
|
|
48
|
-
export class MyTestAppModule {}
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
4. Connecting a picker to an input and a trigger.
|
|
52
|
-
```html
|
|
53
|
-
<input [owlDateTime]="dt1" [owlDateTimeTrigger]="dt1" placeholder="Date Time" /> <owl-date-time #dt1></owl-date-time>
|
|
54
|
-
```
|
|
55
|
-
```html
|
|
56
|
-
<input [owlDateTime]="dt2" placeholder="Date Time" />
|
|
57
|
-
<span [owlDateTimeTrigger]="dt2"><i class="fa fa-calendar"></i></span>
|
|
58
|
-
<owl-date-time #dt2></owl-date-time>
|
|
59
|
-
```
|
|
60
|
-
The examples above are quite basic. The picker has much more features,
|
|
61
|
-
and you could learn more about those from [demo page](https://danielykpan.github.io/date-time-picker/).
|
|
62
|
-
|
|
63
|
-
## Choose a date implementation
|
|
64
|
-
|
|
65
|
-
The date-time picker was built to be date implementation agnostic.
|
|
66
|
-
Developers need to make sure to provide the appropriate pieces for the picker to work with their chosen implementation.
|
|
67
|
-
There are two pre-made modules, users need to import one of them or build your own one (learn more about this from [here](https://danielykpan.github.io/date-time-picker/#locale-formats)).
|
|
68
|
-
|
|
69
|
-
- `OwlNativeDateTimeModule` - support for native JavaScript Date object
|
|
70
|
-
- `OwlUnixTimestampDateTimeModule` - support for milliseconds since Epoch (number)
|
|
71
|
-
|
|
72
|
-
##### Date/Time Adapter Extensions
|
|
73
|
-
|
|
74
|
-
<img src="https://day.js.org/img/logo.png" width="50"/> https://day.js.org/
|
|
75
|
-
|
|
76
|
-
- `OwlDayJsDateTimeModule` - support for DayJs
|
|
77
|
-
- You must install an optional adapater to use this. see [here](https://github.com/danielmoncada/date-time-picker-dayjs-adapter), [npm](https://www.npmjs.com/package/@danielmoncada/angular-datetime-picker-dayjs-adapter)
|
|
78
|
-
|
|
79
|
-
<img src="https://avatars.githubusercontent.com/u/4129662?s=200&v=4" width="50"/> https://momentjs.com/
|
|
80
|
-
|
|
81
|
-
- `OwlMomentDateTimeModule` - support for MomentJs
|
|
82
|
-
- You must install an optional adapater to use this. see [here](https://github.com/danielmoncada/date-time-picker-moment-adapter), [npm](https://www.npmjs.com/package/@danielmoncada/angular-datetime-picker-moment-adapter)
|
|
83
|
-
|
|
84
|
-
## Properties for `owl-date-time`
|
|
85
|
-
|
|
86
|
-
| Name | Type | Required | Default | Description |
|
|
87
|
-
| :------------------ | :---------------------------- | :------- | :-------------------- | :------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
88
|
-
| `pickerType` | `both`, `calendar`, `timer` | Optional | `both` | Set the type of the dateTime picker. `both`: show both calendar and timer, `calendar`: only show calendar, `timer`: only show timer. |
|
|
89
|
-
| `pickerMode` | `popup`, `dialog` | Optional | `popup` | The style the picker would open as. |
|
|
90
|
-
| `startView` | `month`, `year`, `multi-year` | Optional | `month` | The view that the calendar should start in. |
|
|
91
|
-
| `yearOnly` | boolean | Optional | `false` | Restricts the calendar to only show the year and multi-year views for month selection. |
|
|
92
|
-
| `showCalendarWeeks` | boolean | Optional | `false` | Whether to show calendar weeks in the calendar. |
|
|
93
|
-
| `multiyearOnly` | boolean | Optional | `false` | Restricts the calendar to only show the multi-year view for year selection. |
|
|
94
|
-
| `startAt` | T/null | Optional | `null` | The moment to open the picker to initially. |
|
|
95
|
-
| `endAt` | T/null | Optional | `null` | The the default selected time for range calendar end time |
|
|
96
|
-
| `firstDayOfWeek` | number | Optional | `0` | Set the first day of week. Valid value is from 0 to 6. 0: Sunday - 6: Saturday |
|
|
97
|
-
| `showSecondsTimer` | boolean | Optional | `false` | When specify it to true, it would show a timer to configure the second's value |
|
|
98
|
-
| `hideOtherMonths` | boolean | Optional | `false` | Whether to hide dates in other months at the start or end of the current month |
|
|
99
|
-
| `hour12Timer` | boolean | Optional | `false` | When specify it to true, the timer would be in hour12 format mode |
|
|
100
|
-
| `stepHour` | number | Optional | `1` | Hours to change per step. |
|
|
101
|
-
| `stepMinute` | number | Optional | `1` | Minutes to change per step. |
|
|
102
|
-
| `stepSecond` | number | Optional | `1` | Seconds to change per step. |
|
|
103
|
-
| `scrollStrategy` | ScrollStrategy | Optional | `BlockScrollStrategy` | Define the scroll strategy when the picker is open. Learn more this from https://material.angular.io/cdk/overlay/overview#scroll-strategies. |
|
|
104
|
-
| `disabled` | boolean | Optional | `false` | When specify to true, it would disable the picker. |
|
|
105
|
-
| `backdropClass` | string/string[] | Optional | `null` | Custom class for the picker backdrop. |
|
|
106
|
-
| `panelClass` | string/string[] | Optional | `null` | Custom class for the picker overlay panel. |
|
|
107
|
-
|
|
108
|
-
## Events for `owl-date-time`
|
|
109
|
-
|
|
110
|
-
| Events | Parameter | Description |
|
|
111
|
-
| :------------------ | :-------- | :---------------------------------------------------------------------------------------------- |
|
|
112
|
-
| `beforePickerOpen` | null | Callback to invoke before the picker is opened |
|
|
113
|
-
| `afterPickerOpen` | null | Callback to invoke when the picker is opened |
|
|
114
|
-
| `afterPickerClosed` | null | Callback to invoke when the picker is closed. |
|
|
115
|
-
| `yearSelected` | T | Callback to invoke when the year is selected.This doesn't imply a change on the selected date. |
|
|
116
|
-
| `monthSelected` | T | Callback to invoke when the month is selected.This doesn't imply a change on the selected date. |
|
|
117
|
-
| `dateClicked` | T | Callback when the selected data changes. |
|
|
118
|
-
| `selectedChanged` | T | Callback when the currently selected data changes. |
|
|
119
|
-
| `userSelection` | null | Callback when any date is selected. |
|
|
120
|
-
|
|
121
|
-
## Properties for `input[owlDateTime]`
|
|
122
|
-
|
|
123
|
-
| Name | Type | Required | Default | Description |
|
|
124
|
-
| :------------------ | :---------------------------------------- | :------- | :------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
125
|
-
| `owlDateTime` | `OwlDateTimeComponent<T>` | Require | `null` | The date time picker that this input is associated with. |
|
|
126
|
-
| `owlDateTimeFilter` | `( date: T)=>boolean ` | Optional | `null` | A function to filter date time. |
|
|
127
|
-
| `disabled` | boolean | Optional | `false` | When specify to true, it would disable the picker's input. |
|
|
128
|
-
| `min` | `<T>` | Optional | `null` | The minimum valid date time. |
|
|
129
|
-
| `max` | `<T>` | Optional | `null` | The maximum valid date time. |
|
|
130
|
-
| `selectMode` | `single`, `range`, `rangeFrom`, `rangeTo` | Optional | `single` | Specify the picker's select mode. `single`: a single value allowed, `range`: allow users to select a range of date-time, `rangeFrom`: the input would only show the 'from' value and the picker could only selects 'from' value, `rangeTo`: the input would only show the 'to' value and the picker could only selects 'to' value. |
|
|
131
|
-
| `rangeSeparator` | string | Optional | `-` | The character to separate the 'from' and 'to' in input value in range selectMode. |
|
|
132
|
-
|
|
133
|
-
## Events for `input[owlDateTime]`
|
|
134
|
-
|
|
135
|
-
| Events | Parameter | Description |
|
|
136
|
-
| :--------------- | :--------------------------------------------------------------------- | :--------------------------------------------------------------------------------- |
|
|
137
|
-
| `dateTimeChange` | source: OwlDateTimeInput, value: input value, input: the input element | Callback to invoke when `change` event is fired on this `<input [owlDateTime]>` |
|
|
138
|
-
| `dateTimeInput` | source: OwlDateTimeInput, value: input value, input: the input element | Callback to invoke when an `input` event is fired on this `<input [owlDateTime]>`. |
|
|
139
|
-
|
|
140
|
-
## Properties for `[owlDateTimeTrigger]`
|
|
141
|
-
|
|
142
|
-
| Name | Type | Required | Default | Description |
|
|
143
|
-
| :------------------- | :------------------------ | :------- | :------ | :--------------------------------------------------------- |
|
|
144
|
-
| `owlDateTimeTrigger` | `OwlDateTimeComponent<T>` | Require | `null` | The date time picker that this trigger is associated with. |
|
|
145
|
-
| `disabled` | boolean | Optional | `false` | When specify to true, it would disable the trigger. |
|
|
146
|
-
|
|
147
|
-
## Properties for `[owlDateTimeTrigger]`
|
|
148
|
-
|
|
149
|
-
| Name | Type | Required | Default | Description |
|
|
150
|
-
| :------------------- | :------------------------ | :------- | :------ | :--------------------------------------------------------- |
|
|
151
|
-
| `owlDateTimeTrigger` | `OwlDateTimeComponent<T>` | Require | `null` | The date time picker that this trigger is associated with. |
|
|
152
|
-
| `disabled` | boolean | Optional | `false` | When specify to true, it would disable the trigger. |
|
|
153
|
-
|
|
154
|
-
## Properties for `owl-date-time-inline`
|
|
155
|
-
|
|
156
|
-
| Name | Type | Required | Default | Description |
|
|
157
|
-
| :------------------ | :---------------------------------------- | :------- | :------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
158
|
-
| `pickerType` | `both`, `calendar`, `timer` | Optional | `both` | Set the type of the dateTime picker. `both`: show both calendar and timer, `calendar`: only show calendar, `timer`: only show timer. |
|
|
159
|
-
| `startView` | `month`, `year`, `multi-year` | Optional | `month` | The view that the calendar should start in. |
|
|
160
|
-
| `startAt` | T/null | Optional | `null` | The moment to open the picker to initially. |
|
|
161
|
-
| `endAt` | T/null | Optional | `null` | The the default selected time for range calendar end time |
|
|
162
|
-
| `firstDayOfWeek` | number | Optional | `0` | Set the first day of week. Valid value is from 0 to 6. 0: Sunday - 6: Saturday |
|
|
163
|
-
| `showSecondsTimer` | boolean | Optional | `false` | When specify it to true, it would show a timer to configure the second's value |
|
|
164
|
-
| `hideOtherMonths` | boolean | Optional | `false` | Whether to hide dates in other months at the start or end of the current month |
|
|
165
|
-
| `hour12Timer` | boolean | Optional | `false` | When specify it to true, the timer would be in hour12 format mode |
|
|
166
|
-
| `stepHour` | number | Optional | `1` | Hours to change per step. |
|
|
167
|
-
| `stepMinute` | number | Optional | `1` | Minutes to change per step. |
|
|
168
|
-
| `stepSecond` | number | Optional | `1` | Seconds to change per step. |
|
|
169
|
-
| `disabled` | boolean | Optional | `false` | When specify to true, it would disable the picker. |
|
|
170
|
-
| `owlDateTimeFilter` | `( date: T)=>boolean ` | Optional | `null` | A function to filter date time. |
|
|
171
|
-
| `min` | `<T>` | Optional | `null` | The minimum valid date time. |
|
|
172
|
-
| `max` | `<T>` | Optional | `null` | The maximum valid date time. |
|
|
173
|
-
| `selectMode` | `single`, `range`, `rangeFrom`, `rangeTo` | Optional | `single` | Specify the picker's select mode. `single`: a single value allowed, `range`: allow users to select a range of date-time, `rangeFrom`: the input would only show the 'from' value and the picker could only selects 'from' value, `rangeTo`: the input would only show the 'to' value and the picker could only selects 'to' value. |
|
|
174
|
-
|
|
175
|
-
## Localization and DateTime Format
|
|
176
|
-
|
|
177
|
-
Localization for different languages and formats is defined by `OWL_DATE_TIME_LOCALE` and `OWL_DATE_TIME_FORMATS`. You could learn more about this from [here](https://danielykpan.github.io/date-time-picker#locale-formats).
|
|
178
|
-
|
|
179
|
-
## Dependencies
|
|
180
|
-
|
|
181
|
-
none
|
|
182
|
-
|
|
183
|
-
## Demo
|
|
184
|
-
|
|
185
|
-
- Online doc is [here](https://daniel-projects.firebaseapp.com/owlng/date-time-picker)
|
|
186
|
-
- Online demos (StackBlitz) are [here](https://stackblitz.com/edit/angular-vvp849) and [here](https://stackblitz.com/edit/angular-i7ykf5)
|
|
187
|
-
|
|
188
|
-
## License
|
|
189
|
-
|
|
190
|
-
- License: MIT
|
|
191
|
-
|
|
192
|
-
## Author
|
|
193
|
-
|
|
194
|
-
**Maintained and updated by Daniel Moncada, original implementatiom by Daniel Pan**
|