angular-hijri-gregorian-date-time-picker 1.5.4 → 1.5.6
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
CHANGED
|
@@ -25,8 +25,9 @@
|
|
|
25
25
|
- **⏰ Time Picker** - Full time selection with 12-hour/24-hour format support
|
|
26
26
|
- **📅 Range Selection** - Select date ranges with start and end dates
|
|
27
27
|
- **🎨 Beautiful Custom Selects** - Modern dropdown menus with smooth animations and Remix Icons
|
|
28
|
-
- **🌐 Bilingual Typography** -
|
|
28
|
+
- **🌐 Bilingual Typography** - Custom Default-Regular font for consistent Arabic and English text
|
|
29
29
|
- **🎯 Initial Date Support** - Pre-select dates/ranges when calendar loads (`initialDate`, `initialRangeStart`, `initialRangeEnd`)
|
|
30
|
+
- **🌍 Translatable Labels** - Full i18n support including AM/PM labels (`amLabel`, `pmLabel`)
|
|
30
31
|
|
|
31
32
|
### 🚀 UI/UX Enhancements
|
|
32
33
|
- Redesigned year/month selectors with professional styling
|
|
@@ -52,7 +53,7 @@ However, the Gregorian calendar is the calendar used in most of the world, and i
|
|
|
52
53
|
## Features
|
|
53
54
|
|
|
54
55
|
- Can be used as a calendar or a datepicker with **time selection**.
|
|
55
|
-
- **RTL** and **LTR** support with **bilingual typography**
|
|
56
|
+
- **RTL** and **LTR** support with **bilingual typography** using Default-Regular font
|
|
56
57
|
- Easy to switch between **Gregorian** and **Hijri** calendars.
|
|
57
58
|
- Ability to specify the default calendar type either **Gregorian** or **Hijri**.
|
|
58
59
|
- Converting dates when changing type of calendar.
|
|
@@ -61,6 +62,7 @@ However, the Gregorian calendar is the calendar used in most of the world, and i
|
|
|
61
62
|
- Very easy to customize with **beautiful custom select dropdowns**.
|
|
62
63
|
- Can select **Single**, **Multiple** dates, or **Date Ranges**.
|
|
63
64
|
- **Time picker** with 12-hour/24-hour format support.
|
|
65
|
+
- **Translatable labels** including AM/PM for 12-hour format.
|
|
64
66
|
- **Initial date** and **initial range** support for pre-selecting dates.
|
|
65
67
|
- **Event listeners** for all datepicker events.
|
|
66
68
|
- Can customize future and past years number.
|
|
@@ -78,52 +80,7 @@ Other browsers: <b>Edge v.41 - 44</b> (without code hidden feature)
|
|
|
78
80
|
|
|
79
81
|
## Installation
|
|
80
82
|
|
|
81
|
-
|
|
82
|
-
npm install angular-hijri-gregorian-date-time-picker
|
|
83
|
-
```
|
|
84
|
-
|
|
85
|
-
## ⚠️ IMPORTANT: Required Setup After Installation
|
|
86
|
-
|
|
87
|
-
**The package requires global styles to be imported for fonts and icons to work properly.**
|
|
88
|
-
|
|
89
|
-
### Quick Setup
|
|
90
|
-
|
|
91
|
-
Add to your `angular.json`:
|
|
92
|
-
|
|
93
|
-
```json
|
|
94
|
-
{
|
|
95
|
-
"projects": {
|
|
96
|
-
"your-app": {
|
|
97
|
-
"architect": {
|
|
98
|
-
"build": {
|
|
99
|
-
"options": {
|
|
100
|
-
"styles": [
|
|
101
|
-
"src/styles.scss",
|
|
102
|
-
"node_modules/angular-hijri-gregorian-date-time-picker/styles/global.scss"
|
|
103
|
-
]
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
```
|
|
111
|
-
|
|
112
|
-
**OR** import in your `src/styles.scss`:
|
|
113
|
-
|
|
114
|
-
```scss
|
|
115
|
-
@import 'angular-hijri-gregorian-date-time-picker/styles/global';
|
|
116
|
-
```
|
|
117
|
-
|
|
118
|
-
> 📖 **Having issues with fonts, icons, or TypeScript imports?**
|
|
119
|
-
> Read the [Complete Setup Guide](./SETUP_GUIDE.md) for troubleshooting.
|
|
120
|
-
|
|
121
|
-
### What This Includes:
|
|
122
|
-
- ✅ Custom fonts (`Default-Regular`)
|
|
123
|
-
- ✅ Remix Icon fonts (for time picker arrows)
|
|
124
|
-
- ✅ Proper font loading with `font-display: swap`
|
|
125
|
-
|
|
126
|
-
---
|
|
83
|
+
$ npm install angular-hijri-gregorian-date-time-picker
|
|
127
84
|
|
|
128
85
|
## Usage
|
|
129
86
|
|
|
@@ -228,6 +185,64 @@ Inside your component.ts:
|
|
|
228
185
|
}
|
|
229
186
|
```
|
|
230
187
|
|
|
188
|
+
---
|
|
189
|
+
|
|
190
|
+
## 🌍 Internationalization (i18n) Examples
|
|
191
|
+
|
|
192
|
+
### Translatable AM/PM Labels
|
|
193
|
+
|
|
194
|
+
The component supports full translation of AM/PM labels for 12-hour format:
|
|
195
|
+
|
|
196
|
+
**English (Default):**
|
|
197
|
+
```html
|
|
198
|
+
<hijri-gregorian-datetime-input
|
|
199
|
+
[enableTime]="true"
|
|
200
|
+
[useMeridian]="true"
|
|
201
|
+
[amLabel]="'AM'"
|
|
202
|
+
[pmLabel]="'PM'"
|
|
203
|
+
[locale]="'en'"
|
|
204
|
+
[dir]="'ltr'"
|
|
205
|
+
></hijri-gregorian-datetime-input>
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
**Arabic:**
|
|
209
|
+
```html
|
|
210
|
+
<hijri-gregorian-datetime-input
|
|
211
|
+
[enableTime]="true"
|
|
212
|
+
[useMeridian]="true"
|
|
213
|
+
[amLabel]="'ص'"
|
|
214
|
+
[pmLabel]="'م'"
|
|
215
|
+
[locale]="'ar'"
|
|
216
|
+
[dir]="'rtl'"
|
|
217
|
+
[todaysDateText]="'تاريخ اليوم'"
|
|
218
|
+
[ummAlQuraDateText]="'التاريخ الهجري'"
|
|
219
|
+
></hijri-gregorian-datetime-input>
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
**Custom Labels:**
|
|
223
|
+
```html
|
|
224
|
+
<hijri-gregorian-datetime-input
|
|
225
|
+
[enableTime]="true"
|
|
226
|
+
[useMeridian]="true"
|
|
227
|
+
[amLabel]="'Morning'"
|
|
228
|
+
[pmLabel]="'Evening'"
|
|
229
|
+
></hijri-gregorian-datetime-input>
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
**With Calendar Component:**
|
|
233
|
+
```html
|
|
234
|
+
<hijri-gregorian-datepicker
|
|
235
|
+
[enableTime]="true"
|
|
236
|
+
[useMeridian]="true"
|
|
237
|
+
[amLabel]="'صباحاً'"
|
|
238
|
+
[pmLabel]="'مساءً'"
|
|
239
|
+
[locale]="'ar'"
|
|
240
|
+
[dir]="'rtl'"
|
|
241
|
+
></hijri-gregorian-datepicker>
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
---
|
|
245
|
+
|
|
231
246
|
## @Inputs()
|
|
232
247
|
|
|
233
248
|
### DateTime Input Component
|
|
@@ -245,6 +260,8 @@ Inside your component.ts:
|
|
|
245
260
|
| <b>`dir`</b> | string | `ltr` | Layout direction, either `ltr` or `rtl` |
|
|
246
261
|
| <b>`selectionMode`</b> | string | `single` | Date selection mode, either `single` or `range` |
|
|
247
262
|
| <b>`useMeridian`</b> | boolean | `false` | When `true` uses 12-hour format with AM/PM, if `false` uses 24-hour format |
|
|
263
|
+
| <b>`amLabel`</b> | string | `AM` | Label for AM in 12-hour format (translatable) |
|
|
264
|
+
| <b>`pmLabel`</b> | string | `PM` | Label for PM in 12-hour format (translatable) |
|
|
248
265
|
| <b>`styles`</b> | object | `{}` | Styles configuration object |
|
|
249
266
|
| <b>`theme`</b> | string | `''` | Theme name (overrides styles) |
|
|
250
267
|
|
|
@@ -272,6 +289,8 @@ Inside your component.ts:
|
|
|
272
289
|
| <b>`submitTextButton`</b> | string | `Confirm` | Confirm button text value |
|
|
273
290
|
| <b>`todaysDateText`</b> | string | `Todays\'s Date` | Today's date text in `todaysDateSection` |
|
|
274
291
|
| <b>`ummAlQuraDateText`</b> | string | `التاريخ الهجرى` | Text next to checkbox to toggle date `todaysDateSection` |
|
|
292
|
+
| <b>`amLabel`</b> | string | `AM` | Label for AM in 12-hour format (translatable, e.g., 'ص' for Arabic) |
|
|
293
|
+
| <b>`pmLabel`</b> | string | `PM` | Label for PM in 12-hour format (translatable, e.g., 'م' for Arabic) |
|
|
275
294
|
| <b>`yearSelectLabel`</b> | string | `Year` | Label of the year select option |
|
|
276
295
|
| <b>`monthSelectLabel`</b> | string | `Month` | Label of the month select option |
|
|
277
296
|
| <b>`futureValidationMessageEn`</b> | string | `Selected date cannot be in the future!` | English future validation message if `futureValidation` is set to `true` |
|