ngx-datex 1.0.0 → 1.0.2

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ngx-datex",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "description": "Modern Angular date range picker with Material Design featuring signals, control flow syntax, time picker, themes, and responsive design for Angular 21+",
5
5
  "peerDependencies": {
6
6
  "@angular/animations": "^21.1.1",
@@ -137,11 +137,11 @@ interface NgxDatexTheme {
137
137
  }
138
138
  /**
139
139
  * Configuration options for date picker behavior and validation.
140
+ * Note: Date format is configured in NgxDatexLocale.format, not here.
140
141
  *
141
142
  * @example
142
143
  * ```typescript
143
144
  * const config: NgxDatexConfig = {
144
- * dateFormat: 'DD/MM/YYYY',
145
145
  * firstDayOfWeek: 1, // Monday
146
146
  * businessDaysOnly: true,
147
147
  * closeOnSelect: false
@@ -149,8 +149,6 @@ interface NgxDatexTheme {
149
149
  * ```
150
150
  */
151
151
  interface NgxDatexConfig {
152
- /** Date format string (default: 'DD/MM/YYYY') */
153
- dateFormat?: string;
154
152
  /** First day of week (0 = Sunday, 1 = Monday, etc.) */
155
153
  firstDayOfWeek?: number;
156
154
  /** Whether to show week numbers in calendar */
@@ -172,22 +170,206 @@ interface NgxDatexConfig {
172
170
  * Localization configuration for the date picker.
173
171
  * Controls language, date formats, and UI text.
174
172
  *
173
+ * The `format` property is the primary way to control date formatting,
174
+ * following the vanilla-daterangepicker pattern.
175
+ *
175
176
  * @example
176
177
  * ```typescript
178
+ * // Basic date-only formats
177
179
  * const spanishLocale: NgxDatexLocale = {
178
- * direction: 'ltr',
179
- * format: 'DD/MM/YYYY',
180
+ * locale: 'es-ES',
181
+ * format: 'DD/MM/YYYY', // 15/01/2024
182
+ * separator: ' - ',
180
183
  * daysOfWeek: ['Lu', 'Ma', 'Mi', 'Ju', 'Vi', 'Sa', 'Do'],
181
184
  * monthNames: ['Enero', 'Febrero', 'Marzo', ...],
182
185
  * applyLabel: 'Aplicar',
183
186
  * cancelLabel: 'Cancelar'
184
187
  * };
188
+ *
189
+ * const americanLocale: NgxDatexLocale = {
190
+ * locale: 'en-US',
191
+ * format: 'MM/DD/YYYY', // 01/15/2024
192
+ * separator: ' - ',
193
+ * daysOfWeek: ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'],
194
+ * monthNames: ['January', 'February', 'March', ...],
195
+ * applyLabel: 'Apply',
196
+ * cancelLabel: 'Cancel'
197
+ * };
198
+ *
199
+ * // Time picker formats (when timePicker=true)
200
+ * const spanishWithTime24h: NgxDatexLocale = {
201
+ * locale: 'es-ES',
202
+ * format: 'DD/MM/YYYY HH:mm', // 15/01/2024 14:30
203
+ * // ... other properties
204
+ * };
205
+ *
206
+ * const americanWithTime12h: NgxDatexLocale = {
207
+ * locale: 'en-US',
208
+ * format: 'MM/DD/YYYY hh:mm A', // 01/15/2024 02:30 PM
209
+ * // ... other properties
210
+ * };
211
+ *
212
+ * // ISO format for APIs
213
+ * const isoFormat: NgxDatexLocale = {
214
+ * locale: 'en-US',
215
+ * format: 'YYYY-MM-DD', // 2024-01-15
216
+ * // ... other properties
217
+ * };
218
+ *
219
+ * const isoWithTime: NgxDatexLocale = {
220
+ * locale: 'en-US',
221
+ * format: 'YYYY-MM-DD HH:mm', // 2024-01-15 14:30
222
+ * // ... other properties
223
+ * };
185
224
  * ```
186
225
  */
187
226
  interface NgxDatexLocale {
227
+ /**
228
+ * Locale string for date formatting and internationalization.
229
+ * Used by @formkit/tempo for proper locale-aware formatting.
230
+ *
231
+ * This affects how dates are formatted according to regional conventions,
232
+ * including number formatting, month/day names, and cultural preferences.
233
+ *
234
+ * ## Common Locale Codes:
235
+ * - `'es-ES'` - Spanish (Spain)
236
+ * - `'es-MX'` - Spanish (Mexico)
237
+ * - `'en-US'` - English (United States)
238
+ * - `'en-GB'` - English (United Kingdom)
239
+ * - `'fr-FR'` - French (France)
240
+ * - `'de-DE'` - German (Germany)
241
+ * - `'it-IT'` - Italian (Italy)
242
+ * - `'pt-BR'` - Portuguese (Brazil)
243
+ * - `'ja-JP'` - Japanese (Japan)
244
+ * - `'zh-CN'` - Chinese (Simplified)
245
+ *
246
+ * @example
247
+ * ```typescript
248
+ * // Spanish locale
249
+ * const spanishLocale: NgxDatexLocale = {
250
+ * locale: 'es-ES',
251
+ * format: 'DD/MM/YYYY'
252
+ * };
253
+ *
254
+ * // US English locale
255
+ * const usLocale: NgxDatexLocale = {
256
+ * locale: 'en-US',
257
+ * format: 'MM/DD/YYYY'
258
+ * };
259
+ *
260
+ * // German locale
261
+ * const germanLocale: NgxDatexLocale = {
262
+ * locale: 'de-DE',
263
+ * format: 'DD.MM.YYYY'
264
+ * };
265
+ * ```
266
+ *
267
+ * @default undefined (uses browser default)
268
+ */
269
+ locale?: string;
188
270
  /** Text direction for RTL languages */
189
271
  direction?: 'ltr' | 'rtl';
190
- /** Date format string */
272
+ /**
273
+ * Primary date format string using @formkit/tempo tokens.
274
+ * This format is used for ALL date display and parsing in the component.
275
+ *
276
+ * **IMPORTANT**: When using timePicker=true, you MUST include time tokens in the format.
277
+ * The component does NOT automatically add time formatting - you must specify it explicitly.
278
+ *
279
+ * ## Available Format Tokens:
280
+ *
281
+ * ### Date Tokens:
282
+ * - `YYYY` - 4 digit year (2024)
283
+ * - `YY` - 2 digit year (24)
284
+ * - `MM` - 2 digit month (01-12)
285
+ * - `M` - 1-2 digit month (1-12)
286
+ * - `DD` - 2 digit day (01-31)
287
+ * - `D` - 1-2 digit day (1-31)
288
+ *
289
+ * ### Time Tokens (24-hour):
290
+ * - `HH` - 2 digit hour 24-hour format (00-23)
291
+ * - `H` - 1-2 digit hour 24-hour format (0-23)
292
+ * - `mm` - 2 digit minutes (00-59)
293
+ * - `m` - 1-2 digit minutes (0-59)
294
+ * - `ss` - 2 digit seconds (00-59)
295
+ * - `s` - 1-2 digit seconds (0-59)
296
+ *
297
+ * ### Time Tokens (12-hour):
298
+ * - `hh` - 2 digit hour 12-hour format (01-12)
299
+ * - `h` - 1-2 digit hour 12-hour format (1-12)
300
+ * - `A` - AM/PM uppercase
301
+ * - `a` - am/pm lowercase
302
+ *
303
+ * ## Common Format Examples:
304
+ *
305
+ * ### Date Only Formats:
306
+ * ```typescript
307
+ * format: 'DD/MM/YYYY' // 15/01/2024 (European)
308
+ * format: 'MM/DD/YYYY' // 01/15/2024 (US)
309
+ * format: 'YYYY-MM-DD' // 2024-01-15 (ISO)
310
+ * format: 'D/M/YYYY' // 15/1/2024 (no leading zeros)
311
+ * format: 'DD-MM-YY' // 15-01-24 (short year)
312
+ * ```
313
+ *
314
+ * ### Date + Time Formats (24-hour):
315
+ * ```typescript
316
+ * format: 'DD/MM/YYYY HH:mm' // 15/01/2024 14:30
317
+ * format: 'MM/DD/YYYY HH:mm' // 01/15/2024 14:30
318
+ * format: 'YYYY-MM-DD HH:mm' // 2024-01-15 14:30
319
+ * format: 'DD/MM/YYYY HH:mm:ss' // 15/01/2024 14:30:45
320
+ * ```
321
+ *
322
+ * ### Date + Time Formats (12-hour):
323
+ * ```typescript
324
+ * format: 'DD/MM/YYYY hh:mm A' // 15/01/2024 02:30 PM
325
+ * format: 'MM/DD/YYYY hh:mm A' // 01/15/2024 02:30 PM
326
+ * format: 'DD/MM/YYYY h:mm a' // 15/01/2024 2:30 pm
327
+ * ```
328
+ *
329
+ * ## Usage with TimePicker:
330
+ *
331
+ * ```typescript
332
+ * // ❌ WRONG - Will only show date even with timePicker=true
333
+ * const wrongLocale: NgxDatexLocale = {
334
+ * format: 'DD/MM/YYYY' // Missing time format!
335
+ * };
336
+ *
337
+ * // ✅ CORRECT - Includes time format for timePicker=true
338
+ * const correctLocale24h: NgxDatexLocale = {
339
+ * format: 'DD/MM/YYYY HH:mm' // Shows: 15/01/2024 14:30
340
+ * };
341
+ *
342
+ * const correctLocale12h: NgxDatexLocale = {
343
+ * format: 'DD/MM/YYYY hh:mm A' // Shows: 15/01/2024 02:30 PM
344
+ * };
345
+ * ```
346
+ *
347
+ * ## Component Usage Examples:
348
+ *
349
+ * ```html
350
+ * <!-- Date only picker -->
351
+ * <ngx-datex
352
+ * [locale]="{ format: 'DD/MM/YYYY' }"
353
+ * [timePicker]="false">
354
+ * </ngx-datex>
355
+ *
356
+ * <!-- Date + time picker (24h) -->
357
+ * <ngx-datex
358
+ * [locale]="{ format: 'DD/MM/YYYY HH:mm' }"
359
+ * [timePicker]="true"
360
+ * [timePicker24Hour]="true">
361
+ * </ngx-datex>
362
+ *
363
+ * <!-- Date + time picker (12h) -->
364
+ * <ngx-datex
365
+ * [locale]="{ format: 'MM/DD/YYYY hh:mm A' }"
366
+ * [timePicker]="true"
367
+ * [timePicker24Hour]="false">
368
+ * </ngx-datex>
369
+ * ```
370
+ *
371
+ * @default 'DD/MM/YYYY'
372
+ */
191
373
  format?: string;
192
374
  /** Separator between start and end dates */
193
375
  separator?: string;
@@ -371,28 +553,165 @@ declare class NgxDatex implements OnInit, OnDestroy, ControlValueAccessor {
371
553
  * @example
372
554
  * ```typescript
373
555
  * const config: NgxDatexConfig = {
374
- * dateFormat: 'DD/MM/YYYY',
375
556
  * firstDayOfWeek: 1,
376
- * businessDaysOnly: true
557
+ * businessDaysOnly: true,
558
+ * showWeekNumbers: true
377
559
  * };
378
560
  * ```
379
561
  */
380
562
  config: _angular_core.InputSignal<NgxDatexConfig>;
381
563
  /**
382
564
  * Localization settings for internationalization.
383
- * Controls language, date formats, and UI text.
565
+ * Controls language, date formats, UI text, and regional preferences.
566
+ *
567
+ * This is the primary configuration for adapting the date picker to different
568
+ * languages, regions, and cultural conventions. The most important property
569
+ * is `format`, which controls how dates are displayed and parsed.
384
570
  *
385
571
  * @default SPANISH_LOCALE
386
572
  *
387
- * @example
573
+ * ## Key Properties:
574
+ *
575
+ * - **`format`**: Date format string (REQUIRED for timePicker usage)
576
+ * - **`locale`**: Locale code for @formkit/tempo formatting
577
+ * - **`separator`**: Text between start and end dates
578
+ * - **`daysOfWeek`**: Short day names array
579
+ * - **`monthNames`**: Full month names array
580
+ * - **`applyLabel`**: Apply button text
581
+ * - **`cancelLabel`**: Cancel button text
582
+ *
583
+ * ## Format Examples:
584
+ *
585
+ * ### Date Only Formats:
586
+ * ```typescript
587
+ * // European format (DD/MM/YYYY)
588
+ * const europeanLocale: NgxDatexLocale = {
589
+ * locale: 'es-ES',
590
+ * format: 'DD/MM/YYYY', // 15/01/2024
591
+ * separator: ' - ',
592
+ * daysOfWeek: ['Lu', 'Ma', 'Mi', 'Ju', 'Vi', 'Sa', 'Do'],
593
+ * monthNames: ['Enero', 'Febrero', 'Marzo', 'Abril', 'Mayo', 'Junio',
594
+ * 'Julio', 'Agosto', 'Septiembre', 'Octubre', 'Noviembre', 'Diciembre'],
595
+ * applyLabel: 'Aplicar',
596
+ * cancelLabel: 'Cancelar',
597
+ * firstDay: 1 // Monday first
598
+ * };
599
+ *
600
+ * // US format (MM/DD/YYYY)
601
+ * const usLocale: NgxDatexLocale = {
602
+ * locale: 'en-US',
603
+ * format: 'MM/DD/YYYY', // 01/15/2024
604
+ * separator: ' - ',
605
+ * daysOfWeek: ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'],
606
+ * monthNames: ['January', 'February', 'March', 'April', 'May', 'June',
607
+ * 'July', 'August', 'September', 'October', 'November', 'December'],
608
+ * applyLabel: 'Apply',
609
+ * cancelLabel: 'Cancel',
610
+ * firstDay: 0 // Sunday first
611
+ * };
612
+ *
613
+ * // ISO format (YYYY-MM-DD)
614
+ * const isoLocale: NgxDatexLocale = {
615
+ * locale: 'en-US',
616
+ * format: 'YYYY-MM-DD', // 2024-01-15
617
+ * separator: ' / ',
618
+ * daysOfWeek: ['Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa', 'Su'],
619
+ * monthNames: ['January', 'February', 'March', 'April', 'May', 'June',
620
+ * 'July', 'August', 'September', 'October', 'November', 'December'],
621
+ * applyLabel: 'Apply',
622
+ * cancelLabel: 'Cancel',
623
+ * firstDay: 1 // Monday first
624
+ * };
625
+ * ```
626
+ *
627
+ * ### Time Picker Formats:
388
628
  * ```typescript
629
+ * // Spanish with 24-hour time
630
+ * const spanishWithTime: NgxDatexLocale = {
631
+ * locale: 'es-ES',
632
+ * format: 'DD/MM/YYYY HH:mm', // 15/01/2024 14:30
633
+ * separator: ' - ',
634
+ * daysOfWeek: ['Lu', 'Ma', 'Mi', 'Ju', 'Vi', 'Sa', 'Do'],
635
+ * monthNames: ['Enero', 'Febrero', 'Marzo', 'Abril', 'Mayo', 'Junio',
636
+ * 'Julio', 'Agosto', 'Septiembre', 'Octubre', 'Noviembre', 'Diciembre'],
637
+ * applyLabel: 'Aplicar',
638
+ * cancelLabel: 'Cancelar'
639
+ * };
640
+ *
641
+ * // US with 12-hour time
642
+ * const usWithTime: NgxDatexLocale = {
643
+ * locale: 'en-US',
644
+ * format: 'MM/DD/YYYY hh:mm A', // 01/15/2024 02:30 PM
645
+ * separator: ' - ',
646
+ * daysOfWeek: ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'],
647
+ * monthNames: ['January', 'February', 'March', 'April', 'May', 'June',
648
+ * 'July', 'August', 'September', 'October', 'November', 'December'],
649
+ * applyLabel: 'Apply',
650
+ * cancelLabel: 'Cancel'
651
+ * };
652
+ *
653
+ * // French locale
389
654
  * const frenchLocale: NgxDatexLocale = {
655
+ * locale: 'fr-FR',
390
656
  * format: 'DD/MM/YYYY',
657
+ * separator: ' au ',
391
658
  * daysOfWeek: ['Lu', 'Ma', 'Me', 'Je', 'Ve', 'Sa', 'Di'],
659
+ * monthNames: ['Janvier', 'Février', 'Mars', 'Avril', 'Mai', 'Juin',
660
+ * 'Juillet', 'Août', 'Septembre', 'Octobre', 'Novembre', 'Décembre'],
392
661
  * applyLabel: 'Appliquer',
393
- * cancelLabel: 'Annuler'
662
+ * cancelLabel: 'Annuler',
663
+ * customRangeLabel: 'Plage personnalisée',
664
+ * firstDay: 1
665
+ * };
666
+ *
667
+ * // German locale
668
+ * const germanLocale: NgxDatexLocale = {
669
+ * locale: 'de-DE',
670
+ * format: 'DD.MM.YYYY',
671
+ * separator: ' bis ',
672
+ * daysOfWeek: ['Mo', 'Di', 'Mi', 'Do', 'Fr', 'Sa', 'So'],
673
+ * monthNames: ['Januar', 'Februar', 'März', 'April', 'Mai', 'Juni',
674
+ * 'Juli', 'August', 'September', 'Oktober', 'November', 'Dezember'],
675
+ * applyLabel: 'Anwenden',
676
+ * cancelLabel: 'Abbrechen',
677
+ * customRangeLabel: 'Benutzerdefiniert',
678
+ * firstDay: 1
394
679
  * };
395
680
  * ```
681
+ *
682
+ * ## Component Usage:
683
+ * ```html
684
+ * <!-- Spanish date picker -->
685
+ * <ngx-datex [locale]="spanishLocale"></ngx-datex>
686
+ *
687
+ * <!-- US date picker with time -->
688
+ * <ngx-datex
689
+ * [locale]="usWithTime"
690
+ * [timePicker]="true"
691
+ * [timePicker24Hour]="false">
692
+ * </ngx-datex>
693
+ *
694
+ * <!-- French date picker -->
695
+ * <ngx-datex [locale]="frenchLocale"></ngx-datex>
696
+ *
697
+ * <!-- Using predefined locales -->
698
+ * <ngx-datex [locale]="SPANISH_LOCALE"></ngx-datex>
699
+ * <ngx-datex [locale]="US_ENGLISH_LOCALE"></ngx-datex>
700
+ * <ngx-datex [locale]="SPANISH_LOCALE_WITH_TIME"></ngx-datex>
701
+ * ```
702
+ *
703
+ * ## Important Notes:
704
+ *
705
+ * 1. **TimePicker Format**: When `timePicker=true`, you MUST include time tokens in the format
706
+ * 2. **Locale Code**: The `locale` property affects @formkit/tempo formatting behavior
707
+ * 3. **Day Order**: `daysOfWeek` array should match your `firstDay` setting
708
+ * 4. **Separator**: Used between start and end dates in range display
709
+ * 5. **Predefined Locales**: Use exported constants like `SPANISH_LOCALE`, `US_ENGLISH_LOCALE`
710
+ *
711
+ * @see {@link NgxDatexLocale} for complete interface documentation
712
+ * @see {@link SPANISH_LOCALE} for default Spanish configuration
713
+ * @see {@link US_ENGLISH_LOCALE} for US English configuration
714
+ * @see {@link SPANISH_LOCALE_WITH_TIME} for Spanish with time support
396
715
  */
397
716
  locale: _angular_core.InputSignal<NgxDatexLocale>;
398
717
  /**
@@ -500,6 +819,18 @@ declare class NgxDatex implements OnInit, OnDestroy, ControlValueAccessor {
500
819
  * ```
501
820
  */
502
821
  showCheckbox: _angular_core.InputSignal<boolean>;
822
+ /**
823
+ * Initial checked state of the checkbox.
824
+ * Only applies when showCheckbox is true.
825
+ *
826
+ * @default false
827
+ *
828
+ * @example
829
+ * ```html
830
+ * <ngx-datex [showCheckbox]="true" [checkboxChecked]="true"></ngx-datex>
831
+ * ```
832
+ */
833
+ checkboxChecked: _angular_core.InputSignal<boolean>;
503
834
  /**
504
835
  * Position of the checkbox relative to the input.
505
836
  *
@@ -1403,6 +1734,11 @@ declare class NgxDatex implements OnInit, OnDestroy, ControlValueAccessor {
1403
1734
  * ```
1404
1735
  */
1405
1736
  closeCalendar(): void;
1737
+ /**
1738
+ * Closes the calendar and checks for pending changes to emit.
1739
+ * Used when calendar is closed without explicit apply (ESC, click outside, etc.)
1740
+ */
1741
+ private closeCalendarWithChangeCheck;
1406
1742
  /**
1407
1743
  * Applies the current selection and closes the calendar.
1408
1744
  * Only works if there's a valid selection to apply.
@@ -1454,6 +1790,28 @@ declare class NgxDatex implements OnInit, OnDestroy, ControlValueAccessor {
1454
1790
  */
1455
1791
  selectRange(label: string): void;
1456
1792
  selectCustomRange(): void;
1793
+ /**
1794
+ * Gets the current checkbox state.
1795
+ *
1796
+ * @returns Current checkbox checked state
1797
+ *
1798
+ * @example
1799
+ * ```typescript
1800
+ * const isChecked = this.datePicker.getCheckboxValue();
1801
+ * ```
1802
+ */
1803
+ getCheckboxValue(): boolean;
1804
+ /**
1805
+ * Sets the checkbox state programmatically.
1806
+ *
1807
+ * @param checked - New checkbox state
1808
+ *
1809
+ * @example
1810
+ * ```typescript
1811
+ * this.datePicker.setCheckboxValue(true);
1812
+ * ```
1813
+ */
1814
+ setCheckboxValue(checked: boolean): void;
1457
1815
  onInputClick(): void;
1458
1816
  onInputFocus(): void;
1459
1817
  onInputBlur(): void;
@@ -1507,7 +1865,7 @@ declare class NgxDatex implements OnInit, OnDestroy, ControlValueAccessor {
1507
1865
  private parseInputDate;
1508
1866
  private createOverlay;
1509
1867
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<NgxDatex, never>;
1510
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<NgxDatex, "ngx-datex", never, { "config": { "alias": "config"; "required": false; "isSignal": true; }; "locale": { "alias": "locale"; "required": false; "isSignal": true; }; "theme": { "alias": "theme"; "required": false; "isSignal": true; }; "appearance": { "alias": "appearance"; "required": false; "isSignal": true; }; "floatLabel": { "alias": "floatLabel"; "required": false; "isSignal": true; }; "label": { "alias": "label"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "calendarIcon": { "alias": "calendarIcon"; "required": false; "isSignal": true; }; "showCalendarIcon": { "alias": "showCalendarIcon"; "required": false; "isSignal": true; }; "calendarIconPosition": { "alias": "calendarIconPosition"; "required": false; "isSignal": true; }; "showCheckbox": { "alias": "showCheckbox"; "required": false; "isSignal": true; }; "checkboxPosition": { "alias": "checkboxPosition"; "required": false; "isSignal": true; }; "readonly": { "alias": "readonly"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "showHeader": { "alias": "showHeader"; "required": false; "isSignal": true; }; "showFooter": { "alias": "showFooter"; "required": false; "isSignal": true; }; "singleDatePicker": { "alias": "singleDatePicker"; "required": false; "isSignal": true; }; "autoApply": { "alias": "autoApply"; "required": false; "isSignal": true; }; "showDropdowns": { "alias": "showDropdowns"; "required": false; "isSignal": true; }; "timePicker": { "alias": "timePicker"; "required": false; "isSignal": true; }; "timePicker24Hour": { "alias": "timePicker24Hour"; "required": false; "isSignal": true; }; "timePickerIncrement": { "alias": "timePickerIncrement"; "required": false; "isSignal": true; }; "timePickerSeconds": { "alias": "timePickerSeconds"; "required": false; "isSignal": true; }; "linkedCalendars": { "alias": "linkedCalendars"; "required": false; "isSignal": true; }; "autoUpdateInput": { "alias": "autoUpdateInput"; "required": false; "isSignal": true; }; "alwaysShowCalendars": { "alias": "alwaysShowCalendars"; "required": false; "isSignal": true; }; "showCustomRangeLabel": { "alias": "showCustomRangeLabel"; "required": false; "isSignal": true; }; "startDate": { "alias": "startDate"; "required": false; "isSignal": true; }; "endDate": { "alias": "endDate"; "required": false; "isSignal": true; }; "minDate": { "alias": "minDate"; "required": false; "isSignal": true; }; "maxDate": { "alias": "maxDate"; "required": false; "isSignal": true; }; "maxSpan": { "alias": "maxSpan"; "required": false; "isSignal": true; }; "showWeekNumbers": { "alias": "showWeekNumbers"; "required": false; "isSignal": true; }; "showISOWeekNumbers": { "alias": "showISOWeekNumbers"; "required": false; "isSignal": true; }; "buttonClasses": { "alias": "buttonClasses"; "required": false; "isSignal": true; }; "applyButtonClasses": { "alias": "applyButtonClasses"; "required": false; "isSignal": true; }; "cancelButtonClasses": { "alias": "cancelButtonClasses"; "required": false; "isSignal": true; }; "isInvalidDate": { "alias": "isInvalidDate"; "required": false; "isSignal": true; }; "isCustomDate": { "alias": "isCustomDate"; "required": false; "isSignal": true; }; "minYear": { "alias": "minYear"; "required": false; "isSignal": true; }; "maxYear": { "alias": "maxYear"; "required": false; "isSignal": true; }; "ranges": { "alias": "ranges"; "required": false; "isSignal": true; }; "opens": { "alias": "opens"; "required": false; "isSignal": true; }; "drops": { "alias": "drops"; "required": false; "isSignal": true; }; "headerTemplate": { "alias": "headerTemplate"; "required": false; "isSignal": true; }; "footerTemplate": { "alias": "footerTemplate"; "required": false; "isSignal": true; }; "dayTemplate": { "alias": "dayTemplate"; "required": false; "isSignal": true; }; "ariaLabel": { "alias": "ariaLabel"; "required": false; "isSignal": true; }; "ariaDescribedBy": { "alias": "ariaDescribedBy"; "required": false; "isSignal": true; }; }, { "dateChange": "dateChange"; "rangeChange": "rangeChange"; "openEvent": "openEvent"; "closeEvent": "closeEvent"; "monthChange": "monthChange"; "yearChange": "yearChange"; "dateHover": "dateHover"; "validationError": "validationError"; "checkboxChange": "checkboxChange"; }, never, never, true, never>;
1868
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<NgxDatex, "ngx-datex", never, { "config": { "alias": "config"; "required": false; "isSignal": true; }; "locale": { "alias": "locale"; "required": false; "isSignal": true; }; "theme": { "alias": "theme"; "required": false; "isSignal": true; }; "appearance": { "alias": "appearance"; "required": false; "isSignal": true; }; "floatLabel": { "alias": "floatLabel"; "required": false; "isSignal": true; }; "label": { "alias": "label"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "calendarIcon": { "alias": "calendarIcon"; "required": false; "isSignal": true; }; "showCalendarIcon": { "alias": "showCalendarIcon"; "required": false; "isSignal": true; }; "calendarIconPosition": { "alias": "calendarIconPosition"; "required": false; "isSignal": true; }; "showCheckbox": { "alias": "showCheckbox"; "required": false; "isSignal": true; }; "checkboxChecked": { "alias": "checkboxChecked"; "required": false; "isSignal": true; }; "checkboxPosition": { "alias": "checkboxPosition"; "required": false; "isSignal": true; }; "readonly": { "alias": "readonly"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "showHeader": { "alias": "showHeader"; "required": false; "isSignal": true; }; "showFooter": { "alias": "showFooter"; "required": false; "isSignal": true; }; "singleDatePicker": { "alias": "singleDatePicker"; "required": false; "isSignal": true; }; "autoApply": { "alias": "autoApply"; "required": false; "isSignal": true; }; "showDropdowns": { "alias": "showDropdowns"; "required": false; "isSignal": true; }; "timePicker": { "alias": "timePicker"; "required": false; "isSignal": true; }; "timePicker24Hour": { "alias": "timePicker24Hour"; "required": false; "isSignal": true; }; "timePickerIncrement": { "alias": "timePickerIncrement"; "required": false; "isSignal": true; }; "timePickerSeconds": { "alias": "timePickerSeconds"; "required": false; "isSignal": true; }; "linkedCalendars": { "alias": "linkedCalendars"; "required": false; "isSignal": true; }; "autoUpdateInput": { "alias": "autoUpdateInput"; "required": false; "isSignal": true; }; "alwaysShowCalendars": { "alias": "alwaysShowCalendars"; "required": false; "isSignal": true; }; "showCustomRangeLabel": { "alias": "showCustomRangeLabel"; "required": false; "isSignal": true; }; "startDate": { "alias": "startDate"; "required": false; "isSignal": true; }; "endDate": { "alias": "endDate"; "required": false; "isSignal": true; }; "minDate": { "alias": "minDate"; "required": false; "isSignal": true; }; "maxDate": { "alias": "maxDate"; "required": false; "isSignal": true; }; "maxSpan": { "alias": "maxSpan"; "required": false; "isSignal": true; }; "showWeekNumbers": { "alias": "showWeekNumbers"; "required": false; "isSignal": true; }; "showISOWeekNumbers": { "alias": "showISOWeekNumbers"; "required": false; "isSignal": true; }; "buttonClasses": { "alias": "buttonClasses"; "required": false; "isSignal": true; }; "applyButtonClasses": { "alias": "applyButtonClasses"; "required": false; "isSignal": true; }; "cancelButtonClasses": { "alias": "cancelButtonClasses"; "required": false; "isSignal": true; }; "isInvalidDate": { "alias": "isInvalidDate"; "required": false; "isSignal": true; }; "isCustomDate": { "alias": "isCustomDate"; "required": false; "isSignal": true; }; "minYear": { "alias": "minYear"; "required": false; "isSignal": true; }; "maxYear": { "alias": "maxYear"; "required": false; "isSignal": true; }; "ranges": { "alias": "ranges"; "required": false; "isSignal": true; }; "opens": { "alias": "opens"; "required": false; "isSignal": true; }; "drops": { "alias": "drops"; "required": false; "isSignal": true; }; "headerTemplate": { "alias": "headerTemplate"; "required": false; "isSignal": true; }; "footerTemplate": { "alias": "footerTemplate"; "required": false; "isSignal": true; }; "dayTemplate": { "alias": "dayTemplate"; "required": false; "isSignal": true; }; "ariaLabel": { "alias": "ariaLabel"; "required": false; "isSignal": true; }; "ariaDescribedBy": { "alias": "ariaDescribedBy"; "required": false; "isSignal": true; }; }, { "dateChange": "dateChange"; "rangeChange": "rangeChange"; "openEvent": "openEvent"; "closeEvent": "closeEvent"; "monthChange": "monthChange"; "yearChange": "yearChange"; "dateHover": "dateHover"; "validationError": "validationError"; "checkboxChange": "checkboxChange"; }, never, never, true, never>;
1511
1869
  }
1512
1870
 
1513
1871
  /**
@@ -1528,6 +1886,74 @@ declare class NgxDatex implements OnInit, OnDestroy, ControlValueAccessor {
1528
1886
  * ```
1529
1887
  */
1530
1888
  declare const SPANISH_LOCALE: NgxDatexLocale;
1889
+ /**
1890
+ * Spanish locale with time picker support (24-hour format).
1891
+ *
1892
+ * Same as SPANISH_LOCALE but with DD/MM/YYYY HH:mm format for time picker usage.
1893
+ *
1894
+ * @example
1895
+ * ```typescript
1896
+ * <ngx-datex [locale]="SPANISH_LOCALE_WITH_TIME" [timePicker]="true"></ngx-datex>
1897
+ * ```
1898
+ */
1899
+ declare const SPANISH_LOCALE_WITH_TIME: NgxDatexLocale;
1900
+ /**
1901
+ * Spanish locale with time picker support (12-hour format).
1902
+ *
1903
+ * Same as SPANISH_LOCALE but with DD/MM/YYYY hh:mm A format for 12-hour time picker.
1904
+ *
1905
+ * @example
1906
+ * ```typescript
1907
+ * <ngx-datex [locale]="SPANISH_LOCALE_WITH_TIME_12H" [timePicker]="true" [timePicker24Hour]="false"></ngx-datex>
1908
+ * ```
1909
+ */
1910
+ declare const SPANISH_LOCALE_WITH_TIME_12H: NgxDatexLocale;
1911
+ /**
1912
+ * US English locale configuration.
1913
+ *
1914
+ * Provides English language support with MM/DD/YYYY format,
1915
+ * English day/month names, and Sunday as the first day of the week.
1916
+ *
1917
+ * @example
1918
+ * ```typescript
1919
+ * <ngx-datex [locale]="US_ENGLISH_LOCALE"></ngx-datex>
1920
+ * ```
1921
+ */
1922
+ declare const US_ENGLISH_LOCALE: NgxDatexLocale;
1923
+ /**
1924
+ * US English locale with time picker support (12-hour format).
1925
+ *
1926
+ * Same as US_ENGLISH_LOCALE but with MM/DD/YYYY hh:mm A format for time picker usage.
1927
+ *
1928
+ * @example
1929
+ * ```typescript
1930
+ * <ngx-datex [locale]="US_ENGLISH_LOCALE_WITH_TIME" [timePicker]="true" [timePicker24Hour]="false"></ngx-datex>
1931
+ * ```
1932
+ */
1933
+ declare const US_ENGLISH_LOCALE_WITH_TIME: NgxDatexLocale;
1934
+ /**
1935
+ * ISO format locale configuration.
1936
+ *
1937
+ * Provides YYYY-MM-DD format commonly used in APIs and databases,
1938
+ * with English labels and Monday as the first day of the week.
1939
+ *
1940
+ * @example
1941
+ * ```typescript
1942
+ * <ngx-datex [locale]="ISO_LOCALE"></ngx-datex>
1943
+ * ```
1944
+ */
1945
+ declare const ISO_LOCALE: NgxDatexLocale;
1946
+ /**
1947
+ * ISO format locale with time picker support (24-hour format).
1948
+ *
1949
+ * Same as ISO_LOCALE but with YYYY-MM-DD HH:mm format for time picker usage.
1950
+ *
1951
+ * @example
1952
+ * ```typescript
1953
+ * <ngx-datex [locale]="ISO_LOCALE_WITH_TIME" [timePicker]="true"></ngx-datex>
1954
+ * ```
1955
+ */
1956
+ declare const ISO_LOCALE_WITH_TIME: NgxDatexLocale;
1531
1957
  /**
1532
1958
  * Default Material Design light theme.
1533
1959
  *
@@ -1576,8 +2002,8 @@ declare const DEFAULT_RANGES: Record<string, [Date, Date]>;
1576
2002
  *
1577
2003
  * // Update configuration
1578
2004
  * this.datexService.updateConfig({
1579
- * dateFormat: 'DD/MM/YYYY',
1580
- * firstDayOfWeek: 1
2005
+ * firstDayOfWeek: 1,
2006
+ * businessDaysOnly: true
1581
2007
  * });
1582
2008
  *
1583
2009
  * // Format a date range
@@ -1595,9 +2021,9 @@ declare class NgxDatexService {
1595
2021
  * @example
1596
2022
  * ```typescript
1597
2023
  * this.datexService.updateConfig({
1598
- * dateFormat: 'YYYY-MM-DD',
1599
2024
  * firstDayOfWeek: 0, // Sunday
1600
- * businessDaysOnly: true
2025
+ * businessDaysOnly: true,
2026
+ * showWeekNumbers: true
1601
2027
  * });
1602
2028
  * ```
1603
2029
  */
@@ -2000,10 +2426,10 @@ declare class NgxDatexTimePickerService {
2000
2426
 
2001
2427
  declare class NgxDatexCalendarService {
2002
2428
  updateMonthsInView(startDate: Date, endDate: Date | null, currentLeftMonth: Date, currentRightMonth: Date, singleDatePicker: boolean, linkedCalendars: boolean, maxDate: Date | null, onLeftMonthChange: (month: Date) => void, onRightMonthChange: (month: Date) => void): void;
2003
- setStartDate(startDate: Date, minDate: Date | null, maxDate: Date | null, timePicker: boolean, timePickerIncrement: number): Date;
2429
+ setStartDate(startDate: Date, minDate: Date | null, maxDate: Date | null, timePicker: boolean, timePickerIncrement: number, currentStartDate?: Date | null): Date;
2004
2430
  setEndDate(endDate: Date, startDate: Date, maxDate: Date | null, maxSpan: {
2005
2431
  [key: string]: number;
2006
- } | null, timePicker: boolean, timePickerIncrement: number): Date;
2432
+ } | null, timePicker: boolean, timePickerIncrement: number, currentEndDate?: Date | null): Date;
2007
2433
  private getMaxSpanDays;
2008
2434
  isDateDisabled(date: Date, minDate: Date | null, maxDate: Date | null, maxSpan: {
2009
2435
  [key: string]: number;
@@ -2148,14 +2574,47 @@ declare function isSameMonth(date1: Date, date2: Date): boolean;
2148
2574
  * ```
2149
2575
  */
2150
2576
  declare function isSameYear(date1: Date, date2: Date): boolean;
2151
- declare function formatDateValue(date: Date, formatStr: string): string;
2152
- declare function parseDateValue(dateStr: string, formatStr: string): Date;
2153
- declare function isSameDate(date1: Date, date2: Date, unit?: 'day' | 'month' | 'year'): boolean;
2577
+ /**
2578
+ * Formats a date using the specified format string and locale.
2579
+ * Follows vanilla-daterangepicker logic by always using locale.format.
2580
+ *
2581
+ * @param date - The date to format
2582
+ * @param formatStr - Format string (e.g., 'DD/MM/YYYY', 'MM/DD/YYYY HH:mm')
2583
+ * @param locale - Optional locale string (e.g., 'es-ES', 'en-US')
2584
+ * @returns Formatted date string
2585
+ *
2586
+ * @example
2587
+ * ```typescript
2588
+ * const date = new Date('2024-01-15 14:30:00');
2589
+ * formatDateValue(date, 'DD/MM/YYYY'); // '15/01/2024'
2590
+ * formatDateValue(date, 'MM/DD/YYYY hh:mm A'); // '01/15/2024 02:30 PM'
2591
+ * formatDateValue(date, 'DD/MM/YYYY HH:mm', 'es-ES'); // '15/01/2024 14:30'
2592
+ * ```
2593
+ */
2594
+ declare function formatDateValue(date: Date, formatStr: string, locale?: string): string;
2595
+ /**
2596
+ * Parses a date string using the specified format string and locale.
2597
+ * Follows vanilla-daterangepicker logic by always using locale.format.
2598
+ *
2599
+ * @param dateStr - The date string to parse
2600
+ * @param formatStr - Format string (e.g., 'DD/MM/YYYY', 'MM/DD/YYYY HH:mm')
2601
+ * @param locale - Optional locale string (e.g., 'es-ES', 'en-US')
2602
+ * @returns Parsed Date object
2603
+ *
2604
+ * @example
2605
+ * ```typescript
2606
+ * const date1 = parseDateValue('15/01/2024', 'DD/MM/YYYY'); // January 15, 2024
2607
+ * const date2 = parseDateValue('01/15/2024 02:30 PM', 'MM/DD/YYYY hh:mm A'); // January 15, 2024 14:30
2608
+ * const date3 = parseDateValue('15/01/2024 14:30', 'DD/MM/YYYY HH:mm', 'es-ES'); // January 15, 2024 14:30
2609
+ * ```
2610
+ */
2611
+ declare function parseDateValue(dateStr: string, formatStr: string, locale?: string): Date;
2612
+ declare function isSameDate(date1: Date, date2: Date, unit?: 'day' | 'month' | 'year' | 'minute' | 'second'): boolean;
2154
2613
  declare function isValidDate(date: Date | null | undefined): date is Date;
2155
2614
  declare function isBeforeDate(date1: Date, date2: Date): boolean;
2156
2615
  declare function getStartOfMonth(date: Date): Date;
2157
2616
  declare function getStartOfWeek(date: Date, firstDay?: number): Date;
2158
2617
  declare function isMobileDevice(): boolean;
2159
2618
 
2160
- export { DEFAULT_RANGES, MATERIAL_LIGHT_THEME, NgxDatex, NgxDatexCalendarService, NgxDatexOverlayService, NgxDatexService, NgxDatexTimePickerService, SPANISH_LOCALE, addDays, addMonths, endOfDay, formatDateValue, getStartOfMonth, getStartOfWeek, isBeforeDate, isMobileDevice, isSameDate, isSameDay, isSameMonth, isSameYear, isValidDate, parseDateValue, startOfDay, startOfMonth, startOfWeek };
2619
+ export { DEFAULT_RANGES, ISO_LOCALE, ISO_LOCALE_WITH_TIME, MATERIAL_LIGHT_THEME, NgxDatex, NgxDatexCalendarService, NgxDatexOverlayService, NgxDatexService, NgxDatexTimePickerService, SPANISH_LOCALE, SPANISH_LOCALE_WITH_TIME, SPANISH_LOCALE_WITH_TIME_12H, US_ENGLISH_LOCALE, US_ENGLISH_LOCALE_WITH_TIME, addDays, addMonths, endOfDay, formatDateValue, getStartOfMonth, getStartOfWeek, isBeforeDate, isMobileDevice, isSameDate, isSameDay, isSameMonth, isSameYear, isValidDate, parseDateValue, startOfDay, startOfMonth, startOfWeek };
2161
2620
  export type { NgxDatexConfig, NgxDatexInputs, NgxDatexLocale, NgxDatexOutputs, NgxDatexOverlayPosition, NgxDatexRange, NgxDatexTheme, NgxDatexTimeValue, NgxDatexValidationResult, NgxDatexValue };