@ui5/webcomponents-localization 0.0.0-c41f1b293 → 0.0.0-c6c04c609
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/CHANGELOG.md +245 -0
- package/README.md +2 -1
- package/dist/dates/modifyDateBy.d.ts +2 -1
- package/dist/dates/modifyDateBy.js +34 -19
- package/dist/dates/modifyDateBy.js.map +1 -1
- package/dist/generated/json-imports/LocaleData.js +74 -74
- package/dist/sap/base/i18n/LanguageTag.js +35 -0
- package/dist/sap/base/i18n/Localization.d.ts +4 -0
- package/dist/sap/base/i18n/Localization.js +12 -0
- package/dist/sap/base/i18n/Localization.js.map +1 -0
- package/dist/sap/base/i18n/date/CalendarType.js +8 -0
- package/dist/sap/base/i18n/date/CalendarWeekNumbering.js +30 -0
- package/dist/sap/base/i18n/date/TimezoneUtils.js +89 -0
- package/dist/sap/ui/base/Metadata.js +20 -9
- package/dist/sap/ui/core/CalendarType.js +2 -8
- package/dist/sap/ui/core/Configuration.d.ts +1 -0
- package/dist/sap/ui/core/Configuration.js +2 -0
- package/dist/sap/ui/core/Configuration.js.map +1 -1
- package/dist/sap/ui/core/Core.d.ts +1 -0
- package/dist/sap/ui/core/Locale.js +28 -125
- package/dist/sap/ui/core/LocaleData.js +36 -18
- package/dist/sap/ui/core/date/CalendarUtils.js +7 -18
- package/dist/sap/ui/core/date/CalendarWeekNumbering.js +2 -7
- package/dist/sap/ui/core/date/UniversalDate.js +5 -16
- package/dist/sap/ui/core/format/DateFormat.js +79 -37
- package/dist/sap/ui/core/format/TimezoneUtil.js +2 -89
- package/package.json +5 -5
- package/used-modules.txt +4 -0
package/CHANGELOG.md
CHANGED
@@ -3,6 +3,251 @@
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
5
5
|
|
6
|
+
# [1.20.0-rc.2](https://github.com/SAP/ui5-webcomponents/compare/v1.20.0-rc.1...v1.20.0-rc.2) (2023-11-23)
|
7
|
+
|
8
|
+
**Note:** Version bump only for package @ui5/webcomponents-localization
|
9
|
+
|
10
|
+
|
11
|
+
|
12
|
+
|
13
|
+
|
14
|
+
# [1.20.0-rc.1](https://github.com/SAP/ui5-webcomponents/compare/v1.20.0-rc.0...v1.20.0-rc.1) (2023-11-16)
|
15
|
+
|
16
|
+
|
17
|
+
### Bug Fixes
|
18
|
+
|
19
|
+
* declare webpackChunkName in generated dynamic imports for readable runtime bundle names ([#7835](https://github.com/SAP/ui5-webcomponents/issues/7835)) ([592a10b](https://github.com/SAP/ui5-webcomponents/commit/592a10b25a14da89885874c40c5c7a192b8b4d85))
|
20
|
+
|
21
|
+
|
22
|
+
|
23
|
+
|
24
|
+
|
25
|
+
# [1.20.0-rc.0](https://github.com/SAP/ui5-webcomponents/compare/v1.19.0...v1.20.0-rc.0) (2023-11-09)
|
26
|
+
|
27
|
+
**Note:** Version bump only for package @ui5/webcomponents-localization
|
28
|
+
|
29
|
+
|
30
|
+
|
31
|
+
|
32
|
+
|
33
|
+
# [1.19.0](https://github.com/SAP/ui5-webcomponents/compare/v1.19.0-rc.3...v1.19.0) (2023-11-02)
|
34
|
+
|
35
|
+
**Note:** Version bump only for package @ui5/webcomponents-localization
|
36
|
+
|
37
|
+
|
38
|
+
|
39
|
+
|
40
|
+
|
41
|
+
# [1.19.0-rc.3](https://github.com/SAP/ui5-webcomponents/compare/v1.19.0-rc.2...v1.19.0-rc.3) (2023-11-02)
|
42
|
+
|
43
|
+
**Note:** Version bump only for package @ui5/webcomponents-localization
|
44
|
+
|
45
|
+
|
46
|
+
|
47
|
+
|
48
|
+
|
49
|
+
# [1.19.0-rc.2](https://github.com/SAP/ui5-webcomponents/compare/v1.19.0-rc.1...v1.19.0-rc.2) (2023-10-26)
|
50
|
+
|
51
|
+
**Note:** Version bump only for package @ui5/webcomponents-localization
|
52
|
+
|
53
|
+
|
54
|
+
|
55
|
+
|
56
|
+
|
57
|
+
# [1.19.0-rc.1](https://github.com/SAP/ui5-webcomponents/compare/v1.19.0-rc.0...v1.19.0-rc.1) (2023-10-19)
|
58
|
+
|
59
|
+
**Note:** Version bump only for package @ui5/webcomponents-localization
|
60
|
+
|
61
|
+
|
62
|
+
|
63
|
+
|
64
|
+
|
65
|
+
# [1.19.0-rc.0](https://github.com/SAP/ui5-webcomponents/compare/v1.18.1-rc.0...v1.19.0-rc.0) (2023-10-12)
|
66
|
+
|
67
|
+
|
68
|
+
### Bug Fixes
|
69
|
+
|
70
|
+
* **localization:** missing calendarWeekNumbering ([#7684](https://github.com/SAP/ui5-webcomponents/issues/7684)) ([01a9349](https://github.com/SAP/ui5-webcomponents/commit/01a9349c7ab5e3c046fa10034dc9aa99b840f3d0))
|
71
|
+
|
72
|
+
|
73
|
+
|
74
|
+
|
75
|
+
|
76
|
+
## [1.18.1-rc.0](https://github.com/SAP/ui5-webcomponents/compare/v1.18.0...v1.18.1-rc.0) (2023-10-05)
|
77
|
+
|
78
|
+
**Note:** Version bump only for package @ui5/webcomponents-localization
|
79
|
+
|
80
|
+
|
81
|
+
|
82
|
+
|
83
|
+
|
84
|
+
# [1.18.0](https://github.com/SAP/ui5-webcomponents/compare/v1.18.0-rc.2...v1.18.0) (2023-10-02)
|
85
|
+
|
86
|
+
**Note:** Version bump only for package @ui5/webcomponents-localization
|
87
|
+
|
88
|
+
|
89
|
+
|
90
|
+
|
91
|
+
|
92
|
+
# [1.18.0-rc.2](https://github.com/SAP/ui5-webcomponents/compare/v1.18.0-rc.1...v1.18.0-rc.2) (2023-09-28)
|
93
|
+
|
94
|
+
**Note:** Version bump only for package @ui5/webcomponents-localization
|
95
|
+
|
96
|
+
|
97
|
+
|
98
|
+
|
99
|
+
|
100
|
+
# [1.18.0-rc.1](https://github.com/SAP/ui5-webcomponents/compare/v1.18.0-rc.0...v1.18.0-rc.1) (2023-09-21)
|
101
|
+
|
102
|
+
**Note:** Version bump only for package @ui5/webcomponents-localization
|
103
|
+
|
104
|
+
|
105
|
+
|
106
|
+
|
107
|
+
|
108
|
+
# [1.18.0-rc.0](https://github.com/SAP/ui5-webcomponents/compare/v1.17.0...v1.18.0-rc.0) (2023-09-07)
|
109
|
+
|
110
|
+
**Note:** Version bump only for package @ui5/webcomponents-localization
|
111
|
+
|
112
|
+
|
113
|
+
|
114
|
+
|
115
|
+
|
116
|
+
# [1.17.0](https://github.com/SAP/ui5-webcomponents/compare/v1.17.0-rc.2...v1.17.0) (2023-09-01)
|
117
|
+
|
118
|
+
**Note:** Version bump only for package @ui5/webcomponents-localization
|
119
|
+
|
120
|
+
|
121
|
+
|
122
|
+
|
123
|
+
|
124
|
+
# [1.17.0-rc.2](https://github.com/SAP/ui5-webcomponents/compare/v1.17.0-rc.1...v1.17.0-rc.2) (2023-08-24)
|
125
|
+
|
126
|
+
**Note:** Version bump only for package @ui5/webcomponents-localization
|
127
|
+
|
128
|
+
|
129
|
+
|
130
|
+
|
131
|
+
|
132
|
+
# [1.17.0-rc.1](https://github.com/SAP/ui5-webcomponents/compare/v1.17.0-rc.0...v1.17.0-rc.1) (2023-08-17)
|
133
|
+
|
134
|
+
**Note:** Version bump only for package @ui5/webcomponents-localization
|
135
|
+
|
136
|
+
|
137
|
+
|
138
|
+
|
139
|
+
|
140
|
+
# [1.17.0-rc.0](https://github.com/SAP/ui5-webcomponents/compare/v1.16.0...v1.17.0-rc.0) (2023-08-10)
|
141
|
+
|
142
|
+
**Note:** Version bump only for package @ui5/webcomponents-localization
|
143
|
+
|
144
|
+
|
145
|
+
|
146
|
+
|
147
|
+
|
148
|
+
# [1.16.0](https://github.com/SAP/ui5-webcomponents/compare/v1.16.0-rc.4...v1.16.0) (2023-08-03)
|
149
|
+
|
150
|
+
**Note:** Version bump only for package @ui5/webcomponents-localization
|
151
|
+
|
152
|
+
|
153
|
+
|
154
|
+
|
155
|
+
|
156
|
+
# [1.16.0-rc.4](https://github.com/SAP/ui5-webcomponents/compare/v1.16.0-rc.3...v1.16.0-rc.4) (2023-08-03)
|
157
|
+
|
158
|
+
**Note:** Version bump only for package @ui5/webcomponents-localization
|
159
|
+
|
160
|
+
|
161
|
+
|
162
|
+
|
163
|
+
|
164
|
+
# [1.16.0-rc.3](https://github.com/SAP/ui5-webcomponents/compare/v1.16.0-rc.2...v1.16.0-rc.3) (2023-07-27)
|
165
|
+
|
166
|
+
**Note:** Version bump only for package @ui5/webcomponents-localization
|
167
|
+
|
168
|
+
|
169
|
+
|
170
|
+
|
171
|
+
|
172
|
+
# [1.16.0-rc.2](https://github.com/SAP/ui5-webcomponents/compare/v1.16.0-rc.1...v1.16.0-rc.2) (2023-07-20)
|
173
|
+
|
174
|
+
**Note:** Version bump only for package @ui5/webcomponents-localization
|
175
|
+
|
176
|
+
|
177
|
+
|
178
|
+
|
179
|
+
|
180
|
+
# [1.16.0-rc.1](https://github.com/SAP/ui5-webcomponents/compare/v1.16.0-rc.0...v1.16.0-rc.1) (2023-07-13)
|
181
|
+
|
182
|
+
**Note:** Version bump only for package @ui5/webcomponents-localization
|
183
|
+
|
184
|
+
|
185
|
+
|
186
|
+
|
187
|
+
|
188
|
+
# [1.16.0-rc.0](https://github.com/SAP/ui5-webcomponents/compare/v1.15.1...v1.16.0-rc.0) (2023-07-06)
|
189
|
+
|
190
|
+
**Note:** Version bump only for package @ui5/webcomponents-localization
|
191
|
+
|
192
|
+
|
193
|
+
|
194
|
+
|
195
|
+
|
196
|
+
# [1.15.0](https://github.com/SAP/ui5-webcomponents/compare/v1.15.0-rc.2...v1.15.0) (2023-06-30)
|
197
|
+
|
198
|
+
**Note:** Version bump only for package @ui5/webcomponents-localization
|
199
|
+
|
200
|
+
|
201
|
+
|
202
|
+
|
203
|
+
|
204
|
+
# [1.15.0-rc.2](https://github.com/SAP/ui5-webcomponents/compare/v1.15.0-rc.1...v1.15.0-rc.2) (2023-06-22)
|
205
|
+
|
206
|
+
**Note:** Version bump only for package @ui5/webcomponents-localization
|
207
|
+
|
208
|
+
|
209
|
+
|
210
|
+
|
211
|
+
|
212
|
+
# [1.15.0-rc.1](https://github.com/SAP/ui5-webcomponents/compare/v1.15.0-rc.0...v1.15.0-rc.1) (2023-06-15)
|
213
|
+
|
214
|
+
**Note:** Version bump only for package @ui5/webcomponents-localization
|
215
|
+
|
216
|
+
|
217
|
+
|
218
|
+
|
219
|
+
|
220
|
+
|
221
|
+
|
222
|
+
|
223
|
+
|
224
|
+
# [1.15.0-rc.0](https://github.com/SAP/ui5-webcomponents/compare/v1.14.0...v1.15.0-rc.0) (2023-06-08)
|
225
|
+
|
226
|
+
|
227
|
+
### Bug Fixes
|
228
|
+
|
229
|
+
* **ui5-calendar:** prevent focus loss during arrow navigation with mouse/touch ([#6957](https://github.com/SAP/ui5-webcomponents/issues/6957)) ([216f6a7](https://github.com/SAP/ui5-webcomponents/commit/216f6a7a476d18a0f6fdf7ff189f953085e30b47))
|
230
|
+
|
231
|
+
|
232
|
+
|
233
|
+
|
234
|
+
|
235
|
+
# [1.14.0](https://github.com/SAP/ui5-webcomponents/compare/v1.14.0-rc.2...v1.14.0) (2023-06-01)
|
236
|
+
|
237
|
+
**Note:** Version bump only for package @ui5/webcomponents-localization
|
238
|
+
|
239
|
+
|
240
|
+
|
241
|
+
|
242
|
+
|
243
|
+
# [1.14.0-rc.2](https://github.com/SAP/ui5-webcomponents/compare/v1.14.0-rc.1...v1.14.0-rc.2) (2023-06-01)
|
244
|
+
|
245
|
+
**Note:** Version bump only for package @ui5/webcomponents-localization
|
246
|
+
|
247
|
+
|
248
|
+
|
249
|
+
|
250
|
+
|
6
251
|
# [1.14.0-rc.1](https://github.com/SAP/ui5-webcomponents/compare/v1.14.0-rc.0...v1.14.0-rc.1) (2023-05-25)
|
7
252
|
|
8
253
|
**Note:** Version bump only for package @ui5/webcomponents-localization
|
package/README.md
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|

|
2
2
|
|
3
|
+
|
3
4
|
# UI5 Web Components - Localization
|
4
5
|
|
5
6
|
[](https://www.npmjs.com/package/@ui5/webcomponents)
|
@@ -43,7 +44,7 @@ In order to be able to use Buddhist, Islamic, Japanese, or Persian calendar with
|
|
43
44
|
- [UI5 Web Components - Playground and API Reference](https://sap.github.io/ui5-webcomponents/playground/)
|
44
45
|
|
45
46
|
## Support
|
46
|
-
We welcome all comments, suggestions, questions, and bug reports. Please follow our [Support Guidelines](https://github.com/SAP/ui5-webcomponents/blob/main/SUPPORT.md#-content) on how to report an issue, or chat with us in the `#webcomponents` channel of the [OpenUI5 Community Slack](https://
|
47
|
+
We welcome all comments, suggestions, questions, and bug reports. Please follow our [Support Guidelines](https://github.com/SAP/ui5-webcomponents/blob/main/SUPPORT.md#-content) on how to report an issue, or chat with us in the `#webcomponents` channel of the [OpenUI5 Community Slack](https://ui5-slack-invite.cfapps.eu10.hana.ondemand.com/).
|
47
48
|
|
48
49
|
## Contribute
|
49
50
|
Please check our [Contribution Guidelines](https://github.com/SAP/ui5-webcomponents/blob/main/docs/6-contributing/02-conventions-and-guidelines.md).
|
@@ -6,8 +6,9 @@ import CalendarDate from "./CalendarDate.js";
|
|
6
6
|
* @param date CalendarDate instance
|
7
7
|
* @param amount how many days/months/years to add (can be a negative number)
|
8
8
|
* @param unit what to modify: "day", "month" or "year"
|
9
|
+
* @param preserveDate whether to preserve the day of the month (f.e. 15th of March + 1 month = 15th of April)
|
9
10
|
* @param minDate minimum date to enforce
|
10
11
|
* @param maxDate maximum date to enforce
|
11
12
|
*/
|
12
|
-
declare const modifyDateBy: (date: CalendarDate, amount: number, unit: string, minDate?: CalendarDate, maxDate?: CalendarDate) => CalendarDate;
|
13
|
+
declare const modifyDateBy: (date: CalendarDate, amount: number, unit: string, preserveDate?: boolean, minDate?: CalendarDate, maxDate?: CalendarDate) => CalendarDate;
|
13
14
|
export default modifyDateBy;
|
@@ -6,32 +6,47 @@ import CalendarDate from "./CalendarDate.js";
|
|
6
6
|
* @param date CalendarDate instance
|
7
7
|
* @param amount how many days/months/years to add (can be a negative number)
|
8
8
|
* @param unit what to modify: "day", "month" or "year"
|
9
|
+
* @param preserveDate whether to preserve the day of the month (f.e. 15th of March + 1 month = 15th of April)
|
9
10
|
* @param minDate minimum date to enforce
|
10
11
|
* @param maxDate maximum date to enforce
|
11
12
|
*/
|
12
|
-
const modifyDateBy = (date, amount, unit, minDate, maxDate) => {
|
13
|
+
const modifyDateBy = (date, amount, unit, preserveDate = true, minDate, maxDate) => {
|
13
14
|
const newDate = new CalendarDate(date);
|
14
|
-
|
15
|
-
|
15
|
+
switch (unit) {
|
16
|
+
case "day":
|
17
|
+
newDate.setDate(date.getDate() + amount);
|
18
|
+
break;
|
19
|
+
case "month":
|
20
|
+
if (preserveDate) {
|
21
|
+
newDate.setMonth(date.getMonth() + amount);
|
22
|
+
const stillSameMonth = amount === -1 && newDate.getMonth() === date.getMonth(); // f.e. PageUp remained in the same month
|
23
|
+
const monthSkipped = amount === 1 && newDate.getMonth() - date.getMonth() > 1; // f.e. PageDown skipped a whole month
|
24
|
+
if (stillSameMonth || monthSkipped) { // Select the last day of the month in any of these 2 scenarios
|
25
|
+
newDate.setDate(0);
|
26
|
+
}
|
27
|
+
}
|
28
|
+
else {
|
29
|
+
if (amount === 1) {
|
30
|
+
newDate.setMonth(newDate.getMonth() + 1, 1);
|
31
|
+
}
|
32
|
+
if (amount === -1) {
|
33
|
+
newDate.setDate(0);
|
34
|
+
}
|
35
|
+
}
|
36
|
+
break;
|
37
|
+
case "year":
|
38
|
+
newDate.setYear(date.getYear() + amount);
|
39
|
+
if (newDate.getMonth() !== date.getMonth()) { // f.e. 29th Feb to next/prev year
|
40
|
+
newDate.setDate(0); // Select the last day of the month
|
41
|
+
}
|
42
|
+
break;
|
43
|
+
default:
|
44
|
+
break;
|
16
45
|
}
|
17
|
-
|
18
|
-
newDate.setMonth(date.getMonth() + amount);
|
19
|
-
const stillSameMonth = amount === -1 && newDate.getMonth() === date.getMonth(); // f.e. PageUp remained in the same month
|
20
|
-
const monthSkipped = amount === 1 && newDate.getMonth() - date.getMonth() > 1; // f.e. PageDown skipped a whole month
|
21
|
-
if (stillSameMonth || monthSkipped) { // Select the last day of the month in any of these 2 scenarios
|
22
|
-
newDate.setDate(0);
|
23
|
-
}
|
24
|
-
}
|
25
|
-
else {
|
26
|
-
newDate.setYear(date.getYear() + amount);
|
27
|
-
if (newDate.getMonth() !== date.getMonth()) { // f.e. 29th Feb to next/prev year
|
28
|
-
newDate.setDate(0); // Select the last day of the month
|
29
|
-
}
|
30
|
-
}
|
31
|
-
if (minDate && newDate.valueOf() < minDate.valueOf()) {
|
46
|
+
if (minDate && newDate.isBefore(minDate)) {
|
32
47
|
return new CalendarDate(minDate);
|
33
48
|
}
|
34
|
-
if (maxDate && newDate.
|
49
|
+
if (maxDate && newDate.isAfter(maxDate)) {
|
35
50
|
return new CalendarDate(maxDate);
|
36
51
|
}
|
37
52
|
return newDate;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"modifyDateBy.js","sourceRoot":"","sources":["../../src/dates/modifyDateBy.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,MAAM,mBAAmB,CAAC;AAE7C
|
1
|
+
{"version":3,"file":"modifyDateBy.js","sourceRoot":"","sources":["../../src/dates/modifyDateBy.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,MAAM,mBAAmB,CAAC;AAE7C;;;;;;;;;;GAUG;AACH,MAAM,YAAY,GAAG,CAAC,IAAkB,EAAE,MAAc,EAAE,IAAY,EAAE,YAAY,GAAG,IAAI,EAAE,OAAsB,EAAE,OAAsB,EAAE,EAAE;IAC9I,MAAM,OAAO,GAAG,IAAI,YAAY,CAAC,IAAI,CAAC,CAAC;IAEvC,QAAQ,IAAI,EAAE;QACd,KAAK,KAAK;YACT,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,MAAM,CAAC,CAAC;YACzC,MAAM;QACP,KAAK,OAAO;YACX,IAAI,YAAY,EAAE;gBACjB,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,QAAQ,EAAE,GAAG,MAAM,CAAC,CAAC;gBAC3C,MAAM,cAAc,GAAG,MAAM,KAAK,CAAC,CAAC,IAAI,OAAO,CAAC,QAAQ,EAAE,KAAK,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC,yCAAyC;gBACzH,MAAM,YAAY,GAAG,MAAM,KAAK,CAAC,IAAI,OAAO,CAAC,QAAQ,EAAE,GAAG,IAAI,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC,CAAC,sCAAsC;gBACrH,IAAI,cAAc,IAAI,YAAY,EAAE,EAAE,+DAA+D;oBACpG,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;iBACnB;aACD;iBAAM;gBACN,IAAI,MAAM,KAAK,CAAC,EAAE;oBACjB,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,QAAQ,EAAE,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC;iBAC5C;gBACD,IAAI,MAAM,KAAK,CAAC,CAAC,EAAE;oBAClB,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;iBACnB;aACD;YACD,MAAM;QACP,KAAK,MAAM;YACV,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,MAAM,CAAC,CAAC;YACzC,IAAI,OAAO,CAAC,QAAQ,EAAE,KAAK,IAAI,CAAC,QAAQ,EAAE,EAAE,EAAE,kCAAkC;gBAC/E,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,mCAAmC;aACvD;YACD,MAAM;QACP;YACC,MAAM;KACN;IAED,IAAI,OAAO,IAAI,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE;QACzC,OAAO,IAAI,YAAY,CAAC,OAAO,CAAC,CAAC;KACjC;IAED,IAAI,OAAO,IAAI,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE;QACxC,OAAO,IAAI,YAAY,CAAC,OAAO,CAAC,CAAC;KACjC;IAED,OAAO,OAAO,CAAC;AAChB,CAAC,CAAC;AAEF,eAAe,YAAY,CAAC","sourcesContent":["import CalendarDate from \"./CalendarDate.js\";\n\n/**\n * Adds or subtracts a given amount of days/months/years from a date.\n * If minDate or maxDate are given, the result will be enforced within these limits\n *\n * @param date CalendarDate instance\n * @param amount how many days/months/years to add (can be a negative number)\n * @param unit what to modify: \"day\", \"month\" or \"year\"\n * @param preserveDate whether to preserve the day of the month (f.e. 15th of March + 1 month = 15th of April)\n * @param minDate minimum date to enforce\n * @param maxDate maximum date to enforce\n */\nconst modifyDateBy = (date: CalendarDate, amount: number, unit: string, preserveDate = true, minDate?: CalendarDate, maxDate?: CalendarDate) => {\n\tconst newDate = new CalendarDate(date);\n\n\tswitch (unit) {\n\tcase \"day\":\n\t\tnewDate.setDate(date.getDate() + amount);\n\t\tbreak;\n\tcase \"month\":\n\t\tif (preserveDate) {\n\t\t\tnewDate.setMonth(date.getMonth() + amount);\n\t\t\tconst stillSameMonth = amount === -1 && newDate.getMonth() === date.getMonth(); // f.e. PageUp remained in the same month\n\t\t\tconst monthSkipped = amount === 1 && newDate.getMonth() - date.getMonth() > 1; // f.e. PageDown skipped a whole month\n\t\t\tif (stillSameMonth || monthSkipped) { // Select the last day of the month in any of these 2 scenarios\n\t\t\t\tnewDate.setDate(0);\n\t\t\t}\n\t\t} else {\n\t\t\tif (amount === 1) {\n\t\t\t\tnewDate.setMonth(newDate.getMonth() + 1, 1);\n\t\t\t}\n\t\t\tif (amount === -1) {\n\t\t\t\tnewDate.setDate(0);\n\t\t\t}\n\t\t}\n\t\tbreak;\n\tcase \"year\":\n\t\tnewDate.setYear(date.getYear() + amount);\n\t\tif (newDate.getMonth() !== date.getMonth()) { // f.e. 29th Feb to next/prev year\n\t\t\tnewDate.setDate(0); // Select the last day of the month\n\t\t}\n\t\tbreak;\n\tdefault:\n\t\tbreak;\n\t}\n\n\tif (minDate && newDate.isBefore(minDate)) {\n\t\treturn new CalendarDate(minDate);\n\t}\n\n\tif (maxDate && newDate.isAfter(maxDate)) {\n\t\treturn new CalendarDate(maxDate);\n\t}\n\n\treturn newDate;\n};\n\nexport default modifyDateBy;\n"]}
|
@@ -4,80 +4,80 @@ const availableLocales = ["ar","ar_EG","ar_SA","bg","ca","cs","da","de","de_AT",
|
|
4
4
|
|
5
5
|
const importCldrJson = async (localeId) => {
|
6
6
|
switch (localeId) {
|
7
|
-
case "ar": return (await import("../assets/cldr/ar.json")).default;
|
8
|
-
case "ar_EG": return (await import("../assets/cldr/ar_EG.json")).default;
|
9
|
-
case "ar_SA": return (await import("../assets/cldr/ar_SA.json")).default;
|
10
|
-
case "bg": return (await import("../assets/cldr/bg.json")).default;
|
11
|
-
case "ca": return (await import("../assets/cldr/ca.json")).default;
|
12
|
-
case "cs": return (await import("../assets/cldr/cs.json")).default;
|
13
|
-
case "da": return (await import("../assets/cldr/da.json")).default;
|
14
|
-
case "de": return (await import("../assets/cldr/de.json")).default;
|
15
|
-
case "de_AT": return (await import("../assets/cldr/de_AT.json")).default;
|
16
|
-
case "de_CH": return (await import("../assets/cldr/de_CH.json")).default;
|
17
|
-
case "el": return (await import("../assets/cldr/el.json")).default;
|
18
|
-
case "el_CY": return (await import("../assets/cldr/el_CY.json")).default;
|
19
|
-
case "en": return (await import("../assets/cldr/en.json")).default;
|
20
|
-
case "en_AU": return (await import("../assets/cldr/en_AU.json")).default;
|
21
|
-
case "en_GB": return (await import("../assets/cldr/en_GB.json")).default;
|
22
|
-
case "en_HK": return (await import("../assets/cldr/en_HK.json")).default;
|
23
|
-
case "en_IE": return (await import("../assets/cldr/en_IE.json")).default;
|
24
|
-
case "en_IN": return (await import("../assets/cldr/en_IN.json")).default;
|
25
|
-
case "en_NZ": return (await import("../assets/cldr/en_NZ.json")).default;
|
26
|
-
case "en_PG": return (await import("../assets/cldr/en_PG.json")).default;
|
27
|
-
case "en_SG": return (await import("../assets/cldr/en_SG.json")).default;
|
28
|
-
case "en_ZA": return (await import("../assets/cldr/en_ZA.json")).default;
|
29
|
-
case "es": return (await import("../assets/cldr/es.json")).default;
|
30
|
-
case "es_AR": return (await import("../assets/cldr/es_AR.json")).default;
|
31
|
-
case "es_BO": return (await import("../assets/cldr/es_BO.json")).default;
|
32
|
-
case "es_CL": return (await import("../assets/cldr/es_CL.json")).default;
|
33
|
-
case "es_CO": return (await import("../assets/cldr/es_CO.json")).default;
|
34
|
-
case "es_MX": return (await import("../assets/cldr/es_MX.json")).default;
|
35
|
-
case "es_PE": return (await import("../assets/cldr/es_PE.json")).default;
|
36
|
-
case "es_UY": return (await import("../assets/cldr/es_UY.json")).default;
|
37
|
-
case "es_VE": return (await import("../assets/cldr/es_VE.json")).default;
|
38
|
-
case "et": return (await import("../assets/cldr/et.json")).default;
|
39
|
-
case "fa": return (await import("../assets/cldr/fa.json")).default;
|
40
|
-
case "fi": return (await import("../assets/cldr/fi.json")).default;
|
41
|
-
case "fr": return (await import("../assets/cldr/fr.json")).default;
|
42
|
-
case "fr_BE": return (await import("../assets/cldr/fr_BE.json")).default;
|
43
|
-
case "fr_CA": return (await import("../assets/cldr/fr_CA.json")).default;
|
44
|
-
case "fr_CH": return (await import("../assets/cldr/fr_CH.json")).default;
|
45
|
-
case "fr_LU": return (await import("../assets/cldr/fr_LU.json")).default;
|
46
|
-
case "he": return (await import("../assets/cldr/he.json")).default;
|
47
|
-
case "hi": return (await import("../assets/cldr/hi.json")).default;
|
48
|
-
case "hr": return (await import("../assets/cldr/hr.json")).default;
|
49
|
-
case "hu": return (await import("../assets/cldr/hu.json")).default;
|
50
|
-
case "id": return (await import("../assets/cldr/id.json")).default;
|
51
|
-
case "it": return (await import("../assets/cldr/it.json")).default;
|
52
|
-
case "it_CH": return (await import("../assets/cldr/it_CH.json")).default;
|
53
|
-
case "ja": return (await import("../assets/cldr/ja.json")).default;
|
54
|
-
case "kk": return (await import("../assets/cldr/kk.json")).default;
|
55
|
-
case "ko": return (await import("../assets/cldr/ko.json")).default;
|
56
|
-
case "lt": return (await import("../assets/cldr/lt.json")).default;
|
57
|
-
case "lv": return (await import("../assets/cldr/lv.json")).default;
|
58
|
-
case "ms": return (await import("../assets/cldr/ms.json")).default;
|
59
|
-
case "nb": return (await import("../assets/cldr/nb.json")).default;
|
60
|
-
case "nl": return (await import("../assets/cldr/nl.json")).default;
|
61
|
-
case "nl_BE": return (await import("../assets/cldr/nl_BE.json")).default;
|
62
|
-
case "pl": return (await import("../assets/cldr/pl.json")).default;
|
63
|
-
case "pt": return (await import("../assets/cldr/pt.json")).default;
|
64
|
-
case "pt_PT": return (await import("../assets/cldr/pt_PT.json")).default;
|
65
|
-
case "ro": return (await import("../assets/cldr/ro.json")).default;
|
66
|
-
case "ru": return (await import("../assets/cldr/ru.json")).default;
|
67
|
-
case "ru_UA": return (await import("../assets/cldr/ru_UA.json")).default;
|
68
|
-
case "sk": return (await import("../assets/cldr/sk.json")).default;
|
69
|
-
case "sl": return (await import("../assets/cldr/sl.json")).default;
|
70
|
-
case "sr": return (await import("../assets/cldr/sr.json")).default;
|
71
|
-
case "sr_Latn": return (await import("../assets/cldr/sr_Latn.json")).default;
|
72
|
-
case "sv": return (await import("../assets/cldr/sv.json")).default;
|
73
|
-
case "th": return (await import("../assets/cldr/th.json")).default;
|
74
|
-
case "tr": return (await import("../assets/cldr/tr.json")).default;
|
75
|
-
case "uk": return (await import("../assets/cldr/uk.json")).default;
|
76
|
-
case "vi": return (await import("../assets/cldr/vi.json")).default;
|
77
|
-
case "zh_CN": return (await import("../assets/cldr/zh_CN.json")).default;
|
78
|
-
case "zh_HK": return (await import("../assets/cldr/zh_HK.json")).default;
|
79
|
-
case "zh_SG": return (await import("../assets/cldr/zh_SG.json")).default;
|
80
|
-
case "zh_TW": return (await import("../assets/cldr/zh_TW.json")).default;
|
7
|
+
case "ar": return (await import(/* webpackChunkName: "ui5-webcomponents-cldr-ar" */ "../assets/cldr/ar.json")).default;
|
8
|
+
case "ar_EG": return (await import(/* webpackChunkName: "ui5-webcomponents-cldr-ar_EG" */ "../assets/cldr/ar_EG.json")).default;
|
9
|
+
case "ar_SA": return (await import(/* webpackChunkName: "ui5-webcomponents-cldr-ar_SA" */ "../assets/cldr/ar_SA.json")).default;
|
10
|
+
case "bg": return (await import(/* webpackChunkName: "ui5-webcomponents-cldr-bg" */ "../assets/cldr/bg.json")).default;
|
11
|
+
case "ca": return (await import(/* webpackChunkName: "ui5-webcomponents-cldr-ca" */ "../assets/cldr/ca.json")).default;
|
12
|
+
case "cs": return (await import(/* webpackChunkName: "ui5-webcomponents-cldr-cs" */ "../assets/cldr/cs.json")).default;
|
13
|
+
case "da": return (await import(/* webpackChunkName: "ui5-webcomponents-cldr-da" */ "../assets/cldr/da.json")).default;
|
14
|
+
case "de": return (await import(/* webpackChunkName: "ui5-webcomponents-cldr-de" */ "../assets/cldr/de.json")).default;
|
15
|
+
case "de_AT": return (await import(/* webpackChunkName: "ui5-webcomponents-cldr-de_AT" */ "../assets/cldr/de_AT.json")).default;
|
16
|
+
case "de_CH": return (await import(/* webpackChunkName: "ui5-webcomponents-cldr-de_CH" */ "../assets/cldr/de_CH.json")).default;
|
17
|
+
case "el": return (await import(/* webpackChunkName: "ui5-webcomponents-cldr-el" */ "../assets/cldr/el.json")).default;
|
18
|
+
case "el_CY": return (await import(/* webpackChunkName: "ui5-webcomponents-cldr-el_CY" */ "../assets/cldr/el_CY.json")).default;
|
19
|
+
case "en": return (await import(/* webpackChunkName: "ui5-webcomponents-cldr-en" */ "../assets/cldr/en.json")).default;
|
20
|
+
case "en_AU": return (await import(/* webpackChunkName: "ui5-webcomponents-cldr-en_AU" */ "../assets/cldr/en_AU.json")).default;
|
21
|
+
case "en_GB": return (await import(/* webpackChunkName: "ui5-webcomponents-cldr-en_GB" */ "../assets/cldr/en_GB.json")).default;
|
22
|
+
case "en_HK": return (await import(/* webpackChunkName: "ui5-webcomponents-cldr-en_HK" */ "../assets/cldr/en_HK.json")).default;
|
23
|
+
case "en_IE": return (await import(/* webpackChunkName: "ui5-webcomponents-cldr-en_IE" */ "../assets/cldr/en_IE.json")).default;
|
24
|
+
case "en_IN": return (await import(/* webpackChunkName: "ui5-webcomponents-cldr-en_IN" */ "../assets/cldr/en_IN.json")).default;
|
25
|
+
case "en_NZ": return (await import(/* webpackChunkName: "ui5-webcomponents-cldr-en_NZ" */ "../assets/cldr/en_NZ.json")).default;
|
26
|
+
case "en_PG": return (await import(/* webpackChunkName: "ui5-webcomponents-cldr-en_PG" */ "../assets/cldr/en_PG.json")).default;
|
27
|
+
case "en_SG": return (await import(/* webpackChunkName: "ui5-webcomponents-cldr-en_SG" */ "../assets/cldr/en_SG.json")).default;
|
28
|
+
case "en_ZA": return (await import(/* webpackChunkName: "ui5-webcomponents-cldr-en_ZA" */ "../assets/cldr/en_ZA.json")).default;
|
29
|
+
case "es": return (await import(/* webpackChunkName: "ui5-webcomponents-cldr-es" */ "../assets/cldr/es.json")).default;
|
30
|
+
case "es_AR": return (await import(/* webpackChunkName: "ui5-webcomponents-cldr-es_AR" */ "../assets/cldr/es_AR.json")).default;
|
31
|
+
case "es_BO": return (await import(/* webpackChunkName: "ui5-webcomponents-cldr-es_BO" */ "../assets/cldr/es_BO.json")).default;
|
32
|
+
case "es_CL": return (await import(/* webpackChunkName: "ui5-webcomponents-cldr-es_CL" */ "../assets/cldr/es_CL.json")).default;
|
33
|
+
case "es_CO": return (await import(/* webpackChunkName: "ui5-webcomponents-cldr-es_CO" */ "../assets/cldr/es_CO.json")).default;
|
34
|
+
case "es_MX": return (await import(/* webpackChunkName: "ui5-webcomponents-cldr-es_MX" */ "../assets/cldr/es_MX.json")).default;
|
35
|
+
case "es_PE": return (await import(/* webpackChunkName: "ui5-webcomponents-cldr-es_PE" */ "../assets/cldr/es_PE.json")).default;
|
36
|
+
case "es_UY": return (await import(/* webpackChunkName: "ui5-webcomponents-cldr-es_UY" */ "../assets/cldr/es_UY.json")).default;
|
37
|
+
case "es_VE": return (await import(/* webpackChunkName: "ui5-webcomponents-cldr-es_VE" */ "../assets/cldr/es_VE.json")).default;
|
38
|
+
case "et": return (await import(/* webpackChunkName: "ui5-webcomponents-cldr-et" */ "../assets/cldr/et.json")).default;
|
39
|
+
case "fa": return (await import(/* webpackChunkName: "ui5-webcomponents-cldr-fa" */ "../assets/cldr/fa.json")).default;
|
40
|
+
case "fi": return (await import(/* webpackChunkName: "ui5-webcomponents-cldr-fi" */ "../assets/cldr/fi.json")).default;
|
41
|
+
case "fr": return (await import(/* webpackChunkName: "ui5-webcomponents-cldr-fr" */ "../assets/cldr/fr.json")).default;
|
42
|
+
case "fr_BE": return (await import(/* webpackChunkName: "ui5-webcomponents-cldr-fr_BE" */ "../assets/cldr/fr_BE.json")).default;
|
43
|
+
case "fr_CA": return (await import(/* webpackChunkName: "ui5-webcomponents-cldr-fr_CA" */ "../assets/cldr/fr_CA.json")).default;
|
44
|
+
case "fr_CH": return (await import(/* webpackChunkName: "ui5-webcomponents-cldr-fr_CH" */ "../assets/cldr/fr_CH.json")).default;
|
45
|
+
case "fr_LU": return (await import(/* webpackChunkName: "ui5-webcomponents-cldr-fr_LU" */ "../assets/cldr/fr_LU.json")).default;
|
46
|
+
case "he": return (await import(/* webpackChunkName: "ui5-webcomponents-cldr-he" */ "../assets/cldr/he.json")).default;
|
47
|
+
case "hi": return (await import(/* webpackChunkName: "ui5-webcomponents-cldr-hi" */ "../assets/cldr/hi.json")).default;
|
48
|
+
case "hr": return (await import(/* webpackChunkName: "ui5-webcomponents-cldr-hr" */ "../assets/cldr/hr.json")).default;
|
49
|
+
case "hu": return (await import(/* webpackChunkName: "ui5-webcomponents-cldr-hu" */ "../assets/cldr/hu.json")).default;
|
50
|
+
case "id": return (await import(/* webpackChunkName: "ui5-webcomponents-cldr-id" */ "../assets/cldr/id.json")).default;
|
51
|
+
case "it": return (await import(/* webpackChunkName: "ui5-webcomponents-cldr-it" */ "../assets/cldr/it.json")).default;
|
52
|
+
case "it_CH": return (await import(/* webpackChunkName: "ui5-webcomponents-cldr-it_CH" */ "../assets/cldr/it_CH.json")).default;
|
53
|
+
case "ja": return (await import(/* webpackChunkName: "ui5-webcomponents-cldr-ja" */ "../assets/cldr/ja.json")).default;
|
54
|
+
case "kk": return (await import(/* webpackChunkName: "ui5-webcomponents-cldr-kk" */ "../assets/cldr/kk.json")).default;
|
55
|
+
case "ko": return (await import(/* webpackChunkName: "ui5-webcomponents-cldr-ko" */ "../assets/cldr/ko.json")).default;
|
56
|
+
case "lt": return (await import(/* webpackChunkName: "ui5-webcomponents-cldr-lt" */ "../assets/cldr/lt.json")).default;
|
57
|
+
case "lv": return (await import(/* webpackChunkName: "ui5-webcomponents-cldr-lv" */ "../assets/cldr/lv.json")).default;
|
58
|
+
case "ms": return (await import(/* webpackChunkName: "ui5-webcomponents-cldr-ms" */ "../assets/cldr/ms.json")).default;
|
59
|
+
case "nb": return (await import(/* webpackChunkName: "ui5-webcomponents-cldr-nb" */ "../assets/cldr/nb.json")).default;
|
60
|
+
case "nl": return (await import(/* webpackChunkName: "ui5-webcomponents-cldr-nl" */ "../assets/cldr/nl.json")).default;
|
61
|
+
case "nl_BE": return (await import(/* webpackChunkName: "ui5-webcomponents-cldr-nl_BE" */ "../assets/cldr/nl_BE.json")).default;
|
62
|
+
case "pl": return (await import(/* webpackChunkName: "ui5-webcomponents-cldr-pl" */ "../assets/cldr/pl.json")).default;
|
63
|
+
case "pt": return (await import(/* webpackChunkName: "ui5-webcomponents-cldr-pt" */ "../assets/cldr/pt.json")).default;
|
64
|
+
case "pt_PT": return (await import(/* webpackChunkName: "ui5-webcomponents-cldr-pt_PT" */ "../assets/cldr/pt_PT.json")).default;
|
65
|
+
case "ro": return (await import(/* webpackChunkName: "ui5-webcomponents-cldr-ro" */ "../assets/cldr/ro.json")).default;
|
66
|
+
case "ru": return (await import(/* webpackChunkName: "ui5-webcomponents-cldr-ru" */ "../assets/cldr/ru.json")).default;
|
67
|
+
case "ru_UA": return (await import(/* webpackChunkName: "ui5-webcomponents-cldr-ru_UA" */ "../assets/cldr/ru_UA.json")).default;
|
68
|
+
case "sk": return (await import(/* webpackChunkName: "ui5-webcomponents-cldr-sk" */ "../assets/cldr/sk.json")).default;
|
69
|
+
case "sl": return (await import(/* webpackChunkName: "ui5-webcomponents-cldr-sl" */ "../assets/cldr/sl.json")).default;
|
70
|
+
case "sr": return (await import(/* webpackChunkName: "ui5-webcomponents-cldr-sr" */ "../assets/cldr/sr.json")).default;
|
71
|
+
case "sr_Latn": return (await import(/* webpackChunkName: "ui5-webcomponents-cldr-sr_Latn" */ "../assets/cldr/sr_Latn.json")).default;
|
72
|
+
case "sv": return (await import(/* webpackChunkName: "ui5-webcomponents-cldr-sv" */ "../assets/cldr/sv.json")).default;
|
73
|
+
case "th": return (await import(/* webpackChunkName: "ui5-webcomponents-cldr-th" */ "../assets/cldr/th.json")).default;
|
74
|
+
case "tr": return (await import(/* webpackChunkName: "ui5-webcomponents-cldr-tr" */ "../assets/cldr/tr.json")).default;
|
75
|
+
case "uk": return (await import(/* webpackChunkName: "ui5-webcomponents-cldr-uk" */ "../assets/cldr/uk.json")).default;
|
76
|
+
case "vi": return (await import(/* webpackChunkName: "ui5-webcomponents-cldr-vi" */ "../assets/cldr/vi.json")).default;
|
77
|
+
case "zh_CN": return (await import(/* webpackChunkName: "ui5-webcomponents-cldr-zh_CN" */ "../assets/cldr/zh_CN.json")).default;
|
78
|
+
case "zh_HK": return (await import(/* webpackChunkName: "ui5-webcomponents-cldr-zh_HK" */ "../assets/cldr/zh_HK.json")).default;
|
79
|
+
case "zh_SG": return (await import(/* webpackChunkName: "ui5-webcomponents-cldr-zh_SG" */ "../assets/cldr/zh_SG.json")).default;
|
80
|
+
case "zh_TW": return (await import(/* webpackChunkName: "ui5-webcomponents-cldr-zh_TW" */ "../assets/cldr/zh_TW.json")).default;
|
81
81
|
default: throw "unknown locale"
|
82
82
|
}
|
83
83
|
}
|
@@ -0,0 +1,35 @@
|
|
1
|
+
var rLanguageTag = /^((?:[A-Z]{2,3}(?:-[A-Z]{3}){0,3})|[A-Z]{4}|[A-Z]{5,8})(?:-([A-Z]{4}))?(?:-([A-Z]{2}|[0-9]{3}))?((?:-[0-9A-Z]{5,8}|-[0-9][0-9A-Z]{3})*)((?:-[0-9A-WYZ](?:-[0-9A-Z]{2,8})+)*)(?:-(X(?:-[0-9A-Z]{1,8})+))?$/i;
|
2
|
+
var LanguageTag = function (sLanguageTag) {
|
3
|
+
var aResult = rLanguageTag.exec(sLanguageTag.replace(/_/g, "-"));
|
4
|
+
if (aResult === null) {
|
5
|
+
throw new TypeError("The given language tag'" + sLanguageTag + "' does not adhere to BCP-47.");
|
6
|
+
}
|
7
|
+
this.language = aResult[1] || null;
|
8
|
+
this.script = aResult[2] || null;
|
9
|
+
this.region = aResult[3] || null;
|
10
|
+
this.variant = aResult[4] && aResult[4].slice(1) || null;
|
11
|
+
this.variantSubtags = this.variant ? this.variant.split("-") : [];
|
12
|
+
this.extension = aResult[5] && aResult[5].slice(1) || null;
|
13
|
+
this.extensionSubtags = this.variant ? this.variant.split("-") : [];
|
14
|
+
this.privateUse = aResult[6] || null;
|
15
|
+
this.privateUseSubtags = this.privateUse ? this.privateUse.slice(2).split("-") : [];
|
16
|
+
if (this.language) {
|
17
|
+
this.language = this.language.toLowerCase();
|
18
|
+
}
|
19
|
+
if (this.script) {
|
20
|
+
this.script = this.script.toLowerCase().replace(/^[a-z]/, function ($) {
|
21
|
+
return $.toUpperCase();
|
22
|
+
});
|
23
|
+
}
|
24
|
+
if (this.region) {
|
25
|
+
this.region = this.region.toUpperCase();
|
26
|
+
}
|
27
|
+
Object.freeze(this);
|
28
|
+
};
|
29
|
+
LanguageTag.prototype.toString = function () {
|
30
|
+
return join(this.language, this.script, this.region, this.variant, this.extension, this.privateUse);
|
31
|
+
};
|
32
|
+
function join() {
|
33
|
+
return Array.prototype.filter.call(arguments, Boolean).join("-");
|
34
|
+
}
|
35
|
+
export default LanguageTag;
|
@@ -0,0 +1,12 @@
|
|
1
|
+
const M_ISO639_OLD_TO_NEW = {
|
2
|
+
"iw": "he",
|
3
|
+
"ji": "yi",
|
4
|
+
};
|
5
|
+
const getModernLanguage = (sLanguage) => {
|
6
|
+
return M_ISO639_OLD_TO_NEW[sLanguage] || sLanguage;
|
7
|
+
};
|
8
|
+
const Localization = {
|
9
|
+
getModernLanguage,
|
10
|
+
};
|
11
|
+
export default Localization;
|
12
|
+
//# sourceMappingURL=Localization.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"Localization.js","sourceRoot":"","sources":["../../../../src/sap/base/i18n/Localization.ts"],"names":[],"mappings":"AAAA,MAAM,mBAAmB,GAAG;IAC3B,IAAI,EAAE,IAAI;IACV,IAAI,EAAE,IAAI;CACV,CAAC;AAEF,MAAM,iBAAiB,GAAG,CAAC,SAAiB,EAAE,EAAE;IAC/C,OAAO,mBAAmB,CAAC,SAA6C,CAAC,IAAI,SAAS,CAAC;AACxF,CAAC,CAAC;AAEF,MAAM,YAAY,GAAG;IACpB,iBAAiB;CACjB,CAAC;AAEF,eAAe,YAAY,CAAC","sourcesContent":["const M_ISO639_OLD_TO_NEW = {\n\t\"iw\": \"he\",\n\t\"ji\": \"yi\",\n};\n\nconst getModernLanguage = (sLanguage: string) => {\n\treturn M_ISO639_OLD_TO_NEW[sLanguage as keyof typeof M_ISO639_OLD_TO_NEW] || sLanguage;\n};\n\nconst Localization = {\n\tgetModernLanguage,\n};\n\nexport default Localization;\n"]}
|
@@ -0,0 +1,30 @@
|
|
1
|
+
var CalendarWeekNumbering = {
|
2
|
+
Default: "Default",
|
3
|
+
ISO_8601: "ISO_8601",
|
4
|
+
MiddleEastern: "MiddleEastern",
|
5
|
+
WesternTraditional: "WesternTraditional"
|
6
|
+
};
|
7
|
+
Object.defineProperty(CalendarWeekNumbering, "getWeekConfigurationValues", {
|
8
|
+
value: function (sCalendarWeekNumbering) {
|
9
|
+
switch (sCalendarWeekNumbering) {
|
10
|
+
case CalendarWeekNumbering.ISO_8601:
|
11
|
+
return {
|
12
|
+
firstDayOfWeek: 1,
|
13
|
+
minimalDaysInFirstWeek: 4
|
14
|
+
};
|
15
|
+
case CalendarWeekNumbering.MiddleEastern:
|
16
|
+
return {
|
17
|
+
firstDayOfWeek: 6,
|
18
|
+
minimalDaysInFirstWeek: 1
|
19
|
+
};
|
20
|
+
case CalendarWeekNumbering.WesternTraditional:
|
21
|
+
return {
|
22
|
+
firstDayOfWeek: 0,
|
23
|
+
minimalDaysInFirstWeek: 1
|
24
|
+
};
|
25
|
+
default:
|
26
|
+
return undefined;
|
27
|
+
}
|
28
|
+
}
|
29
|
+
});
|
30
|
+
export default CalendarWeekNumbering;
|