@ui5/webcomponents-localization 1.0.0-rc.15 → 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.
@@ -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 (oLocale.getRegion() === 'US') {
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 (oLocale.getRegion() === 'US' && iWeek === 0 && oFirstDay.getUTCFullYear() < iYear) {
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].replace(/\./g, '').toLowerCase() + sValue.substring(aMatch[0].length);
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 correcly by sap.ui.core.format.DateFormat: The given timezone is not supported!' };
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
- VW6BY+s3XWP66RxH3uUWdXbfn/A=
1
+ 65ggwN6ZkFOPO38ZE2UOXXibHi8=
@@ -4,7 +4,7 @@ const hashIsUpToDate = resolve.sync("@ui5/webcomponents-tools/lib/hash/upToDate.
4
4
  const copyUsedModules = resolve.sync("@ui5/webcomponents-tools/lib/copy-list/index.js");
5
5
  const replaceGlobalCore = resolve.sync("@ui5/webcomponents-tools/lib/replace-global-core/index.js");
6
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."`;
7
+ const UP_TO_DATE = `node "${hashIsUpToDate}" dist/ hash.txt && echo "Up to date."`;
8
8
 
9
9
  const scripts = {
10
10
  clean: "rimraf dist",
@@ -16,12 +16,12 @@ const scripts = {
16
16
  "replace-export-true": `replace-in-file ", /* bExport= */ true" "" dist/**/*.js`,
17
17
  "replace-export-false": `replace-in-file ", /* bExport= */ false" "" dist/**/*.js`,
18
18
  "amd-to-es6": "amdtoes6 --src=dist --replace --glob=**/*.js",
19
- "replace-global-core-usage": `node ${replaceGlobalCore} dist/`,
20
- "esm-abs-to-rel": `node ${esmAbsToRel} dist/`,
19
+ "replace-global-core-usage": `node "${replaceGlobalCore}" dist/`,
20
+ "esm-abs-to-rel": `node "${esmAbsToRel}" dist/`,
21
21
  jsonImports: "node ./lib/generate-json-imports/cldr.js"
22
22
  },
23
23
  copy: {
24
- "used-modules": `node ${copyUsedModules} ./used-modules.txt dist/`,
24
+ "used-modules": `node "${copyUsedModules}" ./used-modules.txt dist/`,
25
25
  cldr: `copy-and-watch "../../node_modules/@openui5/sap.ui.core/src/sap/ui/core/cldr/*.json" dist/generated/assets/cldr/`,
26
26
  overlay: `copy-and-watch "overlay/**/*.js" dist/`,
27
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": "1.0.0-rc.15",
3
+ "version": "1.0.2",
4
4
  "description": "Localization for UI5 Web Components",
5
5
  "author": "SAP SE (https://www.sap.com)",
6
6
  "license": "Apache-2.0",
@@ -28,20 +28,12 @@
28
28
  "prepublishOnly": "npm run clean && npm run build"
29
29
  },
30
30
  "devDependencies": {
31
- "@buxlabs/amd-to-es6": "^0.16.0",
32
- "@openui5/sap.ui.core": "1.87.3",
33
- "@ui5/webcomponents-tools": "1.0.0-rc.15",
34
- "chromedriver": "92.0.0",
35
- "copy-and-watch": "^0.1.5",
36
- "escodegen": "^2.0.0",
37
- "esprima": "^4.0.1",
38
- "glob": "^7.1.6",
31
+ "@ui5/webcomponents-tools": "1.0.2",
32
+ "chromedriver": "95.0.0",
39
33
  "mkdirp": "^1.0.4",
40
- "path-exists-cli": "^1.0.0",
41
- "replace-in-file": "^6.2.0",
42
- "rimraf": "^3.0.2"
34
+ "resolve": "^1.20.0"
43
35
  },
44
36
  "dependencies": {
45
- "@ui5/webcomponents-base": "1.0.0-rc.15"
37
+ "@ui5/webcomponents-base": "1.0.2"
46
38
  }
47
39
  }