ngxsmk-datepicker 1.9.21 โ 1.9.22
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/README.md +1163 -1130
- package/fesm2022/ngxsmk-datepicker.mjs +1270 -917
- package/package.json +7 -1
- package/types/ngxsmk-datepicker.d.ts +163 -6
package/README.md
CHANGED
|
@@ -1,1130 +1,1163 @@
|
|
|
1
|
-
# **ngxsmk-datepicker** - Modern Angular Date Picker Component
|
|
2
|
-
|
|
3
|
-
[](https://www.npmjs.com/package/ngxsmk-datepicker)
|
|
4
|
-
[](https://angular.io/)
|
|
5
|
-
[](LICENSE)
|
|
6
|
-
[](https://bundlephobia.com/package/ngxsmk-datepicker)
|
|
7
|
-
[](https://www.npmjs.com/package/ngxsmk-datepicker)
|
|
8
|
-
|
|
9
|
-
**npm i ngxsmk-datepicker**
|
|
10
|
-
|
|
11
|
-
> **Stable Version**: `1.9.
|
|
12
|
-
|
|
13
|
-
**Latest Version**: Check [npm](https://www.npmjs.com/package/ngxsmk-datepicker) for the most recent release.
|
|
14
|
-
|
|
15
|
-
ngxsmk-datepicker โ A modern, powerful, and fully customizable date and date-range picker component designed for Angular 17+ and Ionic applications. Seamlessly integrates with both frameworks, offering a flexible, mobile-friendly UI and advanced features to enhance date selection experiences in your apps.
|
|
16
|
-
|
|
17
|
-
**SEO Keywords**: Angular datepicker, Angular date range picker, Angular calendar component, Angular 17 datepicker, Angular 18 datepicker, Angular 19 datepicker, Angular 20 datepicker, Angular 21 datepicker, TypeScript datepicker, standalone Angular component, Signal Forms datepicker, SSR compatible datepicker, zoneless Angular datepicker, lightweight datepicker, customizable datepicker, open source datepicker, free Angular datepicker, MIT license datepicker, accessible datepicker, responsive datepicker, mobile datepicker, touch-friendly datepicker, keyboard accessible datepicker, RTL datepicker, internationalized datepicker, i18n datepicker, localized datepicker, holiday calendar, date time picker, time selection, 12 hour clock, 24 hour clock, date validation, min max dates, disabled dates, date presets, recurring dates, timezone support
|
|
18
|
-
|
|
19
|
-
* Github: [https://github.com/NGXSMK/ngxsmk-datepicker](https://github.com/NGXSMK/ngxsmk-datepicker)
|
|
20
|
-
* **GitHub Pages Demo**: [https://ngxsmk.github.io/ngxsmk-datepicker/](https://ngxsmk.github.io/ngxsmk-datepicker/)
|
|
21
|
-
|
|
22
|
-
Built with Angular Signals for optimal performance and a clean, declarative API. The component is standalone and has zero dependencies, making it lightweight and easy to integrate into any project.
|
|
23
|
-
|
|
24
|
-
## ๐ท Screenshots
|
|
25
|
-
|
|
26
|
-
<p align="left">
|
|
27
|
-
<img src="https://github.com/NGXSMK/ngxsmk-datepicker/raw/main/projects/ngxsmk-datepicker/docs/1.png" alt="Angular Single Date Selection" width="420" />
|
|
28
|
-
|
|
29
|
-
<img src="https://github.com/NGXSMK/ngxsmk-datepicker/raw/main/projects/ngxsmk-datepicker/docs/2.png" alt="Angular Date Range Selection" width="420" />
|
|
30
|
-
|
|
31
|
-
<img src="https://github.com/NGXSMK/ngxsmk-datepicker/raw/main/projects/ngxsmk-datepicker/docs/3.png" alt="Angular Date Mobile Screen Playground" width="420" />
|
|
32
|
-
</p>
|
|
33
|
-
|
|
34
|
-
## **โจ Features**
|
|
35
|
-
|
|
36
|
-
* **Multiple Selection Modes**: Supports `single`, `range`, `multiple`, `week`, `month`, `quarter`, and `year` date selection.
|
|
37
|
-
* **Inline and Popover Display**: Can be rendered inline or as a popover with automatic mode detection.
|
|
38
|
-
* **Light and Dark Themes**: Includes built-in support for light and dark modes.
|
|
39
|
-
* **Holiday Marking**: Automatically mark and disable holidays using a custom `HolidayProvider`.
|
|
40
|
-
* **Holiday Tooltips**: Hover over holiday dates to see holiday names as tooltips.
|
|
41
|
-
* **Disabled Dates**: Disable specific dates by passing an array of date strings or Date objects.
|
|
42
|
-
* **Date & Time Selection**: Supports optional time inputs with configurable minute and second intervals.
|
|
43
|
-
* **Seconds Selection**: Optional seconds picker with `showSeconds` input and configurable `secondInterval`.
|
|
44
|
-
* **Time-Only Mode**: Display only time picker without calendar using `[timeOnly]="true"`.
|
|
45
|
-
* **12h/24h Time Support**: Uses internal 24-hour timekeeping but displays a user-friendly **12-hour clock with AM/PM toggle**.
|
|
46
|
-
* **Mobile-Native Integration**: Automatic native date picker on mobile devices with `useNativePicker` input.
|
|
47
|
-
* **Mobile Gestures**: Enhanced touch support with double-tap selection, swipe navigation, and haptic feedback.
|
|
48
|
-
* **Mobile Modal Styles**: Bottom sheet, center, and fullscreen modal options for mobile devices.
|
|
49
|
-
* **Predefined Date Ranges**: Offers quick selection of common ranges (e.g., "Last 7 Days").
|
|
50
|
-
* **Advanced Localization (i18n)**: Automatically handles month/weekday names and week start days based on the browser's locale.
|
|
51
|
-
* **Previous Month Context**: Shows last few days of previous month for better date selection context.
|
|
52
|
-
* **Custom Styling**: All component elements are prefixed with `ngxsmk-` and themeable via CSS custom properties.
|
|
53
|
-
* **Zero Dependencies**: The component is standalone and lightweight.
|
|
54
|
-
* **Signal Forms Support**: First-class support for Angular 21+ Signal Forms with `[field]` input (experimental feature).
|
|
55
|
-
* **SSR Compatible**: Fully optimized for server-side rendering with Angular Universal.
|
|
56
|
-
* **Zoneless Support**: Works with or without Zone.js for optimal performance. Compatible with Angular 21's default zoneless setup.
|
|
57
|
-
* **Angular 21 Ready**: Full compatibility with Angular 21 new features including Signal Forms, Vitest, and zoneless by default.
|
|
58
|
-
* **E2E Testing**: Comprehensive Playwright-based end-to-end testing infrastructure.
|
|
59
|
-
* **Performance Optimized**: Lazy loading calendar months, intelligent caching, and virtual scrolling infrastructure.
|
|
60
|
-
* **
|
|
61
|
-
* **Enhanced Keyboard Navigation**: Extended keyboard shortcuts (Y for yesterday, N for tomorrow, W for next week) with custom shortcut support.
|
|
62
|
-
* **Modern UI/UX**: Polished design with improved spacing, shadows, animations, and accessibility.
|
|
63
|
-
* **Reduced Motion Support**: Respects `prefers-reduced-motion` for accessibility.
|
|
64
|
-
* **Comprehensive Testing**: Full test coverage with 353+ tests covering keyboard navigation, time handling, SSR, RTL, touch gestures, and edge cases.
|
|
65
|
-
* **CI/CD Integration**: Automated testing and coverage reporting via GitHub Actions.
|
|
66
|
-
* **Customizable Calendar Views**: Year-picker, decade-picker, timeline view, and time-slider view for diverse use cases.
|
|
67
|
-
* **Modern Demo App**: Beautiful demo application with glassmorphism effects, gradient themes, and responsive design.
|
|
68
|
-
|
|
69
|
-
## **๐ Compatibility**
|
|
70
|
-
|
|
71
|
-
For detailed compatibility information, see [docs/COMPATIBILITY.md](docs/COMPATIBILITY.md).
|
|
72
|
-
|
|
73
|
-
### Quick Reference
|
|
74
|
-
|
|
75
|
-
| Angular Version | Status | Core Features | Signal Forms | SSR | Zoneless |
|
|
76
|
-
|----------------|--------|---------------|--------------|-----|----------|
|
|
77
|
-
| Angular 17 | โ
Fully Supported | โ
All | โ | โ
| โ
|
|
|
78
|
-
| Angular 18 | โ
Fully Supported | โ
All | โ | โ
| โ
|
|
|
79
|
-
| Angular 19 | โ
Fully Supported | โ
All | โ | โ
| โ
|
|
|
80
|
-
| Angular 20 | โ
Fully Supported | โ
All | โ | โ
| โ
|
|
|
81
|
-
| Angular 21 | โ
Fully Supported | โ
All | โ
| โ
| โ
| **Officially Released** |
|
|
82
|
-
| Angular 22+ | ๐ Future Support | โ
All | โ
| โ
| โ
|
|
|
83
|
-
|
|
84
|
-
**Zone.js**: Optional - The library works with or without Zone.js (zoneless apps supported)
|
|
85
|
-
|
|
86
|
-
**SSR**: โ
Fully compatible with Angular Universal and server-side rendering
|
|
87
|
-
|
|
88
|
-
**Peer Dependencies**: `@angular/core >=17.0.0 <24.0.0`
|
|
89
|
-
|
|
90
|
-
## **๐ Installation**
|
|
91
|
-
|
|
92
|
-
Install the package using npm:
|
|
93
|
-
|
|
94
|
-
npm install ngxsmk-datepicker
|
|
95
|
-
|
|
96
|
-
## **Usage**
|
|
97
|
-
|
|
98
|
-
ngxsmk-datepicker is a standalone component, so you can import it directly into your component or module.
|
|
99
|
-
|
|
100
|
-
### Signal Forms (Angular 21)
|
|
101
|
-
|
|
102
|
-
You can bind directly to a writable Signal using standard two-way binding. This works seamlessly alongside traditional Reactive Forms.
|
|
103
|
-
|
|
104
|
-
```ts
|
|
105
|
-
import { signal } from '@angular/core';
|
|
106
|
-
import { DatepickerValue } from 'ngxsmk-datepicker';
|
|
107
|
-
|
|
108
|
-
export class MyComponent {
|
|
109
|
-
dateSig = signal<DatepickerValue>(null);
|
|
110
|
-
}
|
|
111
|
-
```
|
|
112
|
-
|
|
113
|
-
```html
|
|
114
|
-
<ngxsmk-datepicker
|
|
115
|
-
mode="single"
|
|
116
|
-
[value]="dateSig()"
|
|
117
|
-
(valueChange)="dateSig.set($event)">
|
|
118
|
-
</ngxsmk-datepicker>
|
|
119
|
-
|
|
120
|
-
<p>Signal value: {{ dateSig() | json }}</p>
|
|
121
|
-
```
|
|
122
|
-
|
|
123
|
-
This pattern is also compatible with computed/linked signals produced by `httpResource`, enabling powerful data flows with Angular 21.
|
|
124
|
-
|
|
125
|
-
### Signal Forms with `[field]` Input (Angular 21+)
|
|
126
|
-
|
|
127
|
-
For direct integration with Angular Signal Forms, use the `[field]` input:
|
|
128
|
-
|
|
129
|
-
```typescript
|
|
130
|
-
import { Component, signal, form, objectSchema } from '@angular/core';
|
|
131
|
-
import { NgxsmkDatepickerComponent } from 'ngxsmk-datepicker';
|
|
132
|
-
|
|
133
|
-
@Component({
|
|
134
|
-
selector: 'app-form',
|
|
135
|
-
standalone: true,
|
|
136
|
-
imports: [NgxsmkDatepickerComponent],
|
|
137
|
-
template: `
|
|
138
|
-
<form>
|
|
139
|
-
<ngxsmk-datepicker
|
|
140
|
-
[field]="myForm.dateInQuestion"
|
|
141
|
-
mode="single"
|
|
142
|
-
placeholder="Select a date">
|
|
143
|
-
</ngxsmk-datepicker>
|
|
144
|
-
</form>
|
|
145
|
-
`
|
|
146
|
-
})
|
|
147
|
-
export class FormComponent {
|
|
148
|
-
localObject = signal({ dateInQuestion: new Date() });
|
|
149
|
-
|
|
150
|
-
myForm = form(this.localObject, objectSchema({
|
|
151
|
-
dateInQuestion: objectSchema<Date>()
|
|
152
|
-
}));
|
|
153
|
-
}
|
|
154
|
-
```
|
|
155
|
-
|
|
156
|
-
The `[field]` input provides automatic two-way binding with signal forms - no manual event handling needed!
|
|
157
|
-
|
|
158
|
-
### Documentation
|
|
159
|
-
|
|
160
|
-
- **[
|
|
161
|
-
- **[
|
|
162
|
-
- **[
|
|
163
|
-
- **[SSR
|
|
164
|
-
- **[
|
|
165
|
-
- **[
|
|
166
|
-
- **[
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
import {
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
'
|
|
186
|
-
'
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
[
|
|
210
|
-
[
|
|
211
|
-
[
|
|
212
|
-
[
|
|
213
|
-
[
|
|
214
|
-
[
|
|
215
|
-
[
|
|
216
|
-
[
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
[
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
'2025-
|
|
246
|
-
'2025-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
}
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
[
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
import {
|
|
278
|
-
import {
|
|
279
|
-
import {
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
</form>
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
|
452
|
-
|
|
453
|
-
|
|
|
454
|
-
|
|
|
455
|
-
|
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
|
460
|
-
|
|
461
|
-
|
|
|
462
|
-
|
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
##
|
|
529
|
-
|
|
530
|
-
The
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
- **
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
- **
|
|
627
|
-
- **
|
|
628
|
-
- **
|
|
629
|
-
- **
|
|
630
|
-
- **
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
-
|
|
671
|
-
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
#
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
-
|
|
693
|
-
-
|
|
694
|
-
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
- **
|
|
716
|
-
- **
|
|
717
|
-
-
|
|
718
|
-
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
-
|
|
741
|
-
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
-
|
|
774
|
-
|
|
775
|
-
-
|
|
776
|
-
-
|
|
777
|
-
-
|
|
778
|
-
-
|
|
779
|
-
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
-
|
|
789
|
-
-
|
|
790
|
-
-
|
|
791
|
-
-
|
|
792
|
-
-
|
|
793
|
-
-
|
|
794
|
-
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
-
|
|
798
|
-
-
|
|
799
|
-
-
|
|
800
|
-
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
-
|
|
804
|
-
-
|
|
805
|
-
-
|
|
806
|
-
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
-
|
|
810
|
-
-
|
|
811
|
-
-
|
|
812
|
-
-
|
|
813
|
-
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
-
|
|
817
|
-
-
|
|
818
|
-
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
-
|
|
825
|
-
-
|
|
826
|
-
-
|
|
827
|
-
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
-
|
|
832
|
-
- ๐ **
|
|
833
|
-
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
-
|
|
852
|
-
-
|
|
853
|
-
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
### **v1.9.
|
|
878
|
-
- ๐ **
|
|
879
|
-
-
|
|
880
|
-
-
|
|
881
|
-
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
### **v1.9.
|
|
889
|
-
- ๐ **
|
|
890
|
-
-
|
|
891
|
-
-
|
|
892
|
-
-
|
|
893
|
-
-
|
|
894
|
-
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
-
|
|
898
|
-
|
|
899
|
-
- Updated
|
|
900
|
-
-
|
|
901
|
-
-
|
|
902
|
-
|
|
903
|
-
### **v1.9.
|
|
904
|
-
-
|
|
905
|
-
-
|
|
906
|
-
-
|
|
907
|
-
-
|
|
908
|
-
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
-
|
|
913
|
-
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
-
|
|
919
|
-
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
-
|
|
931
|
-
- Fixed
|
|
932
|
-
-
|
|
933
|
-
-
|
|
934
|
-
-
|
|
935
|
-
|
|
936
|
-
### **v1.9.
|
|
937
|
-
-
|
|
938
|
-
-
|
|
939
|
-
-
|
|
940
|
-
-
|
|
941
|
-
-
|
|
942
|
-
-
|
|
943
|
-
-
|
|
944
|
-
- Improved
|
|
945
|
-
-
|
|
946
|
-
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
-
|
|
951
|
-
-
|
|
952
|
-
-
|
|
953
|
-
-
|
|
954
|
-
-
|
|
955
|
-
-
|
|
956
|
-
|
|
957
|
-
-
|
|
958
|
-
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
-
|
|
965
|
-
-
|
|
966
|
-
-
|
|
967
|
-
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
-
|
|
971
|
-
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
-
|
|
975
|
-
-
|
|
976
|
-
-
|
|
977
|
-
-
|
|
978
|
-
-
|
|
979
|
-
-
|
|
980
|
-
-
|
|
981
|
-
-
|
|
982
|
-
-
|
|
983
|
-
-
|
|
984
|
-
-
|
|
985
|
-
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
-
|
|
989
|
-
-
|
|
990
|
-
-
|
|
991
|
-
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
-
|
|
999
|
-
-
|
|
1000
|
-
-
|
|
1001
|
-
-
|
|
1002
|
-
-
|
|
1003
|
-
-
|
|
1004
|
-
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
-
|
|
1009
|
-
-
|
|
1010
|
-
-
|
|
1011
|
-
-
|
|
1012
|
-
-
|
|
1013
|
-
-
|
|
1014
|
-
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
-
|
|
1018
|
-
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
-
|
|
1022
|
-
- ๐จ **
|
|
1023
|
-
- ๐ **
|
|
1024
|
-
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
-
|
|
1028
|
-
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
-
|
|
1035
|
-
-
|
|
1036
|
-
-
|
|
1037
|
-
-
|
|
1038
|
-
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
-
|
|
1045
|
-
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
-
|
|
1053
|
-
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
-
|
|
1057
|
-
- ๐งน **Code
|
|
1058
|
-
|
|
1059
|
-
### **v1.4.
|
|
1060
|
-
-
|
|
1061
|
-
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
-
|
|
1071
|
-
-
|
|
1072
|
-
-
|
|
1073
|
-
-
|
|
1074
|
-
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
-
|
|
1090
|
-
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
-
|
|
1094
|
-
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
-
|
|
1113
|
-
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
-
|
|
1127
|
-
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1
|
+
# **ngxsmk-datepicker** - Modern Angular Date Picker Component
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/ngxsmk-datepicker)
|
|
4
|
+
[](https://angular.io/)
|
|
5
|
+
[](LICENSE)
|
|
6
|
+
[](https://bundlephobia.com/package/ngxsmk-datepicker)
|
|
7
|
+
[](https://www.npmjs.com/package/ngxsmk-datepicker)
|
|
8
|
+
|
|
9
|
+
**npm i ngxsmk-datepicker**
|
|
10
|
+
|
|
11
|
+
> **Stable Version**: `1.9.22` is the current stable release. For production use, install the latest version from npm.
|
|
12
|
+
|
|
13
|
+
**Latest Version**: Check [npm](https://www.npmjs.com/package/ngxsmk-datepicker) for the most recent release.
|
|
14
|
+
|
|
15
|
+
ngxsmk-datepicker โ A modern, powerful, and fully customizable date and date-range picker component designed for Angular 17+ and Ionic applications. Seamlessly integrates with both frameworks, offering a flexible, mobile-friendly UI and advanced features to enhance date selection experiences in your apps.
|
|
16
|
+
|
|
17
|
+
**SEO Keywords**: Angular datepicker, Angular date range picker, Angular calendar component, Angular 17 datepicker, Angular 18 datepicker, Angular 19 datepicker, Angular 20 datepicker, Angular 21 datepicker, TypeScript datepicker, standalone Angular component, Signal Forms datepicker, SSR compatible datepicker, zoneless Angular datepicker, lightweight datepicker, customizable datepicker, open source datepicker, free Angular datepicker, MIT license datepicker, accessible datepicker, responsive datepicker, mobile datepicker, touch-friendly datepicker, keyboard accessible datepicker, RTL datepicker, internationalized datepicker, i18n datepicker, localized datepicker, holiday calendar, date time picker, time selection, 12 hour clock, 24 hour clock, date validation, min max dates, disabled dates, date presets, recurring dates, timezone support
|
|
18
|
+
|
|
19
|
+
* Github: [https://github.com/NGXSMK/ngxsmk-datepicker](https://github.com/NGXSMK/ngxsmk-datepicker)
|
|
20
|
+
* **GitHub Pages Demo**: [https://ngxsmk.github.io/ngxsmk-datepicker/](https://ngxsmk.github.io/ngxsmk-datepicker/)
|
|
21
|
+
|
|
22
|
+
Built with Angular Signals for optimal performance and a clean, declarative API. The component is standalone and has zero dependencies, making it lightweight and easy to integrate into any project.
|
|
23
|
+
|
|
24
|
+
## ๐ท Screenshots
|
|
25
|
+
|
|
26
|
+
<p align="left">
|
|
27
|
+
<img src="https://github.com/NGXSMK/ngxsmk-datepicker/raw/main/projects/ngxsmk-datepicker/docs/1.png" alt="Angular Single Date Selection" width="420" />
|
|
28
|
+
|
|
29
|
+
<img src="https://github.com/NGXSMK/ngxsmk-datepicker/raw/main/projects/ngxsmk-datepicker/docs/2.png" alt="Angular Date Range Selection" width="420" />
|
|
30
|
+
|
|
31
|
+
<img src="https://github.com/NGXSMK/ngxsmk-datepicker/raw/main/projects/ngxsmk-datepicker/docs/3.png" alt="Angular Date Mobile Screen Playground" width="420" />
|
|
32
|
+
</p>
|
|
33
|
+
|
|
34
|
+
## **โจ Features**
|
|
35
|
+
|
|
36
|
+
* **Multiple Selection Modes**: Supports `single`, `range`, `multiple`, `week`, `month`, `quarter`, and `year` date selection.
|
|
37
|
+
* **Inline and Popover Display**: Can be rendered inline or as a popover with automatic mode detection.
|
|
38
|
+
* **Light and Dark Themes**: Includes built-in support for light and dark modes.
|
|
39
|
+
* **Holiday Marking**: Automatically mark and disable holidays using a custom `HolidayProvider`.
|
|
40
|
+
* **Holiday Tooltips**: Hover over holiday dates to see holiday names as tooltips.
|
|
41
|
+
* **Disabled Dates**: Disable specific dates by passing an array of date strings or Date objects.
|
|
42
|
+
* **Date & Time Selection**: Supports optional time inputs with configurable minute and second intervals.
|
|
43
|
+
* **Seconds Selection**: Optional seconds picker with `showSeconds` input and configurable `secondInterval`.
|
|
44
|
+
* **Time-Only Mode**: Display only time picker without calendar using `[timeOnly]="true"`.
|
|
45
|
+
* **12h/24h Time Support**: Uses internal 24-hour timekeeping but displays a user-friendly **12-hour clock with AM/PM toggle**.
|
|
46
|
+
* **Mobile-Native Integration**: Automatic native date picker on mobile devices with `useNativePicker` input.
|
|
47
|
+
* **Mobile Gestures**: Enhanced touch support with double-tap selection, swipe navigation, and haptic feedback.
|
|
48
|
+
* **Mobile Modal Styles**: Bottom sheet, center, and fullscreen modal options for mobile devices.
|
|
49
|
+
* **Predefined Date Ranges**: Offers quick selection of common ranges (e.g., "Last 7 Days").
|
|
50
|
+
* **Advanced Localization (i18n)**: Automatically handles month/weekday names and week start days based on the browser's locale.
|
|
51
|
+
* **Previous Month Context**: Shows last few days of previous month for better date selection context.
|
|
52
|
+
* **Custom Styling**: All component elements are prefixed with `ngxsmk-` and themeable via CSS custom properties.
|
|
53
|
+
* **Zero Dependencies**: The component is standalone and lightweight.
|
|
54
|
+
* **Signal Forms Support**: First-class support for Angular 21+ Signal Forms with `[field]` input (experimental feature).
|
|
55
|
+
* **SSR Compatible**: Fully optimized for server-side rendering with Angular Universal.
|
|
56
|
+
* **Zoneless Support**: Works with or without Zone.js for optimal performance. Compatible with Angular 21's default zoneless setup.
|
|
57
|
+
* **Angular 21 Ready**: Full compatibility with Angular 21 new features including Signal Forms, Vitest, and zoneless by default.
|
|
58
|
+
* **E2E Testing**: Comprehensive Playwright-based end-to-end testing infrastructure.
|
|
59
|
+
* **Performance Optimized**: Lazy loading calendar months, intelligent caching, and virtual scrolling infrastructure.
|
|
60
|
+
* **Plugin Architecture**: Powerful plugin system with hooks for rendering, validation, keyboard shortcuts, formatting, and events. Create reusable plugins and extend functionality without modifying core code.
|
|
61
|
+
* **Enhanced Keyboard Navigation**: Extended keyboard shortcuts (Y for yesterday, N for tomorrow, W for next week) with custom shortcut support.
|
|
62
|
+
* **Modern UI/UX**: Polished design with improved spacing, shadows, animations, and accessibility.
|
|
63
|
+
* **Reduced Motion Support**: Respects `prefers-reduced-motion` for accessibility.
|
|
64
|
+
* **Comprehensive Testing**: Full test coverage with 353+ tests covering keyboard navigation, time handling, SSR, RTL, touch gestures, and edge cases.
|
|
65
|
+
* **CI/CD Integration**: Automated testing and coverage reporting via GitHub Actions.
|
|
66
|
+
* **Customizable Calendar Views**: Year-picker, decade-picker, timeline view, and time-slider view for diverse use cases.
|
|
67
|
+
* **Modern Demo App**: Beautiful demo application with glassmorphism effects, gradient themes, and responsive design.
|
|
68
|
+
|
|
69
|
+
## **๐ Compatibility**
|
|
70
|
+
|
|
71
|
+
For detailed compatibility information, see [docs/COMPATIBILITY.md](docs/COMPATIBILITY.md).
|
|
72
|
+
|
|
73
|
+
### Quick Reference
|
|
74
|
+
|
|
75
|
+
| Angular Version | Status | Core Features | Signal Forms | SSR | Zoneless |
|
|
76
|
+
|----------------|--------|---------------|--------------|-----|----------|
|
|
77
|
+
| Angular 17 | โ
Fully Supported | โ
All | โ | โ
| โ
|
|
|
78
|
+
| Angular 18 | โ
Fully Supported | โ
All | โ | โ
| โ
|
|
|
79
|
+
| Angular 19 | โ
Fully Supported | โ
All | โ | โ
| โ
|
|
|
80
|
+
| Angular 20 | โ
Fully Supported | โ
All | โ | โ
| โ
|
|
|
81
|
+
| Angular 21 | โ
Fully Supported | โ
All | โ
| โ
| โ
| **Officially Released** |
|
|
82
|
+
| Angular 22+ | ๐ Future Support | โ
All | โ
| โ
| โ
|
|
|
83
|
+
|
|
84
|
+
**Zone.js**: Optional - The library works with or without Zone.js (zoneless apps supported)
|
|
85
|
+
|
|
86
|
+
**SSR**: โ
Fully compatible with Angular Universal and server-side rendering
|
|
87
|
+
|
|
88
|
+
**Peer Dependencies**: `@angular/core >=17.0.0 <24.0.0`
|
|
89
|
+
|
|
90
|
+
## **๐ Installation**
|
|
91
|
+
|
|
92
|
+
Install the package using npm:
|
|
93
|
+
|
|
94
|
+
npm install ngxsmk-datepicker
|
|
95
|
+
|
|
96
|
+
## **Usage**
|
|
97
|
+
|
|
98
|
+
ngxsmk-datepicker is a standalone component, so you can import it directly into your component or module.
|
|
99
|
+
|
|
100
|
+
### Signal Forms (Angular 21)
|
|
101
|
+
|
|
102
|
+
You can bind directly to a writable Signal using standard two-way binding. This works seamlessly alongside traditional Reactive Forms.
|
|
103
|
+
|
|
104
|
+
```ts
|
|
105
|
+
import { signal } from '@angular/core';
|
|
106
|
+
import { DatepickerValue } from 'ngxsmk-datepicker';
|
|
107
|
+
|
|
108
|
+
export class MyComponent {
|
|
109
|
+
dateSig = signal<DatepickerValue>(null);
|
|
110
|
+
}
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
```html
|
|
114
|
+
<ngxsmk-datepicker
|
|
115
|
+
mode="single"
|
|
116
|
+
[value]="dateSig()"
|
|
117
|
+
(valueChange)="dateSig.set($event)">
|
|
118
|
+
</ngxsmk-datepicker>
|
|
119
|
+
|
|
120
|
+
<p>Signal value: {{ dateSig() | json }}</p>
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
This pattern is also compatible with computed/linked signals produced by `httpResource`, enabling powerful data flows with Angular 21.
|
|
124
|
+
|
|
125
|
+
### Signal Forms with `[field]` Input (Angular 21+)
|
|
126
|
+
|
|
127
|
+
For direct integration with Angular Signal Forms, use the `[field]` input:
|
|
128
|
+
|
|
129
|
+
```typescript
|
|
130
|
+
import { Component, signal, form, objectSchema } from '@angular/core';
|
|
131
|
+
import { NgxsmkDatepickerComponent } from 'ngxsmk-datepicker';
|
|
132
|
+
|
|
133
|
+
@Component({
|
|
134
|
+
selector: 'app-form',
|
|
135
|
+
standalone: true,
|
|
136
|
+
imports: [NgxsmkDatepickerComponent],
|
|
137
|
+
template: `
|
|
138
|
+
<form>
|
|
139
|
+
<ngxsmk-datepicker
|
|
140
|
+
[field]="myForm.dateInQuestion"
|
|
141
|
+
mode="single"
|
|
142
|
+
placeholder="Select a date">
|
|
143
|
+
</ngxsmk-datepicker>
|
|
144
|
+
</form>
|
|
145
|
+
`
|
|
146
|
+
})
|
|
147
|
+
export class FormComponent {
|
|
148
|
+
localObject = signal({ dateInQuestion: new Date() });
|
|
149
|
+
|
|
150
|
+
myForm = form(this.localObject, objectSchema({
|
|
151
|
+
dateInQuestion: objectSchema<Date>()
|
|
152
|
+
}));
|
|
153
|
+
}
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
The `[field]` input provides automatic two-way binding with signal forms - no manual event handling needed!
|
|
157
|
+
|
|
158
|
+
### Documentation
|
|
159
|
+
|
|
160
|
+
- **[Plugin Architecture](./docs/PLUGIN-ARCHITECTURE.md)** - Complete guide to the plugin architecture and hook system
|
|
161
|
+
- **[Signals Integration Guide](./docs/signals.md)** - Complete guide to using signals with the datepicker
|
|
162
|
+
- **[Signal Forms Guide](./docs/signal-forms.md)** - Deep dive into Signal Forms integration
|
|
163
|
+
- **[SSR Guide](./docs/ssr.md)** - Server-side rendering setup and best practices
|
|
164
|
+
- **[SSR Example](./docs/SSR-EXAMPLE.md)** - Complete Angular Universal example with hydration notes
|
|
165
|
+
- **[Extension Points Guide](./docs/extension-points.md)** - Customization hooks and extension points
|
|
166
|
+
- **[Theme Tokens Reference](./docs/THEME-TOKENS.md)** - Complete CSS custom properties reference with examples
|
|
167
|
+
- **[API Documentation](./docs/API.md)** - Complete public API reference
|
|
168
|
+
|
|
169
|
+
#### **1. Import the Component**
|
|
170
|
+
|
|
171
|
+
In your component file (e.g., app.component.ts), import NgxsmkDatepickerComponent.
|
|
172
|
+
|
|
173
|
+
import { Component } from '@angular/core';
|
|
174
|
+
import { NgxsmkDatepickerComponent, DateRange, HolidayProvider } from 'ngxsmk-datepicker';
|
|
175
|
+
|
|
176
|
+
@Component({
|
|
177
|
+
selector: 'app-root',
|
|
178
|
+
standalone: true,
|
|
179
|
+
imports: [NgxsmkDatepickerComponent],
|
|
180
|
+
templateUrl: './app.component.html',
|
|
181
|
+
})
|
|
182
|
+
export class AppComponent {
|
|
183
|
+
// Example for predefined ranges
|
|
184
|
+
public myRanges: DateRange = {
|
|
185
|
+
'Today': [new Date(), new Date()],
|
|
186
|
+
'Last 7 Days': [new Date(new Date().setDate(new Date().getDate() - 6)), new Date()],
|
|
187
|
+
'This Month': [new Date(new Date().getFullYear(), new Date().getMonth(), 1), new Date(new Date().getFullYear(), new Date().getMonth() + 1, 0)],
|
|
188
|
+
};
|
|
189
|
+
|
|
190
|
+
// Example for disabling weekends
|
|
191
|
+
isWeekend = (date: Date): boolean => {
|
|
192
|
+
const day = date.getDay();
|
|
193
|
+
return day === 0 || day === 6; // Sunday or Saturday
|
|
194
|
+
};
|
|
195
|
+
|
|
196
|
+
onDateChange(value: Date | { start: Date; end: Date } | Date[]) {
|
|
197
|
+
console.log('Date changed:', value);
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
#### **2. Add it to Your Template**
|
|
202
|
+
|
|
203
|
+
Use the `<ngxsmk-datepicker>` selector in your HTML template.
|
|
204
|
+
|
|
205
|
+
```html
|
|
206
|
+
<h2>Advanced Date Range Picker</h2>
|
|
207
|
+
|
|
208
|
+
<ngxsmk-datepicker
|
|
209
|
+
[mode]="'range'"
|
|
210
|
+
[ranges]="myRanges"
|
|
211
|
+
[showTime]="true"
|
|
212
|
+
[minuteInterval]="15"
|
|
213
|
+
[minDate]="today"
|
|
214
|
+
[isInvalidDate]="isWeekend"
|
|
215
|
+
[locale]="'en-US'"
|
|
216
|
+
[theme]="'light'"
|
|
217
|
+
[inline]="'auto'"
|
|
218
|
+
(valueChange)="onDateChange($event)"
|
|
219
|
+
></ngxsmk-datepicker>
|
|
220
|
+
|
|
221
|
+
#### **3. Disabled Dates Example**
|
|
222
|
+
|
|
223
|
+
Disable specific dates by passing an array of date strings or Date objects:
|
|
224
|
+
|
|
225
|
+
```typescript
|
|
226
|
+
// In your component
|
|
227
|
+
disabledDates = ['10/21/2025', '08/21/2025', '10/15/2025', '10/8/2025', '10/3/2025'];
|
|
228
|
+
|
|
229
|
+
// In your template
|
|
230
|
+
<ngxsmk-datepicker
|
|
231
|
+
[mode]="'single'"
|
|
232
|
+
[disabledDates]="disabledDates"
|
|
233
|
+
placeholder="Select a date">
|
|
234
|
+
</ngxsmk-datepicker>
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
#### **4. Holiday Tooltips Example**
|
|
238
|
+
|
|
239
|
+
Holiday dates automatically show tooltips when you hover over them:
|
|
240
|
+
|
|
241
|
+
```typescript
|
|
242
|
+
// Holiday provider with tooltips
|
|
243
|
+
class MyHolidayProvider implements HolidayProvider {
|
|
244
|
+
private holidays: { [key: string]: string } = {
|
|
245
|
+
'2025-01-01': 'New Year\'s Day',
|
|
246
|
+
'2025-07-04': 'Independence Day',
|
|
247
|
+
'2025-12-25': 'Christmas Day',
|
|
248
|
+
};
|
|
249
|
+
|
|
250
|
+
isHoliday(date: Date): boolean {
|
|
251
|
+
const key = this.formatDateKey(date);
|
|
252
|
+
return !!this.holidays[key];
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
getHolidayLabel(date: Date): string | null {
|
|
256
|
+
const key = this.formatDateKey(date);
|
|
257
|
+
return this.holidays[key] || null;
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
// In your template
|
|
262
|
+
<ngxsmk-datepicker
|
|
263
|
+
[holidayProvider]="holidayProvider"
|
|
264
|
+
[disableHolidays]="false"
|
|
265
|
+
placeholder="Hover over holidays to see tooltips">
|
|
266
|
+
</ngxsmk-datepicker>
|
|
267
|
+
```
|
|
268
|
+
|
|
269
|
+
## **๐ Framework Integration**
|
|
270
|
+
|
|
271
|
+
### **Angular Material Form Fields**
|
|
272
|
+
|
|
273
|
+
Integrate with Angular Material's form field components for a seamless Material Design experience. Works with both standalone and non-standalone components:
|
|
274
|
+
|
|
275
|
+
**Standalone Components:**
|
|
276
|
+
```typescript
|
|
277
|
+
import { Component } from '@angular/core';
|
|
278
|
+
import { FormControl, FormGroup, ReactiveFormsModule } from '@angular/forms';
|
|
279
|
+
import { MatFormFieldModule } from '@angular/material/form-field';
|
|
280
|
+
import { MatInputModule } from '@angular/material/input';
|
|
281
|
+
import { NgxsmkDatepickerComponent } from 'ngxsmk-datepicker';
|
|
282
|
+
|
|
283
|
+
@Component({
|
|
284
|
+
selector: 'app-material-form',
|
|
285
|
+
standalone: true,
|
|
286
|
+
imports: [
|
|
287
|
+
ReactiveFormsModule,
|
|
288
|
+
MatFormFieldModule,
|
|
289
|
+
MatInputModule,
|
|
290
|
+
NgxsmkDatepickerComponent
|
|
291
|
+
],
|
|
292
|
+
template: `
|
|
293
|
+
<form [formGroup]="myForm">
|
|
294
|
+
<mat-form-field appearance="outline">
|
|
295
|
+
<mat-label>Select Date</mat-label>
|
|
296
|
+
<ngxsmk-datepicker
|
|
297
|
+
mode="single"
|
|
298
|
+
formControlName="date"
|
|
299
|
+
placeholder="Choose a date">
|
|
300
|
+
</ngxsmk-datepicker>
|
|
301
|
+
</mat-form-field>
|
|
302
|
+
</form>
|
|
303
|
+
`
|
|
304
|
+
})
|
|
305
|
+
export class MaterialFormComponent {
|
|
306
|
+
myForm = new FormGroup({
|
|
307
|
+
date: new FormControl<Date | null>(null)
|
|
308
|
+
});
|
|
309
|
+
}
|
|
310
|
+
```
|
|
311
|
+
|
|
312
|
+
**Non-Standalone Components (NgModules):**
|
|
313
|
+
```typescript
|
|
314
|
+
import { NgModule } from '@angular/core';
|
|
315
|
+
import { MAT_FORM_FIELD_CONTROL } from '@angular/material/form-field';
|
|
316
|
+
import { NgxsmkDatepickerComponent, provideMaterialFormFieldControl } from 'ngxsmk-datepicker';
|
|
317
|
+
import { MatFormFieldModule } from '@angular/material/form-field';
|
|
318
|
+
import { MatInputModule } from '@angular/material/input';
|
|
319
|
+
import { ReactiveFormsModule } from '@angular/forms';
|
|
320
|
+
|
|
321
|
+
@NgModule({
|
|
322
|
+
imports: [
|
|
323
|
+
NgxsmkDatepickerComponent,
|
|
324
|
+
MatFormFieldModule,
|
|
325
|
+
MatInputModule,
|
|
326
|
+
ReactiveFormsModule
|
|
327
|
+
],
|
|
328
|
+
providers: [provideMaterialFormFieldControl(MAT_FORM_FIELD_CONTROL)]
|
|
329
|
+
})
|
|
330
|
+
export class MyModule { }
|
|
331
|
+
```
|
|
332
|
+
|
|
333
|
+
**With Date Range:**
|
|
334
|
+
```html
|
|
335
|
+
<mat-form-field appearance="fill">
|
|
336
|
+
<mat-label>Date Range</mat-label>
|
|
337
|
+
<ngxsmk-datepicker
|
|
338
|
+
mode="range"
|
|
339
|
+
[showTime]="true"
|
|
340
|
+
formControlName="dateRange">
|
|
341
|
+
</ngxsmk-datepicker>
|
|
342
|
+
</mat-form-field>
|
|
343
|
+
```
|
|
344
|
+
|
|
345
|
+
### **Ionic Components**
|
|
346
|
+
|
|
347
|
+
Works seamlessly with Ionic form components and follows Ionic design patterns:
|
|
348
|
+
|
|
349
|
+
```typescript
|
|
350
|
+
import { Component } from '@angular/core';
|
|
351
|
+
import { FormControl, FormGroup, ReactiveFormsModule } from '@angular/forms';
|
|
352
|
+
import { IonItem, IonLabel, IonInput } from '@ionic/angular/standalone';
|
|
353
|
+
import { NgxsmkDatepickerComponent } from 'ngxsmk-datepicker';
|
|
354
|
+
|
|
355
|
+
@Component({
|
|
356
|
+
selector: 'app-ionic-form',
|
|
357
|
+
standalone: true,
|
|
358
|
+
imports: [
|
|
359
|
+
ReactiveFormsModule,
|
|
360
|
+
IonItem,
|
|
361
|
+
IonLabel,
|
|
362
|
+
IonInput,
|
|
363
|
+
NgxsmkDatepickerComponent
|
|
364
|
+
],
|
|
365
|
+
template: `
|
|
366
|
+
<form [formGroup]="myForm">
|
|
367
|
+
<ion-item>
|
|
368
|
+
<ion-label position="stacked">Appointment Date</ion-label>
|
|
369
|
+
<ngxsmk-datepicker
|
|
370
|
+
mode="single"
|
|
371
|
+
formControlName="appointmentDate"
|
|
372
|
+
placeholder="Select date">
|
|
373
|
+
</ngxsmk-datepicker>
|
|
374
|
+
</ion-item>
|
|
375
|
+
</form>
|
|
376
|
+
`
|
|
377
|
+
})
|
|
378
|
+
export class IonicFormComponent {
|
|
379
|
+
myForm = new FormGroup({
|
|
380
|
+
appointmentDate: new FormControl<Date | null>(null)
|
|
381
|
+
});
|
|
382
|
+
}
|
|
383
|
+
```
|
|
384
|
+
|
|
385
|
+
**With Ionic Datetime Styling:**
|
|
386
|
+
```html
|
|
387
|
+
<ion-item>
|
|
388
|
+
<ion-label>Check-in / Check-out</ion-label>
|
|
389
|
+
<ngxsmk-datepicker
|
|
390
|
+
mode="range"
|
|
391
|
+
[theme]="'light'"
|
|
392
|
+
formControlName="bookingDates">
|
|
393
|
+
</ngxsmk-datepicker>
|
|
394
|
+
</ion-item>
|
|
395
|
+
```
|
|
396
|
+
|
|
397
|
+
### **Plain HTML Inputs**
|
|
398
|
+
|
|
399
|
+
Use with standard HTML form inputs for maximum flexibility:
|
|
400
|
+
|
|
401
|
+
```typescript
|
|
402
|
+
import { Component } from '@angular/core';
|
|
403
|
+
import { FormControl, FormGroup, ReactiveFormsModule } from '@angular/forms';
|
|
404
|
+
import { NgxsmkDatepickerComponent } from 'ngxsmk-datepicker';
|
|
405
|
+
|
|
406
|
+
@Component({
|
|
407
|
+
selector: 'app-plain-form',
|
|
408
|
+
standalone: true,
|
|
409
|
+
imports: [ReactiveFormsModule, NgxsmkDatepickerComponent],
|
|
410
|
+
template: `
|
|
411
|
+
<form [formGroup]="myForm">
|
|
412
|
+
<label for="birthdate">Birth Date</label>
|
|
413
|
+
<ngxsmk-datepicker
|
|
414
|
+
id="birthdate"
|
|
415
|
+
mode="single"
|
|
416
|
+
formControlName="birthdate"
|
|
417
|
+
placeholder="MM/DD/YYYY">
|
|
418
|
+
</ngxsmk-datepicker>
|
|
419
|
+
|
|
420
|
+
<button type="submit">Submit</button>
|
|
421
|
+
</form>
|
|
422
|
+
`
|
|
423
|
+
})
|
|
424
|
+
export class PlainFormComponent {
|
|
425
|
+
myForm = new FormGroup({
|
|
426
|
+
birthdate: new FormControl<Date | null>(null)
|
|
427
|
+
});
|
|
428
|
+
}
|
|
429
|
+
```
|
|
430
|
+
|
|
431
|
+
**With Native HTML5 Validation:**
|
|
432
|
+
```html
|
|
433
|
+
<form [formGroup]="myForm">
|
|
434
|
+
<div class="form-group">
|
|
435
|
+
<label for="event-date">Event Date *</label>
|
|
436
|
+
<ngxsmk-datepicker
|
|
437
|
+
id="event-date"
|
|
438
|
+
mode="single"
|
|
439
|
+
formControlName="eventDate"
|
|
440
|
+
[minDate]="today"
|
|
441
|
+
required>
|
|
442
|
+
</ngxsmk-datepicker>
|
|
443
|
+
</div>
|
|
444
|
+
</form>
|
|
445
|
+
```
|
|
446
|
+
|
|
447
|
+
## **โ๏ธ API Reference**
|
|
448
|
+
|
|
449
|
+
### **Inputs**
|
|
450
|
+
|
|
451
|
+
| Property | Type | Default | Description |
|
|
452
|
+
|:---------------|:---------------------------------------------------|:----------------------|:--------------------------------------------------------------------------------------------------------------|
|
|
453
|
+
| mode | 'single' \| 'range' \| 'multiple' | 'single' | The selection mode. |
|
|
454
|
+
| inline | boolean \| 'always' \| 'auto' | false | Controls the display mode. `true` or `'always'` for inline, `'auto'` for responsive. |
|
|
455
|
+
| locale | string | navigator.language | Sets the locale for language and regional formatting (e.g., 'en-US', 'de-DE'). |
|
|
456
|
+
| theme | 'light' \| 'dark' | 'light' | The color theme. |
|
|
457
|
+
| showRanges | boolean | true | If true, displays the predefined ranges panel when in 'range' mode. |
|
|
458
|
+
| minDate | DateInput | null | The earliest selectable date. |
|
|
459
|
+
| maxDate | DateInput | null | The latest selectable date. |
|
|
460
|
+
| isInvalidDate | (date: Date) => boolean | () => false | A function to programmatically disable specific dates. |
|
|
461
|
+
| ranges | DateRange | null | An object of predefined date ranges. |
|
|
462
|
+
| minuteInterval | number | 1 | Interval for minute dropdown options. |
|
|
463
|
+
| showTime | boolean | false | Enables the hour/minute/AM/PM selection section. |
|
|
464
|
+
| timeOnly | boolean | false | Display time picker only (no calendar). Automatically enables `showTime`. Perfect for time selection scenarios. |
|
|
465
|
+
| value | DatepickerValue | null | Programmatic value setting. Set the datepicker value from code (useful for server-side API data). |
|
|
466
|
+
| startAt | DateInput | null | The date to initially center the calendar view on. |
|
|
467
|
+
| holidayProvider| HolidayProvider | null | An object that provides holiday information. |
|
|
468
|
+
| disableHolidays| boolean | false | If true, disables holiday dates from being selected. |
|
|
469
|
+
| disabledDates | (string \| Date)[] | [] | Array of dates to disable. Supports both string dates (MM/DD/YYYY) and Date objects. |
|
|
470
|
+
| weekStart | number \| null | null | Override week start day (0=Sunday, 1=Monday, etc.). If null, uses locale-based week start. |
|
|
471
|
+
| yearRange | number | 10 | Number of years before/after current year to show in year dropdown. |
|
|
472
|
+
| clearLabel | string | 'Clear' | Custom label for the clear button. |
|
|
473
|
+
| closeLabel | string | 'Close' | Custom label for the close button. |
|
|
474
|
+
| prevMonthAriaLabel | string | 'Previous month' | Aria label for previous month navigation button. |
|
|
475
|
+
| nextMonthAriaLabel | string | 'Next month' | Aria label for next month navigation button. |
|
|
476
|
+
| clearAriaLabel | string | 'Clear selection' | Aria label for clear button. |
|
|
477
|
+
| closeAriaLabel | string | 'Close calendar' | Aria label for close button. |
|
|
478
|
+
| classes | { wrapper?, inputGroup?, input?, popover?, container?, calendar?, header?, navPrev?, navNext?, dayCell?, footer?, clearBtn?, closeBtn? } | undefined | Tailwind-friendly class overrides for theming. |
|
|
479
|
+
|
|
480
|
+
### **Outputs**
|
|
481
|
+
|
|
482
|
+
| Event | Payload | Description |
|
|
483
|
+
|:------------|:---------------------------------------------------|:-----------------------------------------------------------------|
|
|
484
|
+
| valueChange | DatepickerValue | Emits the newly selected date, range, or array of dates. |
|
|
485
|
+
| action | { type: string; payload?: any } | Emits various events like `dateSelected`, `timeChanged`, etc. |
|
|
486
|
+
|
|
487
|
+
## **๐จ Theming**
|
|
488
|
+
|
|
489
|
+
### CSS Variables
|
|
490
|
+
|
|
491
|
+
You can easily customize the colors of the datepicker by overriding the CSS custom properties in your own stylesheet.
|
|
492
|
+
|
|
493
|
+
```css
|
|
494
|
+
ngxsmk-datepicker {
|
|
495
|
+
--datepicker-primary-color: #d9267d;
|
|
496
|
+
--datepicker-primary-contrast: #ffffff;
|
|
497
|
+
--datepicker-range-background: #fce7f3;
|
|
498
|
+
}
|
|
499
|
+
```
|
|
500
|
+
|
|
501
|
+
### Tailwind/ngClass Support
|
|
502
|
+
|
|
503
|
+
For Tailwind CSS or custom class-based theming, use the `classes` input:
|
|
504
|
+
|
|
505
|
+
```html
|
|
506
|
+
<ngxsmk-datepicker
|
|
507
|
+
mode="single"
|
|
508
|
+
[classes]="{
|
|
509
|
+
inputGroup: 'rounded-lg border',
|
|
510
|
+
input: 'px-3 py-2 text-sm',
|
|
511
|
+
popover: 'shadow-2xl',
|
|
512
|
+
dayCell: 'hover:bg-indigo-50',
|
|
513
|
+
footer: 'flex justify-end gap-2',
|
|
514
|
+
clearBtn: 'btn btn-ghost',
|
|
515
|
+
closeBtn: 'btn btn-primary'
|
|
516
|
+
}">
|
|
517
|
+
</ngxsmk-datepicker>
|
|
518
|
+
```
|
|
519
|
+
|
|
520
|
+
### Dark Theme
|
|
521
|
+
|
|
522
|
+
To enable the dark theme, simply bind the theme input:
|
|
523
|
+
|
|
524
|
+
```html
|
|
525
|
+
<ngxsmk-datepicker [theme]="'dark'"></ngxsmk-datepicker>
|
|
526
|
+
```
|
|
527
|
+
|
|
528
|
+
## **๐ Localization**
|
|
529
|
+
|
|
530
|
+
The `locale` input controls all internationalization. It automatically formats month names, weekday names, and sets the first day of the week.
|
|
531
|
+
|
|
532
|
+
```html
|
|
533
|
+
<ngxsmk-datepicker [locale]="'de-DE'"></ngxsmk-datepicker>
|
|
534
|
+
|
|
535
|
+
<ngxsmk-datepicker [locale]="'fr-FR'"></ngxsmk-datepicker>
|
|
536
|
+
```
|
|
537
|
+
|
|
538
|
+
The datepicker automatically detects the browser's locale if not specified. For SSR applications, explicitly set the locale to ensure consistent rendering on both server and client.
|
|
539
|
+
|
|
540
|
+
## **๐ฅ๏ธ Server-Side Rendering (SSR)**
|
|
541
|
+
|
|
542
|
+
The datepicker is fully compatible with Angular Universal and server-side rendering:
|
|
543
|
+
|
|
544
|
+
- โ
All browser APIs are platform-checked
|
|
545
|
+
- โ
No `window` or `document` access during initialization
|
|
546
|
+
- โ
Works with partial hydration
|
|
547
|
+
- โ
Compatible with zoneless applications
|
|
548
|
+
|
|
549
|
+
See the [SSR Guide](./projects/ngxsmk-datepicker/docs/ssr.md) for detailed setup instructions.
|
|
550
|
+
|
|
551
|
+
## **โจ๏ธ Keyboard Navigation**
|
|
552
|
+
|
|
553
|
+
The datepicker supports full keyboard navigation for accessibility:
|
|
554
|
+
|
|
555
|
+
### Built-in Shortcuts
|
|
556
|
+
|
|
557
|
+
- **Arrow Keys** (โ โ โ โ): Navigate between dates
|
|
558
|
+
- **Page Up/Down**: Navigate months (Shift + Page Up/Down for years)
|
|
559
|
+
- **Home/End**: Jump to first/last day of month
|
|
560
|
+
- **Enter/Space**: Select focused date
|
|
561
|
+
- **Escape**: Close calendar (popover mode)
|
|
562
|
+
- **T**: Select today's date
|
|
563
|
+
- **Y**: Select yesterday
|
|
564
|
+
- **N**: Select tomorrow
|
|
565
|
+
- **W**: Select next week (7 days from today)
|
|
566
|
+
- **Tab**: Navigate between interactive elements
|
|
567
|
+
|
|
568
|
+
### Custom Keyboard Shortcuts
|
|
569
|
+
|
|
570
|
+
You can add custom keyboard shortcuts using the `hooks` input or `customShortcuts` input:
|
|
571
|
+
|
|
572
|
+
```typescript
|
|
573
|
+
import { DatepickerHooks, KeyboardShortcutContext } from 'ngxsmk-datepicker';
|
|
574
|
+
|
|
575
|
+
const myHooks: DatepickerHooks = {
|
|
576
|
+
handleShortcut: (event, context) => {
|
|
577
|
+
if (event.ctrlKey && event.key === '1') {
|
|
578
|
+
// Custom action
|
|
579
|
+
return true; // Handled
|
|
580
|
+
}
|
|
581
|
+
return false; // Use default
|
|
582
|
+
}
|
|
583
|
+
};
|
|
584
|
+
```
|
|
585
|
+
|
|
586
|
+
```html
|
|
587
|
+
<ngxsmk-datepicker
|
|
588
|
+
[hooks]="myHooks"
|
|
589
|
+
[customShortcuts]="shortcuts"
|
|
590
|
+
mode="single">
|
|
591
|
+
</ngxsmk-datepicker>
|
|
592
|
+
```
|
|
593
|
+
|
|
594
|
+
All date cells are keyboard accessible with proper ARIA attributes for screen readers.
|
|
595
|
+
|
|
596
|
+
See [Extension Points Guide](./projects/ngxsmk-datepicker/docs/extension-points.md) for detailed customization options.
|
|
597
|
+
|
|
598
|
+
## **๐ Performance Optimizations**
|
|
599
|
+
|
|
600
|
+
This library has been optimized for maximum performance:
|
|
601
|
+
|
|
602
|
+
* **30% Smaller Bundle**: Optimized build configuration and tree-shaking
|
|
603
|
+
* **40% Faster Rendering**: OnPush change detection strategy with proper triggers
|
|
604
|
+
* **60% Faster Selection**: Memoized date comparisons and debounced operations
|
|
605
|
+
* **Zero Dependencies**: Standalone component with no external dependencies
|
|
606
|
+
* **Tree-shakable**: Only import what you need
|
|
607
|
+
* **Memory Efficient**: Cache size limits prevent memory leaks
|
|
608
|
+
* **Hardware Accelerated**: CSS optimizations for smooth animations
|
|
609
|
+
* **Mobile Optimized**: Touch-friendly interactions and responsive design
|
|
610
|
+
|
|
611
|
+
## **๐ Bug Fixes & Improvements**
|
|
612
|
+
|
|
613
|
+
### **Critical Bug Fixes in v1.4.15:**
|
|
614
|
+
- โ
**Change Detection**: Fixed OnPush change detection issues with proper `markForCheck()` triggers
|
|
615
|
+
- โ
**Date Comparison**: Fixed null safety issues in date range comparisons
|
|
616
|
+
- โ
**Memory Leaks**: Added cache size limits to prevent memory leaks
|
|
617
|
+
- โ
**Type Safety**: Improved TypeScript types and null safety checks
|
|
618
|
+
- โ
**Mobile UX**: Enhanced mobile interactions and touch feedback
|
|
619
|
+
- โ
**Performance**: Optimized template bindings with memoized functions
|
|
620
|
+
- โ
**Accessibility**: Better focus states and keyboard navigation
|
|
621
|
+
- โ
**Build System**: Improved build configuration and optimization
|
|
622
|
+
|
|
623
|
+
### **Performance Enhancements:**
|
|
624
|
+
- ๐ **Optimized Bundle Size**: Main bundle ~127KB (source maps excluded from published package)
|
|
625
|
+
- ๐ **40% Faster Rendering**: Enhanced OnPush change detection
|
|
626
|
+
- ๐ **60% Faster Selection**: Memoized date comparisons
|
|
627
|
+
- ๐ **Memory Efficient**: Cache size limits prevent memory leaks
|
|
628
|
+
- ๐ **Hardware Accelerated**: CSS optimizations for smooth animations
|
|
629
|
+
- ๐ **Better Tree-Shaking**: Optimized TypeScript compiler settings for smaller output
|
|
630
|
+
- ๐ **Production Optimized**: Source maps automatically removed from production builds
|
|
631
|
+
|
|
632
|
+
## **๐ฑ Demo Application**
|
|
633
|
+
|
|
634
|
+
A comprehensive demo application is included to showcase all features with a modern, polished UI:
|
|
635
|
+
|
|
636
|
+
```bash
|
|
637
|
+
# Clone the repository
|
|
638
|
+
git clone https://github.com/NGXSMK/ngxsmk-datepicker.git
|
|
639
|
+
cd ngxsmk-datepicker
|
|
640
|
+
|
|
641
|
+
# Install dependencies
|
|
642
|
+
npm install
|
|
643
|
+
|
|
644
|
+
# Run the demo app
|
|
645
|
+
npm start
|
|
646
|
+
```
|
|
647
|
+
|
|
648
|
+
The demo includes:
|
|
649
|
+
- **Modern UI Design**: Beautiful glassmorphism effects, gradient themes, and polished visual hierarchy
|
|
650
|
+
- **Responsive Navigation**: Modern navbar with search, theme toggle, and mobile-friendly menu
|
|
651
|
+
- **Enhanced Sidebar**: Redesigned documentation sidebar with smooth animations and visual indicators
|
|
652
|
+
- **Signal Forms (Angular 21)** with writable signal binding examples
|
|
653
|
+
- **Theming** with CSS variables and Tailwind classes examples
|
|
654
|
+
- **Customization & A11y** with weekStart, yearRange, labels, and aria examples
|
|
655
|
+
- **Holiday Provider Integration** with US holidays
|
|
656
|
+
- **Single Date Selection** with weekend restrictions
|
|
657
|
+
- **Inline Range Picker** with toggle controls
|
|
658
|
+
- **Date Range with Time** selection
|
|
659
|
+
- **Multiple Date Selection** with action tracking
|
|
660
|
+
- **Programmatic Value Setting** for all selection modes
|
|
661
|
+
- **Theme Toggle** (Light/Dark mode) with automatic system preference detection
|
|
662
|
+
- **Customizable Calendar Views**: Year-picker, decade-picker, timeline view, and time-slider view
|
|
663
|
+
|
|
664
|
+
## **๐ง Development**
|
|
665
|
+
|
|
666
|
+
### **GitHub Actions**
|
|
667
|
+
|
|
668
|
+
The project uses GitHub Actions for automated deployment:
|
|
669
|
+
|
|
670
|
+
- **Deploy Demo App**: Automatically deploys the demo application to GitHub Pages on pushes to `main`/`master` branches
|
|
671
|
+
- Workflow: `.github/workflows/deploy-demo.yml`
|
|
672
|
+
- Triggers: Push to main/master or manual workflow dispatch
|
|
673
|
+
- Builds and deploys the demo app to GitHub Pages
|
|
674
|
+
|
|
675
|
+
### **Building the Library**
|
|
676
|
+
|
|
677
|
+
```bash
|
|
678
|
+
# Build the library (development)
|
|
679
|
+
npm run build
|
|
680
|
+
|
|
681
|
+
# Build optimized production version
|
|
682
|
+
# - Removes source maps automatically
|
|
683
|
+
# - Optimized TypeScript compilation
|
|
684
|
+
# - Enhanced tree-shaking
|
|
685
|
+
npm run build:optimized
|
|
686
|
+
|
|
687
|
+
# Analyze bundle size (excludes source maps)
|
|
688
|
+
npm run build:analyze
|
|
689
|
+
```
|
|
690
|
+
|
|
691
|
+
**Build Output:**
|
|
692
|
+
- Main bundle: `dist/ngxsmk-datepicker/fesm2022/ngxsmk-datepicker.mjs` (~127KB)
|
|
693
|
+
- Type definitions: `dist/ngxsmk-datepicker/index.d.ts`
|
|
694
|
+
- Source maps: Automatically removed from production builds
|
|
695
|
+
|
|
696
|
+
### **Running Tests**
|
|
697
|
+
|
|
698
|
+
```bash
|
|
699
|
+
# Run all tests (library + demo app)
|
|
700
|
+
npm test
|
|
701
|
+
|
|
702
|
+
# Run library tests only
|
|
703
|
+
npx ng test ngxsmk-datepicker --no-watch --browsers=ChromeHeadless
|
|
704
|
+
|
|
705
|
+
# Run specific test file
|
|
706
|
+
npx ng test ngxsmk-datepicker --include="**/issue-13.spec.ts"
|
|
707
|
+
|
|
708
|
+
# Run tests in watch mode
|
|
709
|
+
npm test -- --watch
|
|
710
|
+
```
|
|
711
|
+
|
|
712
|
+
### **Code Quality Improvements**
|
|
713
|
+
|
|
714
|
+
The library now includes:
|
|
715
|
+
- โ
**TypeScript Strict Mode**: Enhanced type safety
|
|
716
|
+
- โ
**ESLint Configuration**: Code quality enforcement
|
|
717
|
+
- โ
**Performance Monitoring**: Built-in performance metrics
|
|
718
|
+
- โ
**Memory Leak Prevention**: Cache size limits and cleanup
|
|
719
|
+
- โ
**Accessibility Testing**: WCAG compliance checks
|
|
720
|
+
- โ
**Mobile Testing**: Touch interaction validation
|
|
721
|
+
|
|
722
|
+
## **๐ฆ Package Structure**
|
|
723
|
+
|
|
724
|
+
```
|
|
725
|
+
ngxsmk-datepicker/
|
|
726
|
+
โโโ projects/
|
|
727
|
+
โ โโโ ngxsmk-datepicker/ # Main library
|
|
728
|
+
โ โโโ demo-app/ # Demo application
|
|
729
|
+
โโโ dist/ # Built packages
|
|
730
|
+
โโโ docs/ # Documentation
|
|
731
|
+
โโโ scripts/ # Build scripts
|
|
732
|
+
```
|
|
733
|
+
|
|
734
|
+
## **๐ฏ Browser Support**
|
|
735
|
+
|
|
736
|
+
- **Chrome** 90+
|
|
737
|
+
- **Firefox** 88+
|
|
738
|
+
- **Safari** 14+
|
|
739
|
+
- **Edge** 90+
|
|
740
|
+
- **Mobile Safari** 14+
|
|
741
|
+
- **Chrome Mobile** 90+
|
|
742
|
+
|
|
743
|
+
## **๐บ๏ธ Roadmap**
|
|
744
|
+
|
|
745
|
+
Check out our [Roadmap](ROADMAP.md) to see planned features, improvements, and how you can contribute. We're always looking for contributors, especially for issues labeled `good-first-issue` and `help-wanted`!
|
|
746
|
+
|
|
747
|
+
## **๐ค Contributions**
|
|
748
|
+
|
|
749
|
+
We welcome and appreciate contributions from the community! Whether it's reporting a bug, suggesting a new feature, or submitting code, your help is valuable.
|
|
750
|
+
|
|
751
|
+
### **Development Setup**
|
|
752
|
+
|
|
753
|
+
1. **Fork the repository** on GitHub
|
|
754
|
+
2. **Clone your fork** to your local machine
|
|
755
|
+
3. **Install dependencies**: `npm install`
|
|
756
|
+
4. **Run the demo app**: `npm start`
|
|
757
|
+
5. **Create a feature branch** for your changes
|
|
758
|
+
6. **Commit your changes** following conventional commits
|
|
759
|
+
7. **Submit a Pull Request** to the main branch
|
|
760
|
+
|
|
761
|
+
### **Contribution Guidelines**
|
|
762
|
+
|
|
763
|
+
- Follow the existing code style
|
|
764
|
+
- Add tests for new features
|
|
765
|
+
- Update documentation as needed
|
|
766
|
+
- Ensure all tests pass
|
|
767
|
+
- Follow conventional commit messages
|
|
768
|
+
|
|
769
|
+
## **๐ Changelog**
|
|
770
|
+
|
|
771
|
+
### **v1.9.22** (Stable)
|
|
772
|
+
- ๐ **Version Update**: Updated to version 1.9.22
|
|
773
|
+
- โ
**Stable Release**: Version 1.9.22 is the current stable version
|
|
774
|
+
- ๐ **Fixed**: Form control value initialization issue - datepicker now correctly displays month from form control values
|
|
775
|
+
- Fixed calendar month display when using Reactive Forms with initial values
|
|
776
|
+
- Added proper signal updates and change detection in `writeValue()` method
|
|
777
|
+
- ๐ **Fixed**: Locale week start detection for en-GB and other European locales
|
|
778
|
+
- Added fallback logic for locales where `Intl.Locale.weekInfo` is not available
|
|
779
|
+
- Now correctly returns Monday (1) for en-GB and other European locales
|
|
780
|
+
|
|
781
|
+
### **v1.9.21** (Stable)
|
|
782
|
+
- ๐ **Version Update**: Updated to version 1.9.21
|
|
783
|
+
- โ
**Stable Release**: Version 1.9.21 is the current stable version
|
|
784
|
+
- ๐ฑ **Mobile-Specific Features**: Comprehensive mobile optimization
|
|
785
|
+
- Native date picker integration with automatic mobile detection
|
|
786
|
+
- Bottom sheet modal with swipe-to-dismiss gestures
|
|
787
|
+
- Enhanced touch gestures (double-tap, swipe navigation)
|
|
788
|
+
- Haptic feedback support for better mobile UX
|
|
789
|
+
- Mobile-optimized animations and keyboard handling
|
|
790
|
+
- ๐ฏ **Advanced Selection Modes**: Extended selection capabilities
|
|
791
|
+
- Week selection mode for selecting entire weeks
|
|
792
|
+
- Month selection mode for selecting full months
|
|
793
|
+
- Quarter selection mode for quarterly selections
|
|
794
|
+
- Year selection mode for annual date ranges
|
|
795
|
+
- โฑ๏ธ **Enhanced Time Selection**: Improved time picker
|
|
796
|
+
- Seconds selection with configurable intervals
|
|
797
|
+
- Better time picker UX and controls
|
|
798
|
+
- ๐๏ธ **Code Refactoring**: Improved architecture
|
|
799
|
+
- New services: CalendarGenerationService, DisplayFormattingService, DateValidationService
|
|
800
|
+
- Better code organization and maintainability
|
|
801
|
+
- Reduced component complexity
|
|
802
|
+
- ๐งช **E2E Testing**: Comprehensive end-to-end testing
|
|
803
|
+
- Playwright setup with multi-browser support
|
|
804
|
+
- Mobile viewport testing
|
|
805
|
+
- Automated test execution
|
|
806
|
+
- โฟ **Accessibility Enhancements**: Better screen reader support
|
|
807
|
+
- Improved ARIA live regions
|
|
808
|
+
- Enhanced focus management
|
|
809
|
+
- Better keyboard navigation
|
|
810
|
+
- โก **Performance Optimizations**: Infrastructure improvements
|
|
811
|
+
- Lazy loading calendar months with intelligent caching
|
|
812
|
+
- Virtual scrolling infrastructure
|
|
813
|
+
- Preloading adjacent months
|
|
814
|
+
- ๐งช **Test Coverage**: Comprehensive test suite
|
|
815
|
+
- 414 tests passing
|
|
816
|
+
- New service tests
|
|
817
|
+
- Updated component and utility tests
|
|
818
|
+
- ๐ **Backward Compatible**: Full backward compatibility with v1.9.20
|
|
819
|
+
|
|
820
|
+
### **v1.9.19** (Stable)
|
|
821
|
+
- ๐ **Version Update**: Updated to version 1.9.19
|
|
822
|
+
- โ
**Stable Release**: Version 1.9.19 is the current stable version
|
|
823
|
+
- ๐จ **Responsive Layout Redesign**: Complete redesign of demo project layout for all screen sizes (320px to desktop)
|
|
824
|
+
- ๐ฑ **Mobile Optimization**: Enhanced mobile experience with improved navbar, sidebar, hero section, and feature grid
|
|
825
|
+
- ๐งน **Code Cleanup**: Removed unnecessary comments for cleaner codebase
|
|
826
|
+
- ๐ง **Meta Tag Update**: Replaced deprecated `apple-mobile-web-app-capable` with `mobile-web-app-capable`
|
|
827
|
+
- ๐ **Backward Compatible**: Full backward compatibility with v1.9.18
|
|
828
|
+
|
|
829
|
+
### **v1.9.18** (Stable)
|
|
830
|
+
- ๐ **Version Update**: Updated to version 1.9.18
|
|
831
|
+
- โ
**Stable Release**: Version 1.9.18 is the current stable version
|
|
832
|
+
- ๐ **Fixed**: Improved mobile touch event handling - touch listeners now properly attach when calendar opens
|
|
833
|
+
- ๐ **Backward Compatible**: Full backward compatibility with v1.9.17
|
|
834
|
+
|
|
835
|
+
### **v1.9.17** (Stable)
|
|
836
|
+
- ๐ **Version Update**: Updated to version 1.9.17
|
|
837
|
+
- โ
**Stable Release**: Version 1.9.17 is the current stable version
|
|
838
|
+
- ๐ **Backward Compatible**: Full backward compatibility with v1.9.16
|
|
839
|
+
- โ
**Angular 17+ Compatible**: Verified compatibility with Angular 17 and up versions
|
|
840
|
+
|
|
841
|
+
### **v1.9.16** (Stable)
|
|
842
|
+
- ๐ **Range Mode Previous Month Selection**: Fixed issue where users could not select dates from previous months in range mode when starting with `{ start: null, end: null }`
|
|
843
|
+
- ๐ **Version Update**: Updated to version 1.9.16
|
|
844
|
+
- โ
**Stable Release**: Version 1.9.16 is the current stable version
|
|
845
|
+
- ๐ **Backward Compatible**: Full backward compatibility with v1.9.15
|
|
846
|
+
- โ
**Angular 17+ Compatible**: Verified compatibility with Angular 17 and up versions
|
|
847
|
+
|
|
848
|
+
### **v1.9.15** (Stable)
|
|
849
|
+
- ๐ **Moment Object Binding Fix**: Fixed Moment.js objects not binding correctly with ngModel
|
|
850
|
+
- ๐ **Date Clicks After Navigation**: Fixed dates becoming unclickable after month navigation
|
|
851
|
+
- ๐ **Version Update**: Updated to version 1.9.15
|
|
852
|
+
- โ
**Stable Release**: Version 1.9.15 is the current stable version
|
|
853
|
+
- ๐ **Backward Compatible**: Full backward compatibility with v1.9.14
|
|
854
|
+
- โ
**Angular 17+ Compatible**: Verified compatibility with Angular 17 and up versions
|
|
855
|
+
|
|
856
|
+
### **v1.9.14** (Stable)
|
|
857
|
+
- ๐ **Date Picker Selection Fix**: Fixed date picker selection issues, especially in range mode
|
|
858
|
+
- ๐ **Moment.js Timezone Support**: Fixed timezone offset preservation for Moment.js objects
|
|
859
|
+
- ๐ **Version Update**: Updated to version 1.9.14
|
|
860
|
+
- โ
**Stable Release**: Version 1.9.14 is the current stable version
|
|
861
|
+
- ๐ **Backward Compatible**: Full backward compatibility with v1.9.13
|
|
862
|
+
|
|
863
|
+
### **v1.9.13** (Stable)
|
|
864
|
+
- ๐ **Bug Fixes**: Fixed `valueChange` event emitting null for range mode with ngModel
|
|
865
|
+
- ๐ **Bug Fixes**: Fixed date selection becoming disabled after month navigation in range mode
|
|
866
|
+
- ๐ **Bug Fixes**: Fixed Moment.js object handling in range values and arrays
|
|
867
|
+
- ๐ **Version Update**: Updated to version 1.9.13
|
|
868
|
+
- โ
**Stable Release**: Version 1.9.13 is the current stable version
|
|
869
|
+
- ๐ **Backward Compatible**: Full backward compatibility with v1.9.12
|
|
870
|
+
|
|
871
|
+
### **v1.9.12** (Stable)
|
|
872
|
+
- ๐ **Version Update**: Updated to version 1.9.12
|
|
873
|
+
- โ
**Stable Release**: Version 1.9.12 is the current stable version
|
|
874
|
+
- ๐ **Backward Compatible**: Full backward compatibility with v1.9.11
|
|
875
|
+
- ๐ **Migration Guide**: See [MIGRATION.md](../../MIGRATION.md) for detailed migration instructions
|
|
876
|
+
|
|
877
|
+
### **v1.9.11** (Stable)
|
|
878
|
+
- ๐ **Moment.js Integration**: Fixed critical issue where Moment.js objects with custom date formats would not populate correctly
|
|
879
|
+
- Added `isMomentObject()` helper method to safely detect Moment.js instances
|
|
880
|
+
- Enhanced `_normalizeValue()` method to handle Moment.js objects directly
|
|
881
|
+
- Improved `parseCustomDateString()` method for TypeScript compatibility
|
|
882
|
+
- Added comprehensive support for format tokens: YYYY, YY, MM, M, DD, D, hh, h, HH, H, mm, m, ss, s, a, A
|
|
883
|
+
- Maintains full backward compatibility with Date objects, strings, and all other supported formats
|
|
884
|
+
- ๐จ **Custom Format Parser**: Enhanced format token parsing with better TypeScript compatibility
|
|
885
|
+
- ๐ **Moment.js Detection**: More robust detection of Moment.js objects across different versions
|
|
886
|
+
- ๐ฎ **Demo Application**: Added working Moment.js integration example with interactive controls
|
|
887
|
+
|
|
888
|
+
### **v1.9.10** (Stable)
|
|
889
|
+
- ๐ **Async Database Value Loading**: Enhanced datepicker to properly handle database values that load asynchronously
|
|
890
|
+
- Added fallback sync mechanism in `ngAfterViewInit` to catch async database loads
|
|
891
|
+
- Added delayed sync checks in `ngOnInit`, `ngOnChanges`, and `ngAfterViewInit`
|
|
892
|
+
- Added sync on calendar open, focus events, and touch events
|
|
893
|
+
- Extended interval sync duration to 30 seconds with 100ms check intervals
|
|
894
|
+
- ๐ง **TypeScript Compilation Error**: Fixed `EffectRef` type error when using Angular 17+ `effect()` API
|
|
895
|
+
- Changed `_fieldEffectDestroy: (() => void) | null` to `_fieldEffectRef: EffectRef | null`
|
|
896
|
+
- Updated effect cleanup to use `effectRef.destroy()` instead of function call
|
|
897
|
+
- Added proper `EffectRef` import from `@angular/core`
|
|
898
|
+
- ๐งช **Test Configuration**: Fixed test configuration for Angular 17+ compatibility
|
|
899
|
+
- Updated karma configuration to work with `@angular/build:karma` builder
|
|
900
|
+
- Simplified karma.conf.js to remove deprecated plugins
|
|
901
|
+
- Updated test script to target correct project
|
|
902
|
+
|
|
903
|
+
### **v1.9.9** (Stable)
|
|
904
|
+
- ๐ **Database Value Population**: Fixed critical issue where datepicker would not populate with values from database when using `[field]` input binding
|
|
905
|
+
- Added `_normalizeValue()` helper method to properly handle all value types
|
|
906
|
+
- Updated field effect and related methods to use `_normalizeValue()` instead of `_normalizeDate()`
|
|
907
|
+
- Fixed issue where string dates from database were not being parsed and displayed correctly
|
|
908
|
+
- Now properly handles Date objects, string dates, range objects, and arrays of dates
|
|
909
|
+
|
|
910
|
+
### **v1.9.8** (Stable)
|
|
911
|
+
- ๐ **Date Selection Reset Issue**: Fixed critical bug where selected dates would reset to today's date when using `[field]` input binding
|
|
912
|
+
- Fixed `applyCurrentTime` to create a new Date object instead of mutating the original
|
|
913
|
+
- Added `_isUpdatingFromInternal` flag to prevent field effect from resetting the value
|
|
914
|
+
- This ensures selected dates are properly stored in the form field
|
|
915
|
+
|
|
916
|
+
### **v1.9.7** (Stable)
|
|
917
|
+
- ๐ **Calendar Population**: Fixed critical issue where datepicker calendar would not populate with dates when opened
|
|
918
|
+
- Fixed issue when multiple datepickers were present in the same form
|
|
919
|
+
- Ensured `generateCalendar()` is called when opening the datepicker via click, touch, or programmatic methods
|
|
920
|
+
|
|
921
|
+
### **v1.9.6** (Stable)
|
|
922
|
+
- ๐ **Multiple Datepicker Management**: Fixed issue where multiple datepickers in the same form would open in the same centered location
|
|
923
|
+
- ๐ฑ๏ธ **Outside Click Detection**: Improved click detection to properly close datepicker when clicking outside
|
|
924
|
+
- ๐ **Auto-close Other Datepickers**: When opening a datepicker, all other open datepickers in the same form are now automatically closed
|
|
925
|
+
- ๐ฑ **Mobile Datepicker Opening**: Fixed issue where datepicker modal would not open on mobile screens
|
|
926
|
+
- ๐ฑ **Datepicker Closing on Mobile**: Fixed issue where datepicker would open and immediately disappear on mobile devices
|
|
927
|
+
- ๐ **Select Box Cursor**: Added pointer cursor to all select boxes (month, year, hour, minute, AM/PM) in the datepicker
|
|
928
|
+
|
|
929
|
+
### **v1.9.5** (Stable)
|
|
930
|
+
- ๐ง **Angular 21+ Signal Forms Type Compatibility**: Fixed TypeScript compilation error with Angular 21+ Signal Forms
|
|
931
|
+
- Fixed `Type '() => string' is not assignable to type 'never'` error when using `[field]` input
|
|
932
|
+
- Updated `SignalFormField` type definition to be compatible with Angular 21's `FieldTree<Date, string>` types
|
|
933
|
+
- Maintains backward compatibility with Angular 17-20 where field input is optional
|
|
934
|
+
- Resolves [#33](https://github.com/NGXSMK/ngxsmk-datepicker/issues/33)
|
|
935
|
+
|
|
936
|
+
### **v1.9.4** (Stable)
|
|
937
|
+
- โจ **Custom Date Format**: New `[displayFormat]` input property to display dates in custom formats
|
|
938
|
+
- Supports format strings like "MM/DD/YYYY hh:mm A"
|
|
939
|
+
- Works with date adapters (date-fns, dayjs, luxon) or built-in simple formatter
|
|
940
|
+
- Supports common format tokens: YYYY, MM, DD, hh, mm, A, etc.
|
|
941
|
+
- Resolves [#31](https://github.com/NGXSMK/ngxsmk-datepicker/issues/31)
|
|
942
|
+
- ๐ **Time Selection Dropdowns**: Fixed visibility issues with time selection dropdowns
|
|
943
|
+
- Dropdowns now properly display and are not clipped by parent containers
|
|
944
|
+
- Improved z-index handling for time selection dropdowns
|
|
945
|
+
- Removed unnecessary scrollbars from datepicker wrapper
|
|
946
|
+
- Resolves [#32](https://github.com/NGXSMK/ngxsmk-datepicker/issues/32)
|
|
947
|
+
|
|
948
|
+
### **v1.9.3** (Stable)
|
|
949
|
+
- โจ **Time-Only Picker**: New `[timeOnly]` input property to display only time selection without calendar
|
|
950
|
+
- Hides calendar grid and shows only time controls (hour, minute, AM/PM)
|
|
951
|
+
- Automatically enables `showTime` when `timeOnly` is true
|
|
952
|
+
- Perfect for time selection scenarios where date is not needed
|
|
953
|
+
- Value is still a Date object using today's date with selected time
|
|
954
|
+
- Placeholder automatically changes to "Select Time" in time-only mode
|
|
955
|
+
- Resolves [#29](https://github.com/NGXSMK/ngxsmk-datepicker/issues/29)
|
|
956
|
+
- ๐จ **Modern Demo App UI**: Complete redesign of the demo application
|
|
957
|
+
- Modern navbar with glassmorphism effects, search functionality, and improved theme toggle
|
|
958
|
+
- Redesigned sidebar with gradient backgrounds, smooth animations, and visual indicators
|
|
959
|
+
- Enhanced icon sizes and better visual hierarchy
|
|
960
|
+
- Improved responsive design with better mobile experience
|
|
961
|
+
- Automatic system theme detection (dark/light mode preference)
|
|
962
|
+
- Gradient accents, shadows, and modern design patterns throughout
|
|
963
|
+
- ๐งช **Test Suite**: Fixed 25+ failing tests across multiple test files
|
|
964
|
+
- Fixed date utils tests, calendar utils tests, timezone utils tests, edge cases tests
|
|
965
|
+
- Fixed adapters tests, performance utils tests, RTL tests, touch gestures tests
|
|
966
|
+
- Fixed calendar views tests, recurring dates utils tests
|
|
967
|
+
- All 353 tests now pass successfully
|
|
968
|
+
|
|
969
|
+
### **v1.9.2** (Stable)
|
|
970
|
+
- ๐ฆ **Bundle Optimization**: Optimized bundle size with improved TypeScript compiler settings
|
|
971
|
+
- Main bundle: ~127KB (source maps excluded from published package)
|
|
972
|
+
- Enhanced tree-shaking with optimized imports and compiler options
|
|
973
|
+
- Added `importsNotUsedAsValues: "remove"` for smaller output
|
|
974
|
+
- Disabled `preserveConstEnums` for better inlining
|
|
975
|
+
- ๐ง **Build Process**:
|
|
976
|
+
- Source maps automatically removed from production builds (saves ~127KB)
|
|
977
|
+
- Improved build scripts with better error handling
|
|
978
|
+
- Enhanced bundle analysis that excludes source maps
|
|
979
|
+
- ๐ฆ **Package Configuration**:
|
|
980
|
+
- Fixed package.json exports to eliminate build warnings
|
|
981
|
+
- Optimized `files` array to exclude unnecessary files
|
|
982
|
+
- Updated exports field for better module resolution
|
|
983
|
+
- ๐งช **Test Configuration**:
|
|
984
|
+
- Added Zone.js polyfills to library test configuration
|
|
985
|
+
- Updated test commands to explicitly target library project
|
|
986
|
+
- Improved test reliability across Angular versions
|
|
987
|
+
- ๐ **Bug Fixes**:
|
|
988
|
+
- Test suite configuration - added missing Zone.js polyfills for library tests
|
|
989
|
+
- Bundle analysis now correctly excludes source maps from size calculations
|
|
990
|
+
- Build warnings from conflicting export conditions resolved
|
|
991
|
+
- Source map removal script made more resilient for build environments
|
|
992
|
+
|
|
993
|
+
### **v1.9.1** (Stable)
|
|
994
|
+
- ๐ Minor bug fixes and improvements
|
|
995
|
+
|
|
996
|
+
### **v1.9.0**
|
|
997
|
+
- โจ **Extension Points & Hooks**: system for customization
|
|
998
|
+
- โจ๏ธ **Enhanced Keyboard Shortcuts**: Y, N, W keys with custom shortcut support
|
|
999
|
+
- ๐จ **Modern UI/UX**: Improved animations and responsiveness
|
|
1000
|
+
- ๐ **API Documentation**: TypeDoc integration
|
|
1001
|
+
- ๐ค **Semantic Release**: Automated versioning and publishing
|
|
1002
|
+
- ๐ **Animation Performance**: Optimizations with GPU acceleration
|
|
1003
|
+
- ๐ **Global Search**: Functionality in documentation
|
|
1004
|
+
- ๐ฑ **Mobile Playground**: For responsive testing
|
|
1005
|
+
|
|
1006
|
+
### **v1.7.0**
|
|
1007
|
+
- ๐ฏ **Signal Forms Support**: Full Angular 21 signal forms integration with writable signals
|
|
1008
|
+
- ๐จ **Tailwind Theming**: Added `classes` input for Tailwind CSS and custom class-based theming
|
|
1009
|
+
- ๐ **Localization Improvements**: Added `weekStart` input to override locale-based week start day
|
|
1010
|
+
- ๐
**Year Range Configuration**: Added `yearRange` input to customize year dropdown range
|
|
1011
|
+
- โฟ **Accessibility Enhancements**: Added customizable aria labels for all interactive elements
|
|
1012
|
+
- ๐ท๏ธ **Custom Labels**: Added `clearLabel` and `closeLabel` inputs for button customization
|
|
1013
|
+
- ๐งช **Comprehensive Test Suite**: Added 56 tests covering all features and edge cases
|
|
1014
|
+
- ๐ **Bug Fixes**: Fixed programmatic value setting and Angular 21 compatibility tests
|
|
1015
|
+
- ๐งน **Code Cleanup**: Removed unnecessary files, folders, and comments from codebase
|
|
1016
|
+
- ๐ **Test Improvements**: Enhanced test coverage with comprehensive feature tests
|
|
1017
|
+
- ๐ง **Test Fixes**: Fixed disabled date tests and integration test issues
|
|
1018
|
+
- ๐ฏ **Code Quality**: Improved code maintainability by removing redundant comments
|
|
1019
|
+
|
|
1020
|
+
### **v1.6.0**
|
|
1021
|
+
- ๐ฏ **Programmatic Value Setting**: Added `value` input property to set datepicker value programmatically, perfect for server-side API data integration
|
|
1022
|
+
- ๐จ **Enhanced Demo App**: Completely redesigned demo application with TokiForge-inspired modern UI and API documentation style
|
|
1023
|
+
- ๐ **GitHub Pages Deployment**: Added automated GitHub Pages deployment with GitHub Actions workflow
|
|
1024
|
+
- ๐ **Improved Documentation**: Enhanced demo app with comprehensive examples, code snippets, and interactive documentation
|
|
1025
|
+
- ๐ง **Build Optimizations**: Updated CSS budget limits and improved build configuration
|
|
1026
|
+
- ๐จ **Modern UI Design**: Beautiful gradient themes, glass-morphism effects, and improved visual hierarchy
|
|
1027
|
+
- ๐ฑ **Better UX**: Enhanced navigation, code copying functionality, and responsive design
|
|
1028
|
+
- ๐ ๏ธ **Developer Experience**: Improved build scripts and deployment automation
|
|
1029
|
+
|
|
1030
|
+
### **v1.5.0**
|
|
1031
|
+
- ๐ **Angular 21 Support**: Full compatibility with Angular 21 RC versions
|
|
1032
|
+
- โก **Zone-less Support**: Works without zone.js for improved performance
|
|
1033
|
+
- ๐งช **Comprehensive Tests**: Added extensive test suite covering all features
|
|
1034
|
+
- ๐ง **Angular 17-21 Compatibility**: Supports Angular versions 17, 18, 19, 20, and 21
|
|
1035
|
+
- ๐ฆ **Dependency Updates**: Updated to Angular 21 RC and latest build tools
|
|
1036
|
+
- ๐งน **Code Cleanup**: Removed unnecessary documentation files and comments
|
|
1037
|
+
- ๐ **Improved Keywords**: Added version-specific keywords for better discoverability
|
|
1038
|
+
- ๐ฏ **Peer Dependencies**: Updated to support Angular 17-21 range
|
|
1039
|
+
|
|
1040
|
+
### **v1.4.16**
|
|
1041
|
+
- ๐ **Documentation**: Comprehensive README updates with latest features and improvements
|
|
1042
|
+
- ๐ฏ **Version Management**: Updated version references across all package files
|
|
1043
|
+
- ๐ **User Experience**: Enhanced documentation with better examples and API references
|
|
1044
|
+
- ๐ง **Maintenance**: Improved project structure and documentation consistency
|
|
1045
|
+
- ๐ฆ **Package Updates**: Synchronized version numbers across all package.json files
|
|
1046
|
+
- ๐จ **Documentation**: Added detailed bug fixes and performance metrics
|
|
1047
|
+
- ๐ **Developer Experience**: Better setup instructions and contribution guidelines
|
|
1048
|
+
|
|
1049
|
+
### **v1.4.15**
|
|
1050
|
+
- ๐ **Bug Fixes**: Fixed 10 critical bugs including change detection issues and date comparison errors
|
|
1051
|
+
- โก **Performance**: Enhanced OnPush change detection with proper triggers
|
|
1052
|
+
- ๐ฏ **Memory Management**: Added cache size limits to prevent memory leaks
|
|
1053
|
+
- ๐ง **Type Safety**: Improved TypeScript types and null safety
|
|
1054
|
+
- ๐ฑ **Mobile Optimization**: Enhanced mobile responsive design with touch-friendly interactions
|
|
1055
|
+
- ๐จ **UI Improvements**: Better visual feedback and accessibility
|
|
1056
|
+
- ๐ **Build Optimization**: Improved build configuration and tree-shaking
|
|
1057
|
+
- ๐งน **Code Quality**: Enhanced code maintainability and performance
|
|
1058
|
+
|
|
1059
|
+
### **v1.4.13**
|
|
1060
|
+
- ๐ซ **Disabled Dates**: New `disabledDates` input property to disable specific dates
|
|
1061
|
+
- ๐ฏ **Date String Support**: Supports both string dates (MM/DD/YYYY) and Date objects
|
|
1062
|
+
- ๐ก **Holiday Tooltips**: Hover over holiday dates to see holiday names as tooltips
|
|
1063
|
+
- ๐จ **Enhanced UX**: Better visual feedback for disabled dates
|
|
1064
|
+
- ๐ฆ **Improved API**: More flexible date disabling options
|
|
1065
|
+
|
|
1066
|
+
### **v1.4.12**
|
|
1067
|
+
- โก **Instant Navigation**: Removed all animations for lightning-fast arrow navigation
|
|
1068
|
+
- ๐ซ **Smart Back Arrow**: Automatically disables back arrow when minDate is set
|
|
1069
|
+
- ๐ฏ **Better UX**: Prevents navigation to invalid date ranges
|
|
1070
|
+
- ๐๏ธ **Previous Month Days**: Now shows last few days of previous month for better context
|
|
1071
|
+
- ๐จ **Enhanced Styling**: Improved visual hierarchy with better day cell sizing
|
|
1072
|
+
- ๐ฑ๏ธ **Interactive Previous Days**: Previous month days are now selectable and interactive
|
|
1073
|
+
- ๐งน **Code Optimization**: Cleaner, more maintainable codebase
|
|
1074
|
+
- ๐ฆ **Smaller Bundle**: Reduced CSS and JavaScript footprint
|
|
1075
|
+
|
|
1076
|
+
### **v1.4.11**
|
|
1077
|
+
- ๐จ **UI Improvements**: Enhanced day cell sizing and visual hierarchy
|
|
1078
|
+
- ๐ฑ๏ธ **Better Interactions**: Improved click and hover states for previous month days
|
|
1079
|
+
|
|
1080
|
+
### **v1.4.10**
|
|
1081
|
+
- ๐๏ธ **Previous Month Display**: Added last few days of previous month for better context
|
|
1082
|
+
- ๐ฏ **Smart Selection**: Previous month days are now selectable and interactive
|
|
1083
|
+
|
|
1084
|
+
### **v1.4.9**
|
|
1085
|
+
- ๐ซ **Range Fix**: Fixed range highlighting on empty/previous month days
|
|
1086
|
+
- ๐จ **Styling Updates**: Improved visual consistency across all day types
|
|
1087
|
+
|
|
1088
|
+
### **v1.4.8**
|
|
1089
|
+
- โก **Performance**: Optimized calendar generation and rendering
|
|
1090
|
+
- ๐งน **Code Cleanup**: Removed unused animation code and improved maintainability
|
|
1091
|
+
|
|
1092
|
+
### **v1.4.6**
|
|
1093
|
+
- ๐ง **Fixed Import Paths**: Corrected package exports for proper module resolution
|
|
1094
|
+
- ๐ฆ **Better Package Structure**: Improved npm package configuration
|
|
1095
|
+
|
|
1096
|
+
### **v1.4.5**
|
|
1097
|
+
- ๐ Bug fixes and stability improvements
|
|
1098
|
+
- ๐ง Enhanced error handling
|
|
1099
|
+
- ๐ฑ Improved mobile responsiveness
|
|
1100
|
+
- ๐จ Minor UI/UX improvements
|
|
1101
|
+
|
|
1102
|
+
### **v1.4.0**
|
|
1103
|
+
- โ
Performance optimizations (30% smaller bundle)
|
|
1104
|
+
- โ
OnPush change detection strategy
|
|
1105
|
+
- โ
Memoized date comparisons
|
|
1106
|
+
- โ
Tree-shakable architecture
|
|
1107
|
+
- โ
Enhanced TypeScript support
|
|
1108
|
+
- โ
Improved accessibility
|
|
1109
|
+
- โ
Better mobile responsiveness
|
|
1110
|
+
|
|
1111
|
+
### **Previous Versions**
|
|
1112
|
+
- v1.3.5: Initial release with core features
|
|
1113
|
+
- v1.3.4: Bug fixes and improvements
|
|
1114
|
+
- v1.3.3: Holiday provider integration
|
|
1115
|
+
|
|
1116
|
+
## **๐จ Theming with TokiForge**
|
|
1117
|
+
|
|
1118
|
+
Looking for a powerful theming solution for your Angular application? Check out **[TokiForge](https://tokiforge.github.io/tokiforge/)** โ an open-source modern design token & theme engine that provides runtime theme switching for React, Vue, Svelte, Angular, and any framework.
|
|
1119
|
+
|
|
1120
|
+
### Why TokiForge?
|
|
1121
|
+
|
|
1122
|
+
- โ
**Framework-agnostic** โ Works with Angular, React, Vue, Svelte, and vanilla JS
|
|
1123
|
+
- โ
**Runtime theme switching** โ Change themes dynamically without rebuilds
|
|
1124
|
+
- โ
**Type-safe** โ Full TypeScript support for design tokens
|
|
1125
|
+
- โ
**Lightweight** โ <3 KB gzipped runtime footprint
|
|
1126
|
+
- โ
**CSS custom properties** โ Zero JS overhead in static mode
|
|
1127
|
+
- โ
**SSR compatible** โ Works seamlessly with Angular Universal
|
|
1128
|
+
|
|
1129
|
+
Perfect for managing design tokens, creating theme systems, and implementing dark mode in your Angular applications!
|
|
1130
|
+
|
|
1131
|
+
**๐ [Learn more about TokiForge โ](https://tokiforge.github.io/tokiforge/)**
|
|
1132
|
+
|
|
1133
|
+
---
|
|
1134
|
+
|
|
1135
|
+
## **๐ License**
|
|
1136
|
+
|
|
1137
|
+
MIT License - see [LICENSE](LICENSE) file for details.
|
|
1138
|
+
|
|
1139
|
+
## **๐ SEO & Discoverability**
|
|
1140
|
+
|
|
1141
|
+
This library is optimized for search engine visibility:
|
|
1142
|
+
- **Keywords**: Angular datepicker, date range picker, calendar component, Angular 17-21, TypeScript, Signal Forms, SSR compatible
|
|
1143
|
+
- **Meta Tags**: Comprehensive Open Graph and Twitter Card support
|
|
1144
|
+
- **Structured Data**: JSON-LD schema markup for better search results
|
|
1145
|
+
- **Documentation**: Complete API documentation with examples
|
|
1146
|
+
- **Performance**: Optimized bundle size (~127KB) for fast loading
|
|
1147
|
+
|
|
1148
|
+
## **๐จโ๐ป Author**
|
|
1149
|
+
|
|
1150
|
+
**Sachin Dilshan**
|
|
1151
|
+
- ๐ง Email: [sachindilshan040@gmail.com](mailto:sachindilshan040@gmail.com)
|
|
1152
|
+
- ๐ GitHub: [@toozuuu](https://github.com/toozuuu)
|
|
1153
|
+
- ๐ฆ NPM: [ngxsmk-datepicker](https://www.npmjs.com/package/ngxsmk-datepicker)
|
|
1154
|
+
- ๐ผ LinkedIn: [sachindilshan](https://www.linkedin.com/in/sachindilshan/)
|
|
1155
|
+
|
|
1156
|
+
## **โญ Support**
|
|
1157
|
+
|
|
1158
|
+
If you find this library helpful, please consider:
|
|
1159
|
+
- โญ **Starring** the repository
|
|
1160
|
+
- ๐ **Reporting** bugs and issues
|
|
1161
|
+
- ๐ก **Suggesting** new features
|
|
1162
|
+
- ๐ค **Contributing** code improvements
|
|
1163
|
+
- ๐ข **Sharing** with the community
|