ngxsmk-datepicker 2.2.8 → 2.2.9
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 +9 -8
- package/fesm2022/ngxsmk-datepicker.mjs +26 -35
- package/package.json +5 -7
package/README.md
CHANGED
|
@@ -13,26 +13,27 @@
|
|
|
13
13
|
[](https://www.npmjs.com/package/ngxsmk-datepicker)
|
|
14
14
|
[](https://angular.io/)
|
|
15
15
|
[](https://github.com/NGXSMK/ngxsmk-datepicker/blob/main/LICENSE)
|
|
16
|
+
[](https://buymeacoffee.com/toozuuu)
|
|
16
17
|
[](https://bundlephobia.com/package/ngxsmk-datepicker)
|
|
17
18
|
[](https://angular.dev/guide/zoneless)
|
|
18
19
|
|
|
19
20
|
**`npm i ngxsmk-datepicker`**
|
|
20
21
|
|
|
21
|
-
[Explore Live Demo](https://ngxsmk.github.io/ngxsmk-datepicker/) • [API Documentation](https://github.com/NGXSMK/ngxsmk-datepicker/blob/main/projects/ngxsmk-datepicker/docs/API.md) • [Submit Issue](https://github.com/NGXSMK/ngxsmk-datepicker/issues)
|
|
22
|
+
[Explore Live Demo](https://ngxsmk.github.io/ngxsmk-datepicker/) • [Buy me a coffee](https://buymeacoffee.com/toozuuu) • [API Documentation](https://github.com/NGXSMK/ngxsmk-datepicker/blob/main/projects/ngxsmk-datepicker/docs/API.md) • [Submit Issue](https://github.com/NGXSMK/ngxsmk-datepicker/issues)
|
|
22
23
|
|
|
23
24
|
</div>
|
|
24
25
|
|
|
25
26
|
---
|
|
26
27
|
|
|
27
|
-
**Last updated:** March
|
|
28
|
+
**Last updated:** March 24, 2026 · **Current stable:** v2.2.9
|
|
28
29
|
|
|
29
30
|
### **Overview**
|
|
30
31
|
|
|
31
32
|
**ngxsmk-datepicker** is a high-performance, enterprise-ready date and range picker engineered for the modern Angular ecosystem (v17+). Built from the ground up with **Angular Signals**, it delivers a seamless, zoneless-ready experience for both desktop and mobile (Ionic) applications.
|
|
32
33
|
|
|
33
|
-
> **Stable Release**: `v2.2.
|
|
34
|
+
> **Stable Release**: `v2.2.9` restores correct **npm** artifacts (compiled `fesm2022/` and types), adds range-mode **`allowSameDay`** for single-day selections, and continues to ship **IANA timezone** support, validation fixes, and strict TypeScript improvements from the v2.2.x line.
|
|
34
35
|
>
|
|
35
|
-
> ⚠️ **Important**: Versions 2.0.10 and 2.0.11 are broken and have been unpublished. Please use v2.2.
|
|
36
|
+
> ⚠️ **Important**: Versions 2.0.10 and 2.0.11 are broken and have been unpublished. Please use v2.2.9 or later.
|
|
36
37
|
|
|
37
38
|
---
|
|
38
39
|
|
|
@@ -590,7 +591,7 @@ The `locale` input controls all internationalization. It automatically formats m
|
|
|
590
591
|
|
|
591
592
|
### **Global Language Support**
|
|
592
593
|
|
|
593
|
-
ngxsmk-datepicker v2.2.
|
|
594
|
+
ngxsmk-datepicker v2.2.9 now features **full localization synchronization** for:
|
|
594
595
|
|
|
595
596
|
- 🇺🇸 English (`en`)
|
|
596
597
|
- 🇩🇪 German (`de`)
|
|
@@ -849,9 +850,9 @@ We welcome and appreciate contributions from the community! Whether it's reporti
|
|
|
849
850
|
|
|
850
851
|
For a full list of changes, please refer to the [CHANGELOG.md](https://github.com/NGXSMK/ngxsmk-datepicker/blob/main/CHANGELOG.md) file.
|
|
851
852
|
|
|
852
|
-
### **v2.2.
|
|
853
|
+
### **v2.2.9** (Current Stable)
|
|
853
854
|
|
|
854
|
-
- 🎉 **Version Update**: Updated to version 2.2.
|
|
855
|
+
- 🎉 **Version Update**: Updated to version 2.2.9.
|
|
855
856
|
- 📦 **npm**: Published tarballs again include `fesm2022/` and TypeScript declarations (release pipeline runs `ng build` before publish).
|
|
856
857
|
- 📅 **Range mode**: Optional `allowSameDay` for single-day ranges (double-click same date or close popover after one day).
|
|
857
858
|
- ✅ **Prior fixes**: IANA timezone “Today”, `minDate` normalization, strict typings, and UI polish from v2.2.6 remain included.
|
|
@@ -859,7 +860,7 @@ For a full list of changes, please refer to the [CHANGELOG.md](https://github.co
|
|
|
859
860
|
### **v1.9.24**
|
|
860
861
|
|
|
861
862
|
- 🎉 **Version Update**: Updated to version 1.9.24
|
|
862
|
-
- ✅ **Stable Release**: Version 2.2.
|
|
863
|
+
- ✅ **Stable Release**: Version 2.2.9 is the current stable version
|
|
863
864
|
|
|
864
865
|
### **v1.9.23**
|
|
865
866
|
|
|
@@ -7226,7 +7226,6 @@ class CustomDateFormatService {
|
|
|
7226
7226
|
if (!date) {
|
|
7227
7227
|
return '';
|
|
7228
7228
|
}
|
|
7229
|
-
let result = pattern;
|
|
7230
7229
|
const year = date.getFullYear();
|
|
7231
7230
|
const month = date.getMonth();
|
|
7232
7231
|
const dayOfMonth = date.getDate();
|
|
@@ -7238,36 +7237,30 @@ class CustomDateFormatService {
|
|
|
7238
7237
|
const isAM = hours24 < 12;
|
|
7239
7238
|
const monthNames = this.getMonthNames();
|
|
7240
7239
|
const weekdayNames = this.getWeekdayNames();
|
|
7241
|
-
|
|
7242
|
-
|
|
7243
|
-
|
|
7244
|
-
|
|
7245
|
-
|
|
7246
|
-
|
|
7247
|
-
|
|
7248
|
-
|
|
7249
|
-
|
|
7250
|
-
|
|
7251
|
-
|
|
7252
|
-
|
|
7253
|
-
|
|
7254
|
-
|
|
7255
|
-
|
|
7256
|
-
|
|
7257
|
-
|
|
7258
|
-
|
|
7259
|
-
|
|
7260
|
-
|
|
7261
|
-
|
|
7262
|
-
|
|
7263
|
-
|
|
7264
|
-
|
|
7265
|
-
result = result.replace(/ss/g, seconds.toString().padStart(2, '0'));
|
|
7266
|
-
result = result.replace(/s(?!s)/g, seconds.toString());
|
|
7267
|
-
// AM/PM
|
|
7268
|
-
result = result.replace(/A/g, isAM ? 'AM' : 'PM');
|
|
7269
|
-
result = result.replace(/a/g, isAM ? 'am' : 'pm');
|
|
7270
|
-
return result;
|
|
7240
|
+
const replacements = {
|
|
7241
|
+
'YYYY': year.toString(),
|
|
7242
|
+
'YY': year.toString().slice(-2),
|
|
7243
|
+
'MMMM': monthNames.full[month] || '',
|
|
7244
|
+
'MMM': monthNames.abbreviated[month] || '',
|
|
7245
|
+
'MM': (month + 1).toString().padStart(2, '0'),
|
|
7246
|
+
'M': (month + 1).toString(),
|
|
7247
|
+
'DDDD': weekdayNames.full[dayOfWeek] || '',
|
|
7248
|
+
'DDD': weekdayNames.abbreviated[dayOfWeek] || '',
|
|
7249
|
+
'DD': dayOfMonth.toString().padStart(2, '0'),
|
|
7250
|
+
'D': dayOfMonth.toString(),
|
|
7251
|
+
'HH': hours24.toString().padStart(2, '0'),
|
|
7252
|
+
'H': hours24.toString(),
|
|
7253
|
+
'hh': hours12.toString().padStart(2, '0'),
|
|
7254
|
+
'h': hours12.toString(),
|
|
7255
|
+
'mm': minutes.toString().padStart(2, '0'),
|
|
7256
|
+
'm': minutes.toString(),
|
|
7257
|
+
'ss': seconds.toString().padStart(2, '0'),
|
|
7258
|
+
's': seconds.toString(),
|
|
7259
|
+
'A': isAM ? 'AM' : 'PM',
|
|
7260
|
+
'a': isAM ? 'am' : 'pm',
|
|
7261
|
+
};
|
|
7262
|
+
const regex = /YYYY|YY|MMMM|MMM|MM|M|DDDD|DDD|DD|D|HH|H|hh|h|mm|m|ss|s|[Aa]/g;
|
|
7263
|
+
return pattern.replaceAll(regex, (match) => replacements[match] || match);
|
|
7271
7264
|
}
|
|
7272
7265
|
/**
|
|
7273
7266
|
* Parse a formatted date string back to a Date object
|
|
@@ -7282,7 +7275,7 @@ class CustomDateFormatService {
|
|
|
7282
7275
|
// For now, use basic date parsing as full pattern parsing is complex
|
|
7283
7276
|
// This can be enhanced in the future to support full pattern parsing
|
|
7284
7277
|
const date = new Date(dateString);
|
|
7285
|
-
return isNaN(date.getTime()) ? null : date;
|
|
7278
|
+
return Number.isNaN(date.getTime()) ? null : date;
|
|
7286
7279
|
}
|
|
7287
7280
|
catch {
|
|
7288
7281
|
return null;
|
|
@@ -7313,9 +7306,7 @@ class CustomDateFormatService {
|
|
|
7313
7306
|
getWeekdayNames() {
|
|
7314
7307
|
if (!this.weekdayNames.has(this.locale)) {
|
|
7315
7308
|
const weekdays = Array.from({ length: 7 }).map((_, i) => {
|
|
7316
|
-
|
|
7317
|
-
const dayIndex = (i + 1) % 7;
|
|
7318
|
-
const date = new Date(2000, 0, 2 + dayIndex); // Start from Sunday, Jan 2, 2000
|
|
7309
|
+
const date = new Date(2000, 0, 2 + i); // Jan 2, 2000 was a Sunday
|
|
7319
7310
|
return {
|
|
7320
7311
|
full: date.toLocaleDateString(this.locale, { weekday: 'long' }),
|
|
7321
7312
|
abbreviated: date.toLocaleDateString(this.locale, {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ngxsmk-datepicker",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.9",
|
|
4
4
|
"author": {
|
|
5
5
|
"name": "Sachin Dilshan",
|
|
6
6
|
"url": "https://www.linkedin.com/in/sachindilshan/"
|
|
@@ -80,15 +80,13 @@
|
|
|
80
80
|
},
|
|
81
81
|
"prepublishOnly": "node ../../scripts/assert-lib-publish-artifacts.cjs",
|
|
82
82
|
"exports": {
|
|
83
|
-
"./styles/*": {
|
|
84
|
-
"default": "./styles/*"
|
|
85
|
-
},
|
|
86
|
-
"./package.json": {
|
|
87
|
-
"default": "./package.json"
|
|
88
|
-
},
|
|
89
83
|
".": {
|
|
84
|
+
"import": "./fesm2022/ngxsmk-datepicker.mjs",
|
|
90
85
|
"types": "./types/ngxsmk-datepicker.d.ts",
|
|
91
86
|
"default": "./fesm2022/ngxsmk-datepicker.mjs"
|
|
87
|
+
},
|
|
88
|
+
"./package.json": {
|
|
89
|
+
"default": "./package.json"
|
|
92
90
|
}
|
|
93
91
|
}
|
|
94
92
|
}
|