@ui5/webcomponents-localization 0.32.0 → 1.0.0-rc.16
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 +23 -0
- package/README.md +32 -1
- package/dist/generated/assets/cldr/en.json +1 -0
- package/dist/sap/base/Log.js +2 -10
- package/dist/sap/base/assert.js +1 -5
- package/dist/sap/base/util/deepEqual.js +1 -5
- package/dist/sap/ui/base/Interface.js +1 -3
- package/dist/sap/ui/base/Object.js +26 -2
- package/dist/sap/ui/core/Locale.js +2 -0
- package/dist/sap/ui/core/LocaleData.js +4 -1499
- package/dist/sap/ui/core/date/UniversalDate.js +4 -4
- package/dist/sap/ui/core/format/DateFormat.js +7 -3
- package/hash.txt +1 -1
- package/package-scripts.js +7 -4
- package/package.json +10 -13
@@ -162,8 +162,8 @@ UniversalDate.prototype.getTimezoneLong = function () {
|
|
162
162
|
};
|
163
163
|
var iMillisecondsInWeek = 7 * 24 * 60 * 60 * 1000;
|
164
164
|
UniversalDate.getWeekByDate = function (sCalendarType, iYear, iMonth, iDay) {
|
165
|
-
var oLocale = Core.getConfiguration().getFormatSettings().getFormatLocale(), clDate = this.getClass(sCalendarType), oFirstDay = getFirstDayOfFirstWeek(clDate, iYear), oDate = new clDate(clDate.UTC(iYear, iMonth, iDay)), iWeek, iLastYear, iNextYear, oLastFirstDay, oNextFirstDay;
|
166
|
-
if (
|
165
|
+
var oLocale = Core.getConfiguration().getFormatSettings().getFormatLocale(), oLocaleData = LocaleData.getInstance(oLocale), clDate = this.getClass(sCalendarType), oFirstDay = getFirstDayOfFirstWeek(clDate, iYear), oDate = new clDate(clDate.UTC(iYear, iMonth, iDay)), iWeek, iLastYear, iNextYear, oLastFirstDay, oNextFirstDay;
|
166
|
+
if (oLocaleData.firstDayStartsFirstWeek()) {
|
167
167
|
iWeek = calculateWeeks(oFirstDay, oDate);
|
168
168
|
} else {
|
169
169
|
iLastYear = iYear - 1;
|
@@ -186,8 +186,8 @@ UniversalDate.getWeekByDate = function (sCalendarType, iYear, iMonth, iDay) {
|
|
186
186
|
};
|
187
187
|
};
|
188
188
|
UniversalDate.getFirstDateOfWeek = function (sCalendarType, iYear, iWeek) {
|
189
|
-
var oLocale = Core.getConfiguration().getFormatSettings().getFormatLocale(), clDate = this.getClass(sCalendarType), oFirstDay = getFirstDayOfFirstWeek(clDate, iYear), oDate = new clDate(oFirstDay.valueOf() + iWeek * iMillisecondsInWeek);
|
190
|
-
if (
|
189
|
+
var oLocale = Core.getConfiguration().getFormatSettings().getFormatLocale(), oLocaleData = LocaleData.getInstance(oLocale), clDate = this.getClass(sCalendarType), oFirstDay = getFirstDayOfFirstWeek(clDate, iYear), oDate = new clDate(oFirstDay.valueOf() + iWeek * iMillisecondsInWeek), bIsRegionUS = oLocaleData.firstDayStartsFirstWeek();
|
190
|
+
if (bIsRegionUS && iWeek === 0 && oFirstDay.getUTCFullYear() < iYear) {
|
191
191
|
return {
|
192
192
|
year: iYear,
|
193
193
|
month: 0,
|
@@ -940,13 +940,17 @@ DateFormat.prototype.oSymbols = {
|
|
940
940
|
var bPM;
|
941
941
|
var iLength;
|
942
942
|
var sAM = oFormat.aDayPeriods[0], sPM = oFormat.aDayPeriods[1];
|
943
|
-
var rAMPM = /[aApP](?:\.)?[mM](?:\.)?/;
|
943
|
+
var rAMPM = /[aApP](?:\.)?[\x20\xA0]?[mM](?:\.)?/;
|
944
944
|
var aMatch = sValue.match(rAMPM);
|
945
945
|
var bVariant = aMatch && aMatch.index === 0;
|
946
946
|
if (bVariant) {
|
947
|
-
sValue = aMatch[0]
|
947
|
+
sValue = aMatch[0];
|
948
|
+
sAM = sAM.replace(/[\x20\xA0]/g, '');
|
949
|
+
sPM = sPM.replace(/[\x20\xA0]/g, '');
|
950
|
+
sValue = sValue.replace(/[\x20\xA0]/g, '');
|
948
951
|
sAM = sAM.replace(/\./g, '').toLowerCase();
|
949
952
|
sPM = sPM.replace(/\./g, '').toLowerCase();
|
953
|
+
sValue = sValue.replace(/\./g, '').toLowerCase();
|
950
954
|
}
|
951
955
|
if (sValue.indexOf(sAM) === 0) {
|
952
956
|
bPM = false;
|
@@ -1162,7 +1166,7 @@ DateFormat.prototype.oSymbols = {
|
|
1162
1166
|
iLength = 1;
|
1163
1167
|
iTZDiff = 0;
|
1164
1168
|
} else {
|
1165
|
-
return { error: 'cannot be parsed
|
1169
|
+
return { error: 'cannot be parsed correctly by sap.ui.core.format.DateFormat: The given timezone is not supported!' };
|
1166
1170
|
}
|
1167
1171
|
if (sValue.charAt(0) !== 'Z') {
|
1168
1172
|
var oParsedTZ = oParseHelper.parseTZ(sValue.substr(iLength), true);
|
package/hash.txt
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
65ggwN6ZkFOPO38ZE2UOXXibHi8=
|
package/package-scripts.js
CHANGED
@@ -1,7 +1,10 @@
|
|
1
1
|
const resolve = require("resolve");
|
2
2
|
const generateHash = resolve.sync("@ui5/webcomponents-tools/lib/hash/generate.js");
|
3
3
|
const hashIsUpToDate = resolve.sync("@ui5/webcomponents-tools/lib/hash/upToDate.js");
|
4
|
-
const
|
4
|
+
const copyUsedModules = resolve.sync("@ui5/webcomponents-tools/lib/copy-list/index.js");
|
5
|
+
const replaceGlobalCore = resolve.sync("@ui5/webcomponents-tools/lib/replace-global-core/index.js");
|
6
|
+
const esmAbsToRel = resolve.sync("@ui5/webcomponents-tools/lib/esm-abs-to-rel/index.js");
|
7
|
+
const UP_TO_DATE = `node "${hashIsUpToDate}" dist/ hash.txt && echo "Up to date."`;
|
5
8
|
|
6
9
|
const scripts = {
|
7
10
|
clean: "rimraf dist",
|
@@ -13,12 +16,12 @@ const scripts = {
|
|
13
16
|
"replace-export-true": `replace-in-file ", /* bExport= */ true" "" dist/**/*.js`,
|
14
17
|
"replace-export-false": `replace-in-file ", /* bExport= */ false" "" dist/**/*.js`,
|
15
18
|
"amd-to-es6": "amdtoes6 --src=dist --replace --glob=**/*.js",
|
16
|
-
"replace-global-core-usage":
|
17
|
-
"esm-abs-to-rel":
|
19
|
+
"replace-global-core-usage": `node "${replaceGlobalCore}" dist/`,
|
20
|
+
"esm-abs-to-rel": `node "${esmAbsToRel}" dist/`,
|
18
21
|
jsonImports: "node ./lib/generate-json-imports/cldr.js"
|
19
22
|
},
|
20
23
|
copy: {
|
21
|
-
"used-modules":
|
24
|
+
"used-modules": `node "${copyUsedModules}" ./used-modules.txt dist/`,
|
22
25
|
cldr: `copy-and-watch "../../node_modules/@openui5/sap.ui.core/src/sap/ui/core/cldr/*.json" dist/generated/assets/cldr/`,
|
23
26
|
overlay: `copy-and-watch "overlay/**/*.js" dist/`,
|
24
27
|
src: `copy-and-watch "src/**/*.js" dist/`,
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@ui5/webcomponents-localization",
|
3
|
-
"version": "0.
|
3
|
+
"version": "1.0.0-rc.16",
|
4
4
|
"description": "Localization for UI5 Web Components",
|
5
5
|
"author": "SAP SE (https://www.sap.com)",
|
6
6
|
"license": "Apache-2.0",
|
@@ -14,6 +14,11 @@
|
|
14
14
|
"url": "https://github.com/SAP/ui5-webcomponents.git",
|
15
15
|
"directory": "packages/localization"
|
16
16
|
},
|
17
|
+
"exports": {
|
18
|
+
"./dist/*": "./dist/*",
|
19
|
+
"./package.json": "./package.json",
|
20
|
+
"./*": "./dist/*"
|
21
|
+
},
|
17
22
|
"scripts": {
|
18
23
|
"clean": "nps clean",
|
19
24
|
"lint": "nps lint",
|
@@ -23,20 +28,12 @@
|
|
23
28
|
"prepublishOnly": "npm run clean && npm run build"
|
24
29
|
},
|
25
30
|
"devDependencies": {
|
26
|
-
"@
|
27
|
-
"
|
28
|
-
"@ui5/webcomponents-tools": "1.0.0-rc.13",
|
29
|
-
"chromedriver": "89.0.0",
|
30
|
-
"copy-and-watch": "^0.1.5",
|
31
|
-
"escodegen": "^2.0.0",
|
32
|
-
"esprima": "^4.0.1",
|
33
|
-
"glob": "^7.1.6",
|
31
|
+
"@ui5/webcomponents-tools": "1.0.0-rc.16",
|
32
|
+
"chromedriver": "95.0.0",
|
34
33
|
"mkdirp": "^1.0.4",
|
35
|
-
"
|
36
|
-
"replace-in-file": "^6.2.0",
|
37
|
-
"rimraf": "^3.0.2"
|
34
|
+
"resolve": "^1.20.0"
|
38
35
|
},
|
39
36
|
"dependencies": {
|
40
|
-
"@ui5/webcomponents-base": "0.
|
37
|
+
"@ui5/webcomponents-base": "1.0.0-rc.16"
|
41
38
|
}
|
42
39
|
}
|