@ui5/webcomponents-localization 0.0.0-bf8366eb6 → 0.0.0-c143e338b
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 +840 -0
- package/LICENSE.txt +201 -0
- package/README.md +7 -10
- package/dist/.tsbuildinfo +1 -1
- package/dist/Assets-fetch.d.ts +1 -0
- package/dist/Assets-fetch.js +3 -0
- package/dist/Assets-fetch.js.map +1 -0
- package/dist/Assets-node.d.ts +11 -0
- package/dist/Assets-node.js +12 -0
- package/dist/Assets-node.js.map +1 -0
- package/dist/CalendarUtils.d.ts +3 -0
- package/dist/CalendarUtils.js +6 -0
- package/dist/CalendarUtils.js.map +1 -0
- package/dist/DateFormat.d.ts +0 -1
- package/dist/LocaleData.d.ts +0 -1
- package/dist/dates/CalendarDate.d.ts +0 -1
- package/dist/dates/CalendarDate.js.map +1 -1
- package/dist/dates/ExtremeDates.d.ts +1 -1
- package/dist/dates/ExtremeDates.js.map +1 -1
- package/dist/dates/UI5Date.d.ts +0 -1
- package/dist/dates/convertMonthNumbersToMonthNames.js.map +1 -1
- package/dist/dates/getRoundedTimestamp.js.map +1 -1
- package/dist/dates/modifyDateBy.js.map +1 -1
- package/dist/dates/transformDateToSecondaryType.js.map +1 -1
- package/dist/generated/assets/cldr/Unicode-Data-Files-LICENSE.txt +27 -0
- package/dist/generated/assets/cldr/ar.json +7085 -5571
- package/dist/generated/assets/cldr/ar_EG.json +7085 -5571
- package/dist/generated/assets/cldr/ar_SA.json +7084 -5570
- package/dist/generated/assets/cldr/bg.json +5979 -4491
- package/dist/generated/assets/cldr/ca.json +6081 -4478
- package/dist/generated/assets/cldr/cnr.json +6167 -4665
- package/dist/generated/assets/cldr/cs.json +6707 -5067
- package/dist/generated/assets/cldr/cy.json +6930 -5479
- package/dist/generated/assets/cldr/da.json +5925 -4371
- package/dist/generated/assets/cldr/de.json +6046 -4420
- package/dist/generated/assets/cldr/de_AT.json +6047 -4421
- package/dist/generated/assets/cldr/de_CH.json +6045 -4419
- package/dist/generated/assets/cldr/el.json +5830 -4309
- package/dist/generated/assets/cldr/el_CY.json +5830 -4309
- package/dist/generated/assets/cldr/en.json +6042 -4342
- package/dist/generated/assets/cldr/en_AU.json +6082 -4382
- package/dist/generated/assets/cldr/en_GB.json +6073 -4373
- package/dist/generated/assets/cldr/en_HK.json +6082 -4382
- package/dist/generated/assets/cldr/en_IE.json +6073 -4373
- package/dist/generated/assets/cldr/en_IN.json +6078 -4378
- package/dist/generated/assets/cldr/en_NZ.json +6073 -4373
- package/dist/generated/assets/cldr/en_PG.json +6074 -4374
- package/dist/generated/assets/cldr/en_SG.json +6078 -4378
- package/dist/generated/assets/cldr/en_ZA.json +6074 -4374
- package/dist/generated/assets/cldr/es.json +6101 -4584
- package/dist/generated/assets/cldr/es_AR.json +6104 -4587
- package/dist/generated/assets/cldr/es_BO.json +6103 -4586
- package/dist/generated/assets/cldr/es_CL.json +5996 -4479
- package/dist/generated/assets/cldr/es_CO.json +5996 -4479
- package/dist/generated/assets/cldr/es_MX.json +6105 -4588
- package/dist/generated/assets/cldr/es_PE.json +5887 -4370
- package/dist/generated/assets/cldr/es_UY.json +5889 -4372
- package/dist/generated/assets/cldr/es_VE.json +5888 -4371
- package/dist/generated/assets/cldr/et.json +6025 -4373
- package/dist/generated/assets/cldr/fa.json +5948 -4429
- package/dist/generated/assets/cldr/fi.json +6193 -4514
- package/dist/generated/assets/cldr/fr.json +5995 -4383
- package/dist/generated/assets/cldr/fr_BE.json +5995 -4383
- package/dist/generated/assets/cldr/fr_CA.json +5989 -4377
- package/dist/generated/assets/cldr/fr_CH.json +6013 -4401
- package/dist/generated/assets/cldr/fr_LU.json +5995 -4383
- package/dist/generated/assets/cldr/he.json +6539 -4980
- package/dist/generated/assets/cldr/hi.json +5857 -4345
- package/dist/generated/assets/cldr/hr.json +6194 -4640
- package/dist/generated/assets/cldr/hu.json +5943 -4415
- package/dist/generated/assets/cldr/id.json +5728 -4132
- package/dist/generated/assets/cldr/it.json +5984 -4355
- package/dist/generated/assets/cldr/it_CH.json +5984 -4355
- package/dist/generated/assets/cldr/ja.json +5887 -4251
- package/dist/generated/assets/cldr/kk.json +5937 -4503
- package/dist/generated/assets/cldr/ko.json +5768 -4210
- package/dist/generated/assets/cldr/lt.json +6576 -4939
- package/dist/generated/assets/cldr/lv.json +6112 -4651
- package/dist/generated/assets/cldr/mk.json +6043 -4406
- package/dist/generated/assets/cldr/ms.json +5562 -4093
- package/dist/generated/assets/cldr/nb.json +6033 -4403
- package/dist/generated/assets/cldr/nl.json +6200 -4542
- package/dist/generated/assets/cldr/nl_BE.json +6200 -4542
- package/dist/generated/assets/cldr/pl.json +6587 -4978
- package/dist/generated/assets/cldr/pt.json +6113 -4597
- package/dist/generated/assets/cldr/pt_PT.json +6178 -4648
- package/dist/generated/assets/cldr/ro.json +6198 -4633
- package/dist/generated/assets/cldr/ru.json +6501 -4947
- package/dist/generated/assets/cldr/ru_UA.json +6501 -4947
- package/dist/generated/assets/cldr/sk.json +6430 -4980
- package/dist/generated/assets/cldr/sl.json +6442 -4948
- package/dist/generated/assets/cldr/sr.json +6239 -4737
- package/dist/generated/assets/cldr/sr_Latn.json +6224 -4722
- package/dist/generated/assets/cldr/sv.json +6074 -4406
- package/dist/generated/assets/cldr/th.json +5873 -4234
- package/dist/generated/assets/cldr/tr.json +6092 -4451
- package/dist/generated/assets/cldr/uk.json +6452 -4908
- package/dist/generated/assets/cldr/vi.json +5667 -4094
- package/dist/generated/assets/cldr/zh_CN.json +5715 -4124
- package/dist/generated/assets/cldr/zh_HK.json +5724 -4132
- package/dist/generated/assets/cldr/zh_SG.json +5724 -4132
- package/dist/generated/assets/cldr/zh_TW.json +5791 -4155
- package/dist/generated/json-imports/LocaleData-fetch.d.ts +1 -0
- package/dist/generated/json-imports/LocaleData-fetch.js +93 -0
- package/dist/generated/json-imports/LocaleData-fetch.js.map +1 -0
- package/dist/generated/json-imports/LocaleData-node.d.ts +1 -0
- package/dist/generated/json-imports/LocaleData-node.js +93 -0
- package/dist/generated/json-imports/LocaleData-node.js.map +1 -0
- package/dist/generated/json-imports/LocaleData.js.map +1 -1
- package/dist/getCachedLocaleDataInstance.js.map +1 -1
- package/dist/locale/getLocaleData.js.map +1 -1
- package/dist/sap/base/Event.js +1 -1
- package/dist/sap/base/Eventing.js +1 -1
- package/dist/sap/base/i18n/Formatting.d.ts +8 -0
- package/dist/sap/base/i18n/Formatting.js +7 -1126
- package/dist/sap/base/i18n/Formatting.js.map +1 -0
- package/dist/sap/base/i18n/LanguageTag.js +1 -1
- package/dist/sap/base/i18n/date/TimezoneUtils.js +1 -1
- package/dist/sap/base/util/LoaderExtensions.js.map +1 -1
- package/dist/sap/ui/base/Metadata.js +1 -1
- package/dist/sap/ui/base/Object.js +1 -1
- package/dist/sap/ui/core/Configuration.d.ts +1 -2
- package/dist/sap/ui/core/Core.d.ts +2 -4
- package/dist/sap/ui/core/FormatSettings.d.ts +1 -2
- package/dist/sap/ui/core/FormatSettings.js +0 -2
- package/dist/sap/ui/core/FormatSettings.js.map +1 -1
- package/dist/sap/ui/core/Locale.js +1 -1
- package/dist/sap/ui/core/LocaleData.js +1 -1
- package/dist/sap/ui/core/date/UI5Date.js +1 -1
- package/dist/sap/ui/core/format/DateFormat.js +3 -3
- package/dist/sap/ui/core/format/TimezoneUtil.js +1 -1
- package/package-scripts.cjs +16 -9
- package/package.json +14 -13
- package/tsconfig.json +14 -14
- package/used-modules.txt +0 -1
- package/dist/dates/calculateWeekNumber.d.ts +0 -6
- package/dist/dates/calculateWeekNumber.js +0 -45
- package/dist/dates/calculateWeekNumber.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Formatting.js","sourceRoot":"","sources":["../../../../src/sap/base/i18n/Formatting.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gCAAgC,EAAE,MAAM,uDAAuD,CAAC;AAEzG,MAAM,OAAO,GAAG,GAAG,EAAE,GAAE,CAAC,CAAC;AAEzB;;GAEG;AACH,MAAM,UAAU,GAAG;IAClB,iBAAiB,EAAE,OAAO;IAC1B,4BAA4B,EAAE,gCAAgC;CAC9D,CAAC;AAEF,eAAe,UAAU,CAAC","sourcesContent":["import { getLegacyDateCalendarCustomizing } from \"@ui5/webcomponents-base/dist/config/FormatSettings.js\";\n\nconst emptyFn = () => {};\n\n/**\n * OpenUI5 Formatting Shim\n */\nconst Formatting = {\n\tgetABAPDateFormat: emptyFn,\n\tgetCustomIslamicCalendarData: getLegacyDateCalendarCustomizing,\n};\n\nexport default Formatting;\n"]}
|
|
@@ -31,7 +31,7 @@ var rLanguageTag = /^((?:[A-Z]{2,3}(?:-[A-Z]{3}){0,3})|[A-Z]{4}|[A-Z]{5,8})(?:-(
|
|
|
31
31
|
* @param {string} sLanguageTag the language tag identifier, in format en-US or en_US.
|
|
32
32
|
*
|
|
33
33
|
* @author SAP SE
|
|
34
|
-
* @version 1.120.
|
|
34
|
+
* @version 1.120.17
|
|
35
35
|
* @public
|
|
36
36
|
* @alias module:sap/base/i18n/LanguageTag
|
|
37
37
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LoaderExtensions.js","sourceRoot":"","sources":["../../../../src/sap/base/util/LoaderExtensions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,6DAA6D,CAAC;AAE5F,MAAM,YAAY,GAAG,CAAC,UAAkB,EAAE,EAAE;IAC3C,MAAM,YAAY,GAAG,UAAU,CAAC,KAAK,CAAC,kCAAkC,CAAC,CAAC;IAC1E,IAAI,CAAC,YAAY,EAAE;
|
|
1
|
+
{"version":3,"file":"LoaderExtensions.js","sourceRoot":"","sources":["../../../../src/sap/base/util/LoaderExtensions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,6DAA6D,CAAC;AAE5F,MAAM,YAAY,GAAG,CAAC,UAAkB,EAAE,EAAE;IAC3C,MAAM,YAAY,GAAG,UAAU,CAAC,KAAK,CAAC,kCAAkC,CAAC,CAAC;IAC1E,IAAI,CAAC,YAAY,EAAE,CAAC;QACnB,MAAM,IAAI,KAAK,CAAC,mBAAmB,UAAU,GAAG,CAAC,CAAC;IACnD,CAAC;IAED,MAAM,QAAQ,GAAG,YAAY,CAAC,CAAC,CAAC,CAAC;IACjC,OAAO,aAAa,CAAC,QAAQ,CAAC,CAAC;AAChC,CAAC,CAAC;AAEF,MAAM,gBAAgB,GAAG;IACxB,YAAY;CACZ,CAAC;AAEF,eAAe,gBAAgB,CAAC","sourcesContent":["import { getLocaleData } from \"@ui5/webcomponents-base/dist/asset-registries/LocaleData.js\";\n\nconst loadResource = (moduleName: string) => {\n\tconst moduleFormat = moduleName.match(/sap\\/ui\\/core\\/cldr\\/(\\w+)\\.json/);\n\tif (!moduleFormat) {\n\t\tthrow new Error(`Unknown module \"${moduleName}\"`);\n\t}\n\n\tconst localeId = moduleFormat[1];\n\treturn getLocaleData(localeId);\n};\n\nconst LoaderExtensions = {\n\tloadResource,\n};\n\nexport default LoaderExtensions;\n"]}
|
|
@@ -21,7 +21,7 @@ import Log from "../../base/Log.js";
|
|
|
21
21
|
* @class Base class for all SAPUI5 Objects.
|
|
22
22
|
* @abstract
|
|
23
23
|
* @author Malte Wedel
|
|
24
|
-
* @version 1.120.
|
|
24
|
+
* @version 1.120.17
|
|
25
25
|
* @public
|
|
26
26
|
* @alias sap.ui.base.Object
|
|
27
27
|
* @throws {Error} When an instance of the class or its subclasses is created without the <code>new</code> operator.
|
|
@@ -7,10 +7,9 @@ declare const Configuration: {
|
|
|
7
7
|
getSupportedLanguages: () => string[] | null;
|
|
8
8
|
getOriginInfo: () => void;
|
|
9
9
|
getFormatSettings: () => {
|
|
10
|
-
getFormatLocale: (lang?: string
|
|
10
|
+
getFormatLocale: (lang?: string) => import("@ui5/webcomponents-base/dist/locale/Locale.js").default;
|
|
11
11
|
getLegacyDateFormat: () => void;
|
|
12
12
|
getCustomLocaleData: () => void;
|
|
13
|
-
getLegacyDateCalendarCustomizing: typeof import("@ui5/webcomponents-base/dist/features/LegacyDateFormats.js").default.getLegacyDateCalendarCustomizing;
|
|
14
13
|
};
|
|
15
14
|
getTimezone: () => string;
|
|
16
15
|
getCalendarWeekNumbering: () => string;
|
|
@@ -8,20 +8,18 @@ declare const Core: {
|
|
|
8
8
|
getSupportedLanguages: () => string[] | null;
|
|
9
9
|
getOriginInfo: () => void;
|
|
10
10
|
getFormatSettings: () => {
|
|
11
|
-
getFormatLocale: (lang?: string
|
|
11
|
+
getFormatLocale: (lang?: string) => import("@ui5/webcomponents-base/dist/locale/Locale.js").default;
|
|
12
12
|
getLegacyDateFormat: () => void;
|
|
13
13
|
getCustomLocaleData: () => void;
|
|
14
|
-
getLegacyDateCalendarCustomizing: typeof import("@ui5/webcomponents-base/dist/features/LegacyDateFormats.js").default.getLegacyDateCalendarCustomizing;
|
|
15
14
|
};
|
|
16
15
|
getTimezone: () => string;
|
|
17
16
|
getCalendarWeekNumbering: () => string;
|
|
18
17
|
};
|
|
19
18
|
getLibraryResourceBundle: void;
|
|
20
19
|
getFormatSettings: () => {
|
|
21
|
-
getFormatLocale: (lang?: string
|
|
20
|
+
getFormatLocale: (lang?: string) => import("@ui5/webcomponents-base/dist/locale/Locale.js").default;
|
|
22
21
|
getLegacyDateFormat: () => void;
|
|
23
22
|
getCustomLocaleData: () => void;
|
|
24
|
-
getLegacyDateCalendarCustomizing: typeof import("@ui5/webcomponents-base/dist/features/LegacyDateFormats.js").default.getLegacyDateCalendarCustomizing;
|
|
25
23
|
};
|
|
26
24
|
};
|
|
27
25
|
export default Core;
|
|
@@ -2,9 +2,8 @@
|
|
|
2
2
|
* OpenUI5 FormatSettings shim
|
|
3
3
|
*/
|
|
4
4
|
declare const FormatSettings: {
|
|
5
|
-
getFormatLocale: (lang?: string
|
|
5
|
+
getFormatLocale: (lang?: string) => import("@ui5/webcomponents-base/dist/locale/Locale.js").default;
|
|
6
6
|
getLegacyDateFormat: () => void;
|
|
7
7
|
getCustomLocaleData: () => void;
|
|
8
|
-
getLegacyDateCalendarCustomizing: typeof import("@ui5/webcomponents-base/dist/features/LegacyDateFormats").default.getLegacyDateCalendarCustomizing;
|
|
9
8
|
};
|
|
10
9
|
export default FormatSettings;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import getLocale from "@ui5/webcomponents-base/dist/locale/getLocale.js";
|
|
2
|
-
import { getLegacyDateCalendarCustomizing } from "@ui5/webcomponents-base/dist/config/FormatSettings.js";
|
|
3
2
|
const emptyFn = () => { };
|
|
4
3
|
/**
|
|
5
4
|
* OpenUI5 FormatSettings shim
|
|
@@ -8,7 +7,6 @@ const FormatSettings = {
|
|
|
8
7
|
getFormatLocale: getLocale,
|
|
9
8
|
getLegacyDateFormat: emptyFn,
|
|
10
9
|
getCustomLocaleData: emptyFn,
|
|
11
|
-
getLegacyDateCalendarCustomizing,
|
|
12
10
|
};
|
|
13
11
|
export default FormatSettings;
|
|
14
12
|
//# sourceMappingURL=FormatSettings.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormatSettings.js","sourceRoot":"","sources":["../../../../src/sap/ui/core/FormatSettings.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,kDAAkD,CAAC;
|
|
1
|
+
{"version":3,"file":"FormatSettings.js","sourceRoot":"","sources":["../../../../src/sap/ui/core/FormatSettings.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,kDAAkD,CAAC;AAEzE,MAAM,OAAO,GAAG,GAAG,EAAE,GAAE,CAAC,CAAC;AAEzB;;GAEG;AACH,MAAM,cAAc,GAAG;IACtB,eAAe,EAAE,SAAS;IAC1B,mBAAmB,EAAE,OAAO;IAC5B,mBAAmB,EAAE,OAAO;CAC5B,CAAC;AAEF,eAAe,cAAc,CAAC","sourcesContent":["import getLocale from \"@ui5/webcomponents-base/dist/locale/getLocale.js\";\n\nconst emptyFn = () => {};\n\n/**\n * OpenUI5 FormatSettings shim\n */\nconst FormatSettings = {\n\tgetFormatLocale: getLocale,\n\tgetLegacyDateFormat: emptyFn,\n\tgetCustomLocaleData: emptyFn,\n};\n\nexport default FormatSettings;\n"]}
|
|
@@ -64,7 +64,7 @@ function addLeadingZeros(iValue, iLength) {
|
|
|
64
64
|
* @hideconstructor
|
|
65
65
|
* @public
|
|
66
66
|
* @since 1.111.0
|
|
67
|
-
* @version 1.120.
|
|
67
|
+
* @version 1.120.17
|
|
68
68
|
*/
|
|
69
69
|
function UI5Date(vDateParts, sTimezoneID) {
|
|
70
70
|
var oDateInstance = UI5Date._createDateInstance(vDateParts);
|
|
@@ -2596,9 +2596,9 @@ var fnCreateDate = function (oDateValue, sCalendarType, bUTC, bStrict, sTimezone
|
|
|
2596
2596
|
// no need to use UI5Date.getInstance as only the UTC timestamp is used
|
|
2597
2597
|
oDate = UniversalDate.getInstance(new Date(0), sCalendarType);
|
|
2598
2598
|
oDate.setUTCEra(oDateValue.era || UniversalDate.getCurrentEra(sCalendarType));
|
|
2599
|
-
|
|
2600
|
-
|
|
2601
|
-
oDate.
|
|
2599
|
+
// Set parsed year, month and day in one call to avoid calculation issues when converting the calendar specific
|
|
2600
|
+
// date into a Gregorian date.
|
|
2601
|
+
oDate.setUTCFullYear(iYear, oDateValue.month || 0, oDateValue.day || 1);
|
|
2602
2602
|
oDate.setUTCHours(oDateValue.hour || 0);
|
|
2603
2603
|
oDate.setUTCMinutes(oDateValue.minute || 0);
|
|
2604
2604
|
oDate.setUTCSeconds(oDateValue.second || 0);
|
|
@@ -8,7 +8,7 @@ import TimezoneUtils from "../../../base/i18n/date/TimezoneUtils.js";
|
|
|
8
8
|
* Static collection of utility functions to handle time zone related conversions
|
|
9
9
|
*
|
|
10
10
|
* @author SAP SE
|
|
11
|
-
* @version 1.120.
|
|
11
|
+
* @version 1.120.17
|
|
12
12
|
* @namespace
|
|
13
13
|
* @name module:sap/ui/core/format/TimezoneUtils
|
|
14
14
|
* @private
|
package/package-scripts.cjs
CHANGED
|
@@ -1,25 +1,32 @@
|
|
|
1
1
|
const resolve = require("resolve");
|
|
2
|
+
const path = require("path");
|
|
2
3
|
|
|
4
|
+
const LIB = path.join(__dirname, `../tools/lib/`);
|
|
3
5
|
const copyUsedModules = resolve.sync("@ui5/webcomponents-tools/lib/copy-list/index.js");
|
|
4
6
|
const amdToES6 = resolve.sync("@ui5/webcomponents-tools/lib/amd-to-es6/index.js");
|
|
5
7
|
const noRequire = resolve.sync("@ui5/webcomponents-tools/lib/amd-to-es6/no-remaining-require.js");
|
|
8
|
+
const generateCLDR = resolve.sync("@ui5/webcomponents-localization/lib/generate-json-imports/cldr.js");
|
|
6
9
|
|
|
7
10
|
const scripts = {
|
|
8
|
-
clean:
|
|
11
|
+
clean: {
|
|
12
|
+
"default": "ui5nps clean.generated clean.dist",
|
|
13
|
+
"generated": `ui5nps-script "${LIB}/rimraf/rimraf.js src/generated`,
|
|
14
|
+
"dist": `ui5nps-script "${LIB}/rimraf/rimraf.js dist`,
|
|
15
|
+
},
|
|
9
16
|
lint: "eslint .",
|
|
10
|
-
generate: "
|
|
17
|
+
generate: "ui5nps clean copy.used-modules copy.cldr copy.overlay build.amd-to-es6 build.jsonImports",
|
|
11
18
|
build: {
|
|
12
|
-
"default": "
|
|
13
|
-
"amd-to-es6": `
|
|
14
|
-
"no-remaining-require": `
|
|
19
|
+
"default": "ui5nps clean copy.used-modules copy.cldr copy.overlay build.amd-to-es6 build.jsonImports build.typescript build.no-remaining-require",
|
|
20
|
+
"amd-to-es6": `ui5nps-script "${amdToES6}" dist/`,
|
|
21
|
+
"no-remaining-require": `ui5nps-script "${noRequire}" dist/`,
|
|
15
22
|
typescript: "tsc --build",
|
|
16
|
-
jsonImports:
|
|
23
|
+
jsonImports: `ui5nps-script ${generateCLDR}`,
|
|
17
24
|
},
|
|
18
25
|
typescript: "tsc --build",
|
|
19
26
|
copy: {
|
|
20
|
-
"used-modules": `
|
|
21
|
-
cldr: `
|
|
22
|
-
overlay: `copy-and-watch "overlay/**/*.js" dist/`,
|
|
27
|
+
"used-modules": `ui5nps-script "${copyUsedModules}" ./used-modules.txt dist/`,
|
|
28
|
+
cldr: `ui5nps-script "${LIB}copy-and-watch/index.js" "../../node_modules/@openui5/sap.ui.core/src/sap/ui/core/cldr/*" dist/generated/assets/cldr/`,
|
|
29
|
+
overlay: `ui5nps-script "${LIB}copy-and-watch/index.js" "overlay/**/*.js" dist/`,
|
|
23
30
|
},
|
|
24
31
|
};
|
|
25
32
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ui5/webcomponents-localization",
|
|
3
|
-
"version": "0.0.0-
|
|
3
|
+
"version": "0.0.0-c143e338b",
|
|
4
4
|
"description": "Localization for UI5 Web Components",
|
|
5
5
|
"author": "SAP SE (https://www.sap.com)",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
],
|
|
13
13
|
"repository": {
|
|
14
14
|
"type": "git",
|
|
15
|
-
"url": "https://github.com/
|
|
15
|
+
"url": "https://github.com/UI5/webcomponents.git",
|
|
16
16
|
"directory": "packages/localization"
|
|
17
17
|
},
|
|
18
18
|
"exports": {
|
|
@@ -21,27 +21,28 @@
|
|
|
21
21
|
"./*": "./dist/*"
|
|
22
22
|
},
|
|
23
23
|
"scripts": {
|
|
24
|
-
"clean": "
|
|
25
|
-
"lint": "
|
|
26
|
-
"start": "
|
|
27
|
-
"build": "
|
|
28
|
-
"generate": "
|
|
24
|
+
"clean": "wc-dev clean",
|
|
25
|
+
"lint": "wc-dev lint",
|
|
26
|
+
"start": "wc-dev start",
|
|
27
|
+
"build": "wc-dev build",
|
|
28
|
+
"generate": "wc-dev generate",
|
|
29
29
|
"prepublishOnly": "tsc -b"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"@babel/core": "^7.23.7",
|
|
33
33
|
"@babel/generator": "^7.23.6",
|
|
34
34
|
"@babel/parser": "^7.23.6",
|
|
35
|
-
"@openui5/sap.ui.core": "1.120.
|
|
36
|
-
"@ui5/webcomponents-tools": "0.0.0-
|
|
35
|
+
"@openui5/sap.ui.core": "1.120.17",
|
|
36
|
+
"@ui5/webcomponents-tools": "0.0.0-c143e338b",
|
|
37
37
|
"babel-plugin-amd-to-esm": "^2.0.3",
|
|
38
|
-
"
|
|
38
|
+
"eslint": "^7.22.0",
|
|
39
39
|
"estree-walk": "^2.2.0",
|
|
40
40
|
"mkdirp": "^1.0.4",
|
|
41
41
|
"resolve": "^1.20.0"
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
44
|
"@types/openui5": "^1.113.0",
|
|
45
|
-
"@ui5/webcomponents-base": "0.0.0-
|
|
46
|
-
}
|
|
47
|
-
|
|
45
|
+
"@ui5/webcomponents-base": "0.0.0-c143e338b"
|
|
46
|
+
},
|
|
47
|
+
"gitHead": "6309e8d90fa82344a60be72084660c1e3e52e107"
|
|
48
|
+
}
|
package/tsconfig.json
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
{
|
|
2
|
-
"
|
|
2
|
+
"extends": "@ui5/webcomponents-tools/tsconfig.json",
|
|
3
|
+
"include": [
|
|
4
|
+
"src/**/*"
|
|
5
|
+
],
|
|
3
6
|
"compilerOptions": {
|
|
4
|
-
"target": "ES2021",
|
|
5
|
-
"lib": ["DOM", "DOM.Iterable", "ES2023"],
|
|
6
|
-
// Generate d.ts files
|
|
7
|
-
"declaration": true,
|
|
8
7
|
"outDir": "dist",
|
|
9
|
-
"skipLibCheck": true,
|
|
10
|
-
"sourceMap": true,
|
|
11
|
-
"inlineSources": true,
|
|
12
|
-
"strict": true,
|
|
13
|
-
"moduleResolution": "node",
|
|
14
8
|
"composite": true,
|
|
15
9
|
"rootDir": "src",
|
|
10
|
+
"module": "NodeNext",
|
|
11
|
+
"moduleResolution": "NodeNext",
|
|
16
12
|
"tsBuildInfoFile": "dist/.tsbuildinfo",
|
|
17
13
|
"paths": {
|
|
18
|
-
"@ui5/webcomponents-base/dist/*": [
|
|
14
|
+
"@ui5/webcomponents-base/dist/*": [
|
|
15
|
+
"../base/src/*"
|
|
16
|
+
],
|
|
19
17
|
},
|
|
20
18
|
},
|
|
21
19
|
"references": [
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
}
|
|
20
|
+
{
|
|
21
|
+
"path": "../base"
|
|
22
|
+
}
|
|
23
|
+
]
|
|
24
|
+
}
|
package/used-modules.txt
CHANGED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type Locale from "@ui5/webcomponents-base/dist/locale/Locale.js";
|
|
2
|
-
import CalendarType from "@ui5/webcomponents-base/dist/types/CalendarType.js";
|
|
3
|
-
import type LocaleData from "../LocaleData.js";
|
|
4
|
-
import type UI5Date from "./UI5Date.js";
|
|
5
|
-
declare const calculateWeekNumber: (confFirstDayOfWeek: number | undefined, oDate: Date | UI5Date, iYear: number, oLocale: Locale, oLocaleData: LocaleData, calendarType: CalendarType) => number;
|
|
6
|
-
export default calculateWeekNumber;
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import UniversalDate from "./UniversalDate.js";
|
|
2
|
-
const calculateWeekNumber = (confFirstDayOfWeek, oDate, iYear, oLocale, oLocaleData, calendarType) => {
|
|
3
|
-
let iWeekNum = 0;
|
|
4
|
-
let iWeekDay = 0;
|
|
5
|
-
const iFirstDayOfWeek = Number.isInteger(confFirstDayOfWeek) ? confFirstDayOfWeek : oLocaleData.getFirstDayOfWeek();
|
|
6
|
-
// search Locale for containing "en-US", since sometimes
|
|
7
|
-
// when any user settings have been defined, subtag "sapufmt" is added to the locale name
|
|
8
|
-
// this is described inside sap.ui.core.Configuration file
|
|
9
|
-
if (oLocale && (oLocale.getLanguage() === "en" && oLocale.getRegion() === "US")) {
|
|
10
|
-
/*
|
|
11
|
-
* in US the week starts with Sunday
|
|
12
|
-
* The first week of the year starts with January 1st. But Dec. 31 is still in the last year
|
|
13
|
-
* So the week beginning in December and ending in January has 2 week numbers
|
|
14
|
-
*/
|
|
15
|
-
const oJanFirst = UniversalDate.getInstance(oDate, calendarType);
|
|
16
|
-
oJanFirst.setUTCFullYear(iYear, 0, 1);
|
|
17
|
-
iWeekDay = oJanFirst.getUTCDay();
|
|
18
|
-
// get the date for the same weekday like jan 1.
|
|
19
|
-
const oCheckDate = UniversalDate.getInstance(oDate, calendarType);
|
|
20
|
-
oCheckDate.setUTCDate(oCheckDate.getUTCDate() - oCheckDate.getUTCDay() + iWeekDay);
|
|
21
|
-
iWeekNum = Math.round((oCheckDate.getTime() - oJanFirst.getTime()) / 86400000 / 7) + 1;
|
|
22
|
-
}
|
|
23
|
-
else {
|
|
24
|
-
// normally the first week of the year is the one where the first Thursday of the year is
|
|
25
|
-
// find Thursday of this week
|
|
26
|
-
// if the checked day is before the 1. day of the week use a day of the previous week to check
|
|
27
|
-
const oThursday = UniversalDate.getInstance(oDate, calendarType);
|
|
28
|
-
oThursday.setUTCDate(oThursday.getUTCDate() - iFirstDayOfWeek);
|
|
29
|
-
iWeekDay = oThursday.getUTCDay();
|
|
30
|
-
oThursday.setUTCDate(oThursday.getUTCDate() - iWeekDay + 4);
|
|
31
|
-
const oFirstDayOfYear = UniversalDate.getInstance(new Date(oThursday.getTime()), calendarType);
|
|
32
|
-
oFirstDayOfYear.setUTCMonth(0, 1);
|
|
33
|
-
iWeekDay = oFirstDayOfYear.getUTCDay();
|
|
34
|
-
let iAddDays = 0;
|
|
35
|
-
if (iWeekDay > 4) {
|
|
36
|
-
iAddDays = 7; // first day of year is after Thursday, so first Thursday is in the next week
|
|
37
|
-
}
|
|
38
|
-
const oFirstThursday = UniversalDate.getInstance(new Date(oFirstDayOfYear.getTime()), calendarType);
|
|
39
|
-
oFirstThursday.setUTCDate(1 - iWeekDay + 4 + iAddDays);
|
|
40
|
-
iWeekNum = Math.round((oThursday.getTime() - oFirstThursday.getTime()) / 86400000 / 7) + 1;
|
|
41
|
-
}
|
|
42
|
-
return iWeekNum;
|
|
43
|
-
};
|
|
44
|
-
export default calculateWeekNumber;
|
|
45
|
-
//# sourceMappingURL=calculateWeekNumber.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"calculateWeekNumber.js","sourceRoot":"","sources":["../../src/dates/calculateWeekNumber.ts"],"names":[],"mappings":"AAEA,OAAO,aAAa,MAAM,oBAAoB,CAAC;AAI/C,MAAM,mBAAmB,GAAG,CAAC,kBAAsC,EAAE,KAAqB,EAAE,KAAa,EAAE,OAAe,EAAE,WAAuB,EAAE,YAA0B,EAAE,EAAE;IAClL,IAAI,QAAQ,GAAG,CAAC,CAAC;IACjB,IAAI,QAAQ,GAAG,CAAC,CAAC;IACjB,MAAM,eAAe,GAAG,MAAM,CAAC,SAAS,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC,kBAAmB,CAAC,CAAC,CAAC,WAAW,CAAC,iBAAiB,EAAE,CAAC;IAErH,wDAAwD;IACxD,yFAAyF;IACzF,0DAA0D;IAC1D,IAAI,OAAO,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE,KAAK,IAAI,IAAI,OAAO,CAAC,SAAS,EAAE,KAAK,IAAI,CAAC,EAAE;QAChF;;;;cAIG;QACH,MAAM,SAAS,GAAG,aAAa,CAAC,WAAW,CAAC,KAAK,EAAE,YAAY,CAAC,CAAC;QACjE,SAAS,CAAC,cAAc,CAAC,KAAK,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;QACtC,QAAQ,GAAG,SAAS,CAAC,SAAS,EAAE,CAAC;QAEjC,gDAAgD;QAChD,MAAM,UAAU,GAAG,aAAa,CAAC,WAAW,CAAC,KAAK,EAAE,YAAY,CAAC,CAAC;QAClE,UAAU,CAAC,UAAU,CAAC,UAAU,CAAC,UAAU,EAAE,GAAG,UAAU,CAAC,SAAS,EAAE,GAAG,QAAQ,CAAC,CAAC;QAEnF,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,UAAU,CAAC,OAAO,EAAE,GAAG,SAAS,CAAC,OAAO,EAAE,CAAC,GAAG,QAAQ,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC;KACvF;SAAM;QACN,yFAAyF;QACzF,6BAA6B;QAC7B,8FAA8F;QAC9F,MAAM,SAAS,GAAG,aAAa,CAAC,WAAW,CAAC,KAAK,EAAE,YAAY,CAAC,CAAC;QACjE,SAAS,CAAC,UAAU,CAAC,SAAS,CAAC,UAAU,EAAE,GAAG,eAAe,CAAC,CAAC;QAC/D,QAAQ,GAAG,SAAS,CAAC,SAAS,EAAE,CAAC;QACjC,SAAS,CAAC,UAAU,CAAC,SAAS,CAAC,UAAU,EAAE,GAAG,QAAQ,GAAG,CAAC,CAAC,CAAC;QAE5D,MAAM,eAAe,GAAG,aAAa,CAAC,WAAW,CAAC,IAAI,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,CAAC,EAAE,YAAY,CAAC,CAAC;QAC/F,eAAe,CAAC,WAAW,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;QAClC,QAAQ,GAAG,eAAe,CAAC,SAAS,EAAE,CAAC;QACvC,IAAI,QAAQ,GAAG,CAAC,CAAC;QACjB,IAAI,QAAQ,GAAG,CAAC,EAAE;YACjB,QAAQ,GAAG,CAAC,CAAC,CAAC,6EAA6E;SAC3F;QACD,MAAM,cAAc,GAAG,aAAa,CAAC,WAAW,CAAC,IAAI,IAAI,CAAC,eAAe,CAAC,OAAO,EAAE,CAAC,EAAE,YAAY,CAAC,CAAC;QACpG,cAAc,CAAC,UAAU,CAAC,CAAC,GAAG,QAAQ,GAAG,CAAC,GAAG,QAAQ,CAAC,CAAC;QAEvD,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,SAAS,CAAC,OAAO,EAAE,GAAG,cAAc,CAAC,OAAO,EAAE,CAAC,GAAG,QAAQ,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC;KAC3F;IAED,OAAO,QAAQ,CAAC;AACjB,CAAC,CAAC;AAEF,eAAe,mBAAmB,CAAC","sourcesContent":["import type Locale from \"@ui5/webcomponents-base/dist/locale/Locale.js\";\nimport CalendarType from \"@ui5/webcomponents-base/dist/types/CalendarType.js\";\nimport UniversalDate from \"./UniversalDate.js\";\nimport type LocaleData from \"../LocaleData.js\";\nimport type UI5Date from \"./UI5Date.js\";\n\nconst calculateWeekNumber = (confFirstDayOfWeek: number | undefined, oDate: Date | UI5Date, iYear: number, oLocale: Locale, oLocaleData: LocaleData, calendarType: CalendarType) => {\n\tlet iWeekNum = 0;\n\tlet iWeekDay = 0;\n\tconst iFirstDayOfWeek = Number.isInteger(confFirstDayOfWeek) ? confFirstDayOfWeek! : oLocaleData.getFirstDayOfWeek();\n\n\t// search Locale for containing \"en-US\", since sometimes\n\t// when any user settings have been defined, subtag \"sapufmt\" is added to the locale name\n\t// this is described inside sap.ui.core.Configuration file\n\tif (oLocale && (oLocale.getLanguage() === \"en\" && oLocale.getRegion() === \"US\")) {\n\t\t/*\n\t\t\t* in US the week starts with Sunday\n\t\t\t* The first week of the year starts with January 1st. But Dec. 31 is still in the last year\n\t\t\t* So the week beginning in December and ending in January has 2 week numbers\n\t\t\t*/\n\t\tconst oJanFirst = UniversalDate.getInstance(oDate, calendarType);\n\t\toJanFirst.setUTCFullYear(iYear, 0, 1);\n\t\tiWeekDay = oJanFirst.getUTCDay();\n\n\t\t// get the date for the same weekday like jan 1.\n\t\tconst oCheckDate = UniversalDate.getInstance(oDate, calendarType);\n\t\toCheckDate.setUTCDate(oCheckDate.getUTCDate() - oCheckDate.getUTCDay() + iWeekDay);\n\n\t\tiWeekNum = Math.round((oCheckDate.getTime() - oJanFirst.getTime()) / 86400000 / 7) + 1;\n\t} else {\n\t\t// normally the first week of the year is the one where the first Thursday of the year is\n\t\t// find Thursday of this week\n\t\t// if the checked day is before the 1. day of the week use a day of the previous week to check\n\t\tconst oThursday = UniversalDate.getInstance(oDate, calendarType);\n\t\toThursday.setUTCDate(oThursday.getUTCDate() - iFirstDayOfWeek);\n\t\tiWeekDay = oThursday.getUTCDay();\n\t\toThursday.setUTCDate(oThursday.getUTCDate() - iWeekDay + 4);\n\n\t\tconst oFirstDayOfYear = UniversalDate.getInstance(new Date(oThursday.getTime()), calendarType);\n\t\toFirstDayOfYear.setUTCMonth(0, 1);\n\t\tiWeekDay = oFirstDayOfYear.getUTCDay();\n\t\tlet iAddDays = 0;\n\t\tif (iWeekDay > 4) {\n\t\t\tiAddDays = 7; // first day of year is after Thursday, so first Thursday is in the next week\n\t\t}\n\t\tconst oFirstThursday = UniversalDate.getInstance(new Date(oFirstDayOfYear.getTime()), calendarType);\n\t\toFirstThursday.setUTCDate(1 - iWeekDay + 4 + iAddDays);\n\n\t\tiWeekNum = Math.round((oThursday.getTime() - oFirstThursday.getTime()) / 86400000 / 7) + 1;\n\t}\n\n\treturn iWeekNum;\n};\n\nexport default calculateWeekNumber;\n"]}
|