@ui5/webcomponents-localization 1.12.0-rc.1 → 1.12.0-rc.3
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/.eslintrc.js +3 -0
- package/CHANGELOG.md +20 -0
- package/dist/Assets-static.js.map +1 -1
- package/dist/Assets.js.map +1 -1
- package/dist/DateFormat.js.map +1 -1
- package/dist/LocaleData.js.map +1 -1
- package/dist/dates/CalendarDate.js.map +1 -1
- package/dist/dates/ExtremeDates.js.map +1 -1
- package/dist/dates/UniversalDate.js.map +1 -1
- package/dist/dates/calculateWeekNumber.js.map +1 -1
- package/dist/dates/convertMonthNumbersToMonthNames.js.map +1 -1
- package/dist/dates/getDaysInMonth.js.map +1 -1
- package/dist/dates/getRoundedTimestamp.js.map +1 -1
- package/dist/dates/getTodayUTCTimestamp.js.map +1 -1
- package/dist/dates/modifyDateBy.js.map +1 -1
- package/dist/dates/transformDateToSecondaryType.js.map +1 -1
- package/dist/features/calendar/Buddhist.js.map +1 -1
- package/dist/features/calendar/Gregorian.js.map +1 -1
- package/dist/features/calendar/Islamic.js.map +1 -1
- package/dist/features/calendar/Japanese.js.map +1 -1
- package/dist/features/calendar/Persian.js.map +1 -1
- package/dist/getCachedLocaleDataInstance.js.map +1 -1
- package/dist/locale/getLocaleData.js.map +1 -1
- package/dist/sap/base/util/LoaderExtensions.js.map +1 -1
- package/dist/sap/ui/core/Configuration.js.map +1 -1
- package/dist/sap/ui/core/Core.js.map +1 -1
- package/dist/sap/ui/core/FormatSettings.js.map +1 -1
- package/package-scripts.js +1 -1
- package/package.json +4 -4
- package/tsconfig.json +1 -0
- package/src/Assets-static.ts +0 -2
- package/src/Assets.ts +0 -2
- package/src/DateFormat.ts +0 -8
- package/src/LocaleData.ts +0 -8
- package/src/dates/CalendarDate.ts +0 -232
- package/src/dates/ExtremeDates.ts +0 -40
- package/src/dates/UniversalDate.ts +0 -51
- package/src/dates/calculateWeekNumber.ts +0 -53
- package/src/dates/convertMonthNumbersToMonthNames.ts +0 -34
- package/src/dates/getDaysInMonth.ts +0 -11
- package/src/dates/getRoundedTimestamp.ts +0 -14
- package/src/dates/getTodayUTCTimestamp.ts +0 -10
- package/src/dates/modifyDateBy.ts +0 -42
- package/src/dates/transformDateToSecondaryType.ts +0 -21
- package/src/features/calendar/Buddhist.ts +0 -1
- package/src/features/calendar/Gregorian.ts +0 -1
- package/src/features/calendar/Islamic.ts +0 -1
- package/src/features/calendar/Japanese.ts +0 -1
- package/src/features/calendar/Persian.ts +0 -1
- package/src/getCachedLocaleDataInstance.ts +0 -15
- package/src/locale/getLocaleData.ts +0 -28
- package/src/sap/base/util/LoaderExtensions.ts +0 -17
- package/src/sap/ui/core/Configuration.ts +0 -22
- package/src/sap/ui/core/Core.ts +0 -15
- package/src/sap/ui/core/FormatSettings.ts +0 -16
package/.eslintrc.js
ADDED
package/CHANGELOG.md
CHANGED
@@ -3,6 +3,26 @@
|
|
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.12.0-rc.3](https://github.com/SAP/ui5-webcomponents/compare/v1.12.0-rc.2...v1.12.0-rc.3) (2023-03-30)
|
7
|
+
|
8
|
+
**Note:** Version bump only for package @ui5/webcomponents-localization
|
9
|
+
|
10
|
+
|
11
|
+
|
12
|
+
|
13
|
+
|
14
|
+
# [1.12.0-rc.2](https://github.com/SAP/ui5-webcomponents/compare/v1.12.0-rc.1...v1.12.0-rc.2) (2023-03-23)
|
15
|
+
|
16
|
+
|
17
|
+
### Bug Fixes
|
18
|
+
|
19
|
+
* fix eslint for JS 3rd party projects ([#6725](https://github.com/SAP/ui5-webcomponents/issues/6725)) ([215a888](https://github.com/SAP/ui5-webcomponents/commit/215a888b006e46d431edd6324812b9d39249aef4))
|
20
|
+
* inline sources in the .map file so the src folder is not mandatory ([#6732](https://github.com/SAP/ui5-webcomponents/issues/6732)) ([16771a6](https://github.com/SAP/ui5-webcomponents/commit/16771a64d7b13f418af9afa1a03b224fe3762775))
|
21
|
+
|
22
|
+
|
23
|
+
|
24
|
+
|
25
|
+
|
6
26
|
# [1.12.0-rc.1](https://github.com/SAP/ui5-webcomponents/compare/v1.12.0-rc.0...v1.12.0-rc.1) (2023-03-16)
|
7
27
|
|
8
28
|
**Note:** Version bump only for package @ui5/webcomponents-localization
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Assets-static.js","sourceRoot":"","sources":["../src/Assets-static.ts"],"names":[],"mappings":"AAAA,uDAAuD;AACvD,OAAO,+CAA+C,CAAC"}
|
1
|
+
{"version":3,"file":"Assets-static.js","sourceRoot":"","sources":["../src/Assets-static.ts"],"names":[],"mappings":"AAAA,uDAAuD;AACvD,OAAO,+CAA+C,CAAC","sourcesContent":["// Currently the base package provides CLDR assets only\nimport \"./generated/json-imports/LocaleData-static.js\";\n"]}
|
package/dist/Assets.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Assets.js","sourceRoot":"","sources":["../src/Assets.ts"],"names":[],"mappings":"AAAA,uDAAuD;AACvD,OAAO,wCAAwC,CAAC"}
|
1
|
+
{"version":3,"file":"Assets.js","sourceRoot":"","sources":["../src/Assets.ts"],"names":[],"mappings":"AAAA,uDAAuD;AACvD,OAAO,wCAAwC,CAAC","sourcesContent":["// Currently the base package provides CLDR assets only\nimport \"./generated/json-imports/LocaleData.js\";\n"]}
|
package/dist/DateFormat.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"DateFormat.js","sourceRoot":"","sources":["../src/DateFormat.ts"],"names":[],"mappings":"AACA,aAAa;AACb,OAAO,gBAAgB,MAAM,oCAAoC,CAAC;AAElE,MAAM,iBAAiB,GAAG,gBAAsC,CAAC;AACjE,MAAM,UAAW,SAAQ,iBAAiB;CAAG;AAE7C,eAAe,UAAU,CAAC"}
|
1
|
+
{"version":3,"file":"DateFormat.js","sourceRoot":"","sources":["../src/DateFormat.ts"],"names":[],"mappings":"AACA,aAAa;AACb,OAAO,gBAAgB,MAAM,oCAAoC,CAAC;AAElE,MAAM,iBAAiB,GAAG,gBAAsC,CAAC;AACjE,MAAM,UAAW,SAAQ,iBAAiB;CAAG;AAE7C,eAAe,UAAU,CAAC","sourcesContent":["import type DateFormatT from \"sap/ui/core/format/DateFormat\";\n// @ts-ignore\nimport DateFormatNative from \"./sap/ui/core/format/DateFormat.js\";\n\nconst DateFormatWrapped = DateFormatNative as typeof DateFormatT;\nclass DateFormat extends DateFormatWrapped {}\n\nexport default DateFormat;\n"]}
|
package/dist/LocaleData.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"LocaleData.js","sourceRoot":"","sources":["../src/LocaleData.ts"],"names":[],"mappings":"AACA,aAAa;AACb,OAAO,gBAAgB,MAAM,6BAA6B,CAAC;AAE3D,MAAM,iBAAiB,GAAG,gBAA6C,CAAC;AACxE,MAAM,UAAW,SAAQ,iBAAiB;CAAG;AAE7C,eAAe,UAAU,CAAC"}
|
1
|
+
{"version":3,"file":"LocaleData.js","sourceRoot":"","sources":["../src/LocaleData.ts"],"names":[],"mappings":"AACA,aAAa;AACb,OAAO,gBAAgB,MAAM,6BAA6B,CAAC;AAE3D,MAAM,iBAAiB,GAAG,gBAA6C,CAAC;AACxE,MAAM,UAAW,SAAQ,iBAAiB;CAAG;AAE7C,eAAe,UAAU,CAAC","sourcesContent":["import type LocaleDataOpenUI5T from \"sap/ui/core/LocaleData\";\n// @ts-ignore\nimport LocaleDataNative from \"./sap/ui/core/LocaleData.js\";\n\nconst LocaleDataWrapped = LocaleDataNative as typeof LocaleDataOpenUI5T;\nclass LocaleData extends LocaleDataWrapped {}\n\nexport default LocaleData;\n"]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"CalendarDate.js","sourceRoot":"","sources":["../../src/dates/CalendarDate.ts"],"names":[],"mappings":"AACA,OAAO,aAAa,MAAM,oBAAoB,CAAC;AAE/C,MAA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C,EAAE,CAAC,CAAC,CAAC,CAAC;IAE7C,QAAQ,CAAC,cAAc,CAAC,KAAK,CAAC,WAAW,EAAE,EAAE,KAAK,CAAC,QAAQ,EAAE,EAAE,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;IAEhF,OAAO,QAAQ,CAAC;AACjB,CAAC;AAED,SAAS,iBAAiB,CAAC,aAA2B;IACrD,IAAI,CAAC,CAAC,aAAa,YAAY,YAAY,CAAC,EAAE;QAC7C,MAAM,IAAI,KAAK,CAAC,2BAA2B,aAAkC,2BAA2B,CAAC,CAAC;KAC1G;AACF,CAAC;AAED;;;;;GAKG;AACH,SAAS,gBAAgB,CAAC,KAAU,EAAE,OAAe;IACpD,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,KAAK,CAAC,EAAE,EAAE,sBAAsB;QACtF,MAAM,OAAO,CAAC;KACd;AACF,CAAC;AAED,eAAe,YAAY,CAAC","sourcesContent":["import type CalendarType from \"@ui5/webcomponents-base/dist/types/CalendarType.js\";\nimport UniversalDate from \"./UniversalDate.js\";\n\nclass CalendarDate {\n\t_oUDate!: Date | UniversalDate;\n\n\tconstructor(year?: number | CalendarDate, month?: number | string, date?: number, calendarType?: string) { // eslint-disable-line\n\t\tlet aArgs = arguments, // eslint-disable-line\n\t\t\toJSDate: Date,\n\t\t\toNow: Date,\n\t\t\tsCalendarType!: CalendarType;\n\n\t\tswitch (aArgs.length) {\n\t\tcase 0: // defaults to the current date\n\t\t\toNow = new Date();\n\t\t\treturn (this.constructor(oNow.getFullYear(), oNow.getMonth(), oNow.getDate()) as CalendarDate);\n\n\t\tcase 1: // CalendarDate\n\t\tcase 2: // CalendarDate, sCalendarType\n\t\t\tif (!(aArgs[0] instanceof CalendarDate)) {\n\t\t\t\tthrow new Error(\"Invalid arguments: the first argument must be of type CalendarDate.\");\n\t\t\t}\n\t\t\tsCalendarType = aArgs[1] ? aArgs[1] : (aArgs[0]._oUDate as UniversalDate).sCalendarType;\n\t\t\t// Use source.valueOf() (returns the same point of time regardless calendar type) instead of\n\t\t\t// source's getters to avoid non-gregorian Year, Month and Date may be used to construct a Gregorian date\n\t\t\toJSDate = new Date(aArgs[0].valueOf());\n\n\t\t\t// Make this date really local. Now getters are safe.\n\t\t\toJSDate.setFullYear(oJSDate.getUTCFullYear(), oJSDate.getUTCMonth(), oJSDate.getUTCDate());\n\t\t\toJSDate.setHours(oJSDate.getUTCHours(), oJSDate.getUTCMinutes(), oJSDate.getUTCSeconds(), oJSDate.getUTCMilliseconds());\n\n\t\t\tthis._oUDate = createUniversalUTCDate(oJSDate, sCalendarType);\n\t\t\tbreak;\n\n\t\tcase 3: // year, month, date\n\t\tcase 4: // year, month, date, sCalendarType\n\t\t\tcheckNumericLike(aArgs[0] as number, `Invalid year: ${aArgs[0] as number}`);\n\t\t\tcheckNumericLike(aArgs[1] as number, `Invalid month: ${aArgs[1] as number}`);\n\t\t\tcheckNumericLike(aArgs[2] as number, `Invalid date: ${aArgs[2] as number}`);\n\n\t\t\toJSDate = new Date(0, 0, 1);\n\t\t\toJSDate.setFullYear(aArgs[0] as number, aArgs[1] as number, aArgs[2] as number); // 2 digits year is not supported. If so, it is considered as full year as well.\n\n\t\t\tif (aArgs[3]) {\n\t\t\t\tsCalendarType = aArgs[3];\n\t\t\t}\n\t\t\tthis._oUDate = createUniversalUTCDate(oJSDate, sCalendarType);\n\t\t\tbreak;\n\n\t\tdefault:\n\t\t\tthrow new Error(`${\"Invalid arguments. Accepted arguments are: 1) oCalendarDate, (optional)calendarType\"\n\t\t\t\t+ \"or 2) year, month, date, (optional) calendarType\"}${aArgs as unknown as string}`);\n\t\t}\n\t}\n\n\tgetYear() {\n\t\treturn this._oUDate.getUTCFullYear();\n\t}\n\n\tsetYear(year: number) {\n\t\tcheckNumericLike(year, `Invalid year: ${year}`);\n\t\tthis._oUDate.setUTCFullYear(year);\n\t\treturn this;\n\t}\n\n\tgetMonth() {\n\t\treturn this._oUDate.getUTCMonth();\n\t}\n\n\t/**\n\t * Sets the given month as ordinal month of the year.\n\t * @param {int} month An integer between 0 and 11, representing the months January through December( or their\n\t * equivalent month names for the given calendar).\n\t * If the specified value is is outside of the expected range, this method attempts to update the date information\n\t * accordingly. For example, if 12 is given as a month, the year will be incremented by 1, and 1 will be used for month.\n\t * @param {int} [date] An integer between 1 and 31, representing the day of the month, but other values are allowed.\n\t * 0 will result in the previous month's last day.\n\t * -1 will result in the day before the previous month's last day.\n\t * 32 will result in:\n\t * - first day of the next month if the current month has 31 days.\n\t * - second day of the next month if the current month has 30 days.\n\t * Other value will result in adding or subtracting days according to the given value.\n\t * @returns {sap.ui.unified.calendar.CalendarDate} <code>this</code> for method chaining.\n\t */\n\tsetMonth(month: number, date?: number) {\n\t\tcheckNumericLike(month, `Invalid month: ${month}`);\n\t\tif (date || date === 0) {\n\t\t\tcheckNumericLike(date, `Invalid date: ${date}`);\n\t\t\tthis._oUDate.setUTCMonth(month, date);\n\t\t} else {\n\t\t\tthis._oUDate.setUTCMonth(month);\n\t\t}\n\t\treturn this;\n\t}\n\n\tgetDate() {\n\t\treturn this._oUDate.getUTCDate();\n\t}\n\n\tsetDate(date: number) {\n\t\tcheckNumericLike(date, `Invalid date: ${date}`);\n\t\tthis._oUDate.setUTCDate(date);\n\t\treturn this;\n\t}\n\n\tgetDay() {\n\t\treturn this._oUDate.getUTCDay();\n\t}\n\n\tgetCalendarType() {\n\t\treturn (this._oUDate as UniversalDate).sCalendarType;\n\t}\n\n\tisBefore(oCalendarDate: CalendarDate) {\n\t\tcheckCalendarDate(oCalendarDate);\n\t\treturn this.valueOf() < oCalendarDate.valueOf();\n\t}\n\n\tisAfter(oCalendarDate: CalendarDate) {\n\t\tcheckCalendarDate(oCalendarDate);\n\t\treturn this.valueOf() > oCalendarDate.valueOf();\n\t}\n\n\tisSameOrBefore(oCalendarDate: CalendarDate) {\n\t\tcheckCalendarDate(oCalendarDate);\n\t\treturn this.valueOf() <= oCalendarDate.valueOf();\n\t}\n\n\tisSameOrAfter(oCalendarDate: CalendarDate) {\n\t\tcheckCalendarDate(oCalendarDate);\n\t\treturn this.valueOf() >= oCalendarDate.valueOf();\n\t}\n\n\tisSame(oCalendarDate: CalendarDate) {\n\t\tcheckCalendarDate(oCalendarDate);\n\t\treturn this.valueOf() === oCalendarDate.valueOf();\n\t}\n\n\ttoLocalJSDate() {\n\t\t// Use this._oUDate.getTime()(returns the same point of time regardless calendar type) instead of\n\t\t// this._oUDate's getters to avoid non-gregorian Year, Month and Date to be used to construct a Gregorian date\n\t\tconst oLocalDate = new Date(this._oUDate.getTime());\n\n\t\t// Make this date really local. Now getters are safe.\n\t\toLocalDate.setFullYear(oLocalDate.getUTCFullYear(), oLocalDate.getUTCMonth(), oLocalDate.getUTCDate());\n\t\toLocalDate.setHours(0, 0, 0, 0);\n\n\t\treturn oLocalDate;\n\t}\n\n\ttoUTCJSDate() {\n\t\t// Use this._oUDate.getTime()(returns the same point of time regardless calendar type) instead of\n\t\t// this._oUDate's getters to avoid non-gregorian Year, Month and Date to be used to construct a Gregorian date\n\t\tconst oUTCDate = new Date(this._oUDate.getTime());\n\t\toUTCDate.setUTCHours(0, 0, 0, 0);\n\n\t\treturn oUTCDate;\n\t}\n\n\ttoString() {\n\t\treturn `${(this._oUDate as UniversalDate).sCalendarType}: ${this.getYear()}/${this.getMonth() + 1}/${this.getDate()}`;\n\t}\n\n\tvalueOf() {\n\t\treturn this._oUDate.getTime();\n\t}\n\n\tstatic fromLocalJSDate(oJSDate: Date, sCalendarType?: CalendarType) {\n\t\t// Cross frame check for a date should be performed here otherwise setDateValue would fail in OPA tests\n\t\t// because Date object in the test is different than the Date object in the application (due to the iframe).\n\t\t// We can use jQuery.type or this method:\n\t\tfunction isValidDate(date: Date) {\n\t\t\treturn date && Object.prototype.toString.call(date) === \"[object Date]\" && !isNaN(date as unknown as number); // eslint-disable-line\n\t\t}\n\t\tif (!isValidDate(oJSDate)) {\n\t\t\tthrow new Error(`Date parameter must be a JavaScript Date object: [${oJSDate as unknown as string}].`);\n\t\t}\n\t\treturn new CalendarDate(oJSDate.getFullYear(), oJSDate.getMonth(), oJSDate.getDate(), sCalendarType);\n\t}\n\n\tstatic fromTimestamp(iTimestamp: number, sCalendarType?: CalendarType) {\n\t\tconst oCalDate = new CalendarDate(0, 0, 1);\n\t\tlet oUDate;\n\t\ttry {\n\t\t\toUDate = UniversalDate.getInstance(new Date(iTimestamp), sCalendarType);\n\t\t} catch (e) {\n\t\t\toUDate = new Date(NaN); // UniversalDate.getInstance may now throw an Exception - keep the old behavior\n\t\t}\n\t\toCalDate._oUDate = oUDate;\n\t\treturn oCalDate;\n\t}\n}\n\nfunction createUniversalUTCDate(oDate: Date, sCalendarType: CalendarType) {\n\tif (sCalendarType) {\n\t\treturn UniversalDate.getInstance(createUTCDate(oDate), sCalendarType);\n\t}\n\treturn new UniversalDate(createUTCDate(oDate).getTime());\n}\n\n/**\n * Creates a JavaScript UTC Date corresponding to the given JavaScript Date.\n * @param {Date} oDate JavaScript date object. Time related information is cut.\n * @returns {Date} JavaScript date created from the date object, but this time considered as UTC date information.\n */\nfunction createUTCDate(oDate: Date) {\n\tconst oUTCDate = new Date(Date.UTC(0, 0, 1));\n\n\toUTCDate.setUTCFullYear(oDate.getFullYear(), oDate.getMonth(), oDate.getDate());\n\n\treturn oUTCDate;\n}\n\nfunction checkCalendarDate(oCalendarDate: CalendarDate) {\n\tif (!(oCalendarDate instanceof CalendarDate)) {\n\t\tthrow new Error(`Invalid calendar date: [${oCalendarDate as unknown as string}]. Expected: CalendarDate`);\n\t}\n}\n\n/**\n * Verifies the given value is numeric like, i.e. 3, \"3\" and throws an error if it is not.\n * @param {any} value The value of any type to check. If null or undefined, this method throws an error.\n * @param {string} message The message to be used if an error is to be thrown\n * @throws will throw an error if the value is null or undefined or is not like a number\n */\nfunction checkNumericLike(value: any, message: string) {\n\tif (value === undefined || value === Infinity || isNaN(value)) { // eslint-disable-line\n\t\tthrow message;\n\t}\n}\n\nexport default C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AAC,GAAG,CAAC,GAAG,CAAC,EAAE;QACpB,MAAM,OAAO,GAAG,IAAI,YAAY,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,mBAAmB,CAAC,CAAC;QAC/D,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QACtB,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;QACrB,MAAM,QAAQ,GAAG,IAAI,YAAY,CAAC,OAAO,EAAE,mBAAmB,CAAC,CAAC;QAChE,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;QACpB,QAAQ,CAAC,QAAQ,CAAC,QAAQ,CAAC,QAAQ,EAAE,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC;QAC9C,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC,CAAC,CAAA,8BAA8B;QAClE,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;KACxB;IAED,OAAO,KAAK,CAAC,GAAG,CAAC,GAAG,CAAE,CAAC;AACxB,CAAC,CAAC;AAEF,OAAO,EACN,kBAAkB,EAClB,kBAAkB,GAClB,CAAC","sourcesContent":["import CalendarType from \"@ui5/webcomponents-base/dist/types/CalendarType.js\";\nimport CalendarDate from \"./CalendarDate.js\";\n\nconst cache = new Map<string, CalendarDate>();\n\nconst getMinCalendarDate = (primaryCalendarType: CalendarType) => {\n\tconst key = `min ${primaryCalendarType}`;\n\n\tif (!cache.has(key)) {\n\t\tconst minDate = new CalendarDate(1, 0, 1, primaryCalendarType);\n\t\tminDate.setYear(1);\n\t\tminDate.setMonth(0);\n\t\tminDate.setDate(1);\n\t\tcache.set(key, minDate);\n\t}\n\n\treturn cache.get(key)!;\n};\n\nconst getMaxCalendarDate = (primaryCalendarType: CalendarType) => {\n\tconst key = `max ${primaryCalendarType}`;\n\n\tif (!cache.has(key)) {\n\t\tconst maxDate = new CalendarDate(1, 0, 1, primaryCalendarType);\n\t\tmaxDate.setYear(9999);\n\t\tmaxDate.setMonth(11);\n\t\tconst tempDate = new CalendarDate(maxDate, primaryCalendarType);\n\t\ttempDate.setDate(1);\n\t\ttempDate.setMonth(tempDate.getMonth() + 1, 0);\n\t\tmaxDate.setDate(tempDate.getDate());// 31st for Gregorian Calendar\n\t\tcache.set(key, maxDate);\n\t}\n\n\treturn cache.get(key)!;\n};\n\nexport {\n\tgetMinCalendarDate,\n\tgetMaxCalendarDate,\n};\n"]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"UniversalDate.js","sourceRoot":"","sources":["../../src/dates/UniversalDate.ts"],"names":[],"mappings":"AACA,aAAa;AACb,OAAO,mBAAmB,MAAM,sCAAsC,CAAC;AA8CvE,MAAM,aAAa,GAAkB,mBAAmB,CAAC;AAEzD,eAAe,aAAa,CAAC"}
|
1
|
+
{"version":3,"file":"UniversalDate.js","sourceRoot":"","sources":["../../src/dates/UniversalDate.ts"],"names":[],"mappings":"AACA,aAAa;AACb,OAAO,mBAAmB,MAAM,sCAAsC,CAAC;AA8CvE,MAAM,aAAa,GAAkB,mBAAmB,CAAC;AAEzD,eAAe,aAAa,CAAC","sourcesContent":["import type CalendarType from \"@ui5/webcomponents-base/dist/types/CalendarType.js\";\n// @ts-ignore\nimport UniversalDateNative from \"../sap/ui/core/date/UniversalDate.js\";\n\ntype UniversalDate = {\n new (time: number): UniversalDate;\n oDate: Date,\n sCalendarType: string,\n getInstance: (oDate: Date, sCalendarType?: CalendarType) => UniversalDate,\n getDate: () => number,\n getMonth: () => number,\n getFullYear: () => number,\n getYear: () => number,\n getDay: () => number,\n getHours: () => number,\n getMinutes: () => number,\n getSeconds: () => number,\n getMilliseconds: () => number,\n getUTCDate: () => number,\n getUTCMonth: () => number,\n getUTCFullYear: () => number,\n getUTCDay: () => number,\n getUTCHours: () => number,\n getUTCMinutes: () => number,\n getUTCSeconds: () => number,\n getUTCMilliseconds: () => number,\n getTime: () => number,\n valueOf: () => number,\n getTimezoneOffset: () => number,\n toString: () => string,\n toDateString: () => string,\n setDate: (dayValue: number) => number,\n setFullYear: (yearValue: number, monthValue?: number, dateValue?: number) => number,\n setYear: (yearValue: number) => number,\n setMonth: (monthValue: number, dayValue?: number) => number,\n setHours: (hoursValue: number, minutesValue?: number, secondsValue?: number, msValue?: number) => number,\n setMinutes: (minutesValue: number, secondsValue?: number, msValue?: number) => number,\n setSeconds: (secondsValue: number, msValue?: number) => number,\n setMilliseconds: (setMilliseconds: number) => number,\n setUTCDate:(dayValue: number) => number,\n setUTCFullYear: (yearValue: number, monthValue?: number, dayValue?: number) => number,\n setUTCMonth: (monthValue: number, dayValue?: number) => number,\n setUTCHours: (hoursValue: number, minutesValue?: number, secondsValue?: number, msValue?: number) => number,\n setUTCMinutes: (minutesValue: number, secondsValue?: number, msValue?: number) => number,\n setUTCSeconds: (secondsValue: number, msValue?: number) => number,\n setUTCMilliseconds: (setMilliseconds: number) => number,\n}\n\nconst UniversalDate: UniversalDate = UniversalDateNative;\n\nexport default UniversalDate;\n"]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"calculateWeekNumber.js","sourceRoot":"","sources":["../../src/dates/calculateWeekNumber.ts"],"names":[],"mappings":"AACA,OAAO,aAAa,MAAM,oBAAoB,CAAC;AAG/C,MAAM,mBAAmB,GAAG,CAAC,kBAAsC,EAAE,KAAW,EAAE,KAAa,EAAE,OAAe,EAAE,WAAuB,EAAE,EAAE;IAC5I,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,EAA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,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 UniversalDate from \"./UniversalDate.js\";\nimport type LocaleData from \"../LocaleData.js\";\n\nconst calculateWeekNumber = (confFirstDayOfWeek: number | undefined, oDate: Date, iYear: number, oLocale: Locale, oLocaleData: LocaleData) => {\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 = new UniversalDate(oDate.getTime());\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 = new UniversalDate(oDate.getTime());\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 = new UniversalDate(oDate.getTime());\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 = new UniversalDate(oThursday.getTime());\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 = new UniversalDate(oFirstDayOfYear.getTime());\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"]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"convertMonthNumbersToMonthNames.js","sourceRoot":"","sources":["../../src/dates/convertMonthNumbersToMonthNames.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,kDAAkD,CAAC;AAEzE,OAAO,2BAA2B,MAAM,mCAAmC,CAAC;AAE5E;;;;;;;;;GASG;AACH,MAAM,+BAA+B,GAAG,CAAC,UAAkB,EAAE,SAAiB,EAAE,YAA2B,EAAE,EAAE;IAC9G,MAAM,UAAU,GAAG,2BAA2B,CAAC,SAAS,EAAE,CAAC,CAAC;IAC5D,MAAM,OAAO,GAAG,UAAU,CAAC,kBAAkB,CAAC,EAAE,CAAC,CAAC;IAClD,MAAM,oBAAoB,GAAG,UAAU,CAAC,mBAAmB,CAAC,aAAa,EAAE,YAAY,CAAkB,CAAC;IAC1G,MAAM,wBAAwB,GAAG,UAAU,CAAC,mBAAmB,CAAC,MAAM,EAAE,YAAY,CAAkB,CAAC;I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B,OAAO;YACN,IAAI,EAAE,UAAU,CAAC,SAAS,CAAC,aAAa,EAAE,YAAY,CAAC,CAAC,UAAU,CAAC;YACnE,QAAQ,EAAE,UAAU,CAAC,SAAS,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC,UAAU,CAAC;SAChE,CAAC;KACF;IAED,OAAO;QACN,IAAI,EAAE,OAAO,CAAC,OAAO,CAAC,OAAO,EAAE,oBAAoB,CAAC,UAAU,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,EAAE,oBAAoB,CAAC,SAAS,CAAC,CAAC;QAClH,QAAQ,EAAE,OAAO,CAAC,OAAO,CAAC,OAAO,EAAE,wBAAwB,CAAC,UAAU,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,EAAE,wBAAwB,CAAC,SAAS,CAAC,CAAC;KAC9H,CAAC;AACH,CAAC,CAAC;AAEF,eAAe,+BAA+B,CAAC","sourcesContent":["import getLocale from \"@ui5/webcomponents-base/dist/locale/getLocale.js\";\nimport type CalendarType from \"@ui5/webcomponents-base/dist/types/CalendarType.js\";\nimport getCachedLocaleDataInstance from \"../getCachedLocaleDataInstance.js\";\n\n/**\n * Convert month number to month name (text).\n * If the numbers of the two months are the same you will get the name of the month,\n * otherwise you will get the two names separated by a dash\n *\n * @param firstMonth CalendarDate Month\n * @param lastMonth CalendarDate Month\n * @param calendarType calendar type\n * @returns {String}\n */\nconst convertMonthNumbersToMonthNames = (firstMonth: number, lastMonth: number, calendarType?: CalendarType) => {\n\tconst localeData = getCachedLocaleDataInstance(getLocale());\n\tconst pattern = localeData.getIntervalPattern(\"\");\n\tconst secondaryMonthsNames = localeData.getMonthsStandAlone(\"abbreviated\", calendarType) as Array<string>;\n\tconst secondaryMonthsNamesWide = localeData.getMonthsStandAlone(\"wide\", calendarType) as Array<string>;\n\n\tif (firstMonth === lastMonth) {\n\t\treturn {\n\t\t\ttext: localeData.getMonths(\"abbreviated\", calendarType)[firstMonth],\n\t\t\ttextInfo: localeData.getMonths(\"wide\", calendarType)[firstMonth],\n\t\t};\n\t}\n\n\treturn {\n\t\ttext: pattern.replace(/\\{0\\}/, secondaryMonthsNames[firstMonth]).replace(/\\{1\\}/, secondaryMonthsNames[lastMonth]),\n\t\ttextInfo: pattern.replace(/\\{0\\}/, secondaryMonthsNamesWide[firstMonth]).replace(/\\{1\\}/, secondaryMonthsNamesWide[lastMonth]),\n\t};\n};\n\nexport default convertMonthNumbersToMonthNames;\n"]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"getDaysInMonth.js","sourceRoot":"","sources":["../../src/dates/getDaysInMonth.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,MAAM,mBAAmB,CAAC;AAE7C,MAAM,cAAc,GAAG,CAAC,IAAkB,EAAE,EAAE;IAC7C,MAAM,gBAAgB,GAAG,IAAI,YAAY,CAAC,IAAI,CAAC,CAAC;IAChD,gBAAgB,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IAC5B,gBAAgB,CAAC,QAAQ,CAAC,gBAAgB,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC,CAAC;IAC3D,gBAAgB,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IAC5B,OAAO,gBAAgB,CAAC,OAAO,EAAE,CAAC;AACnC,CAAC,CAAC;AAEF,eAAe,cAAc,CAAC"}
|
1
|
+
{"version":3,"file":"getDaysInMonth.js","sourceRoot":"","sources":["../../src/dates/getDaysInMonth.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,MAAM,mBAAmB,CAAC;AAE7C,MAAM,cAAc,GAAG,CAAC,IAAkB,EAAE,EAAE;IAC7C,MAAM,gBAAgB,GAAG,IAAI,YAAY,CAAC,IAAI,CAAC,CAAC;IAChD,gBAAgB,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IAC5B,gBAAgB,CAAC,QAAQ,CAAC,gBAAgB,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC,CAAC;IAC3D,gBAAgB,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IAC5B,OAAO,gBAAgB,CAAC,OAAO,EAAE,CAAC;AACnC,CAAC,CAAC;AAEF,eAAe,cAAc,CAAC","sourcesContent":["import CalendarDate from \"./CalendarDate.js\";\n\nconst getDaysInMonth = (date: CalendarDate) => {\n\tconst tempCalendarDate = new CalendarDate(date);\n\ttempCalendarDate.setDate(1);\n\ttempCalendarDate.setMonth(tempCalendarDate.getMonth() + 1);\n\ttempCalendarDate.setDate(0);\n\treturn tempCalendarDate.getDate();\n};\n\nexport default getDaysInMonth;\n"]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"getRoundedTimestamp.js","sourceRoot":"","sources":["../../src/dates/getRoundedTimestamp.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,mBAAmB,GAAG,CAAC,eAAuB,EAAE,EAAE;IACvD,IAAI,CAAC,eAAe,EAAE;QACrB,eAAe,GAAG,IAAI,IAAI,EAAE,CAAC,OAAO,EAAE,CAAC;KACvC;IACD,MAAM,OAAO,GAAG,eAAe,GAAG,CAAC,eAAe,GAAG,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC,CAAC,CAAC;IAC5E,OAAO,OAAO,GAAG,IAAI,CAAC;AACvB,CAAC,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
|
1
|
+
{"version":3,"file":"getRoundedTimestamp.js","sourceRoot":"","sources":["../../src/dates/getRoundedTimestamp.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,mBAAmB,GAAG,CAAC,eAAuB,EAAE,EAAE;IACvD,IAAI,CAAC,eAAe,EAAE;QACrB,eAAe,GAAG,IAAI,IAAI,EAAE,CAAC,OAAO,EAAE,CAAC;KACvC;IACD,MAAM,OAAO,GAAG,eAAe,GAAG,CAAC,eAAe,GAAG,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC,CAAC,CAAC;IAC5E,OAAO,OAAO,GAAG,IAAI,CAAC;AACvB,CAAC,CAAC;AAEF,eAAe,mBAAmB,CAAC","sourcesContent":["/**\n * Returns a timestamp with only the year, month and day (with zero hours, minutes and seconds) and without 000 for milliseconds\n * @param { number } millisecondsUTC\n * @returns { number }\n */\nconst getRoundedTimestamp = (millisecondsUTC: number) => {\n\tif (!millisecondsUTC) {\n\t\tmillisecondsUTC = new Date().getTime();\n\t}\n\tconst rounded = millisecondsUTC - (millisecondsUTC % (24 * 60 * 60 * 1000));\n\treturn rounded / 1000;\n};\n\nexport default getRoundedTimestamp;\n"]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"getTodayUTCTimestamp.js","sourceRoot":"","sources":["../../src/dates/getTodayUTCTimestamp.ts"],"names":[],"mappings":"AACA,OAAO,YAAY,MAAM,mBAAmB,CAAC;AAE7C;;;GAGG;AACH,MAAM,oBAAoB,GAAG,CAAC,mBAAiC,EAAE,EAAE,CAAC,YAAY,CAAC,eAAe,CAAC,IAAI,IAAI,EAAE,EAAE,mBAAmB,CAAC,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC;AAEnJ,eAAe,oBAAoB,CAAC"}
|
1
|
+
{"version":3,"file":"getTodayUTCTimestamp.js","sourceRoot":"","sources":["../../src/dates/getTodayUTCTimestamp.ts"],"names":[],"mappings":"AACA,OAAO,YAAY,MAAM,mBAAmB,CAAC;AAE7C;;;GAGG;AACH,MAAM,oBAAoB,GAAG,CAAC,mBAAiC,EAAE,EAAE,CAAC,YAAY,CAAC,eAAe,CAAC,IAAI,IAAI,EAAE,EAAE,mBAAmB,CAAC,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC;AAEnJ,eAAe,oBAAoB,CAAC","sourcesContent":["import type CalendarType from \"@ui5/webcomponents-base/dist/types/CalendarType.js\";\nimport CalendarDate from \"./CalendarDate.js\";\n\n/**\n * Returns a UTC timestamp representing today\n * @public\n */\nconst getTodayUTCTimestamp = (primaryCalendarType: CalendarType) => CalendarDate.fromLocalJSDate(new Date(), primaryCalendarType).valueO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AC,CAAC,CAAC;SACnB;KACD;SAAM;QACN,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,MAAM,CAAC,CAAC;QACzC,IAAI,OAAO,CAAC,QAAQ,EAAE,KAAK,IAAI,CAAC,QAAQ,EAAE,EAAE,EAAE,kCAAkC;YAC/E,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,mCAAmC;SACvD;KACD;IAED,IAAI,OAAO,IAAI,OAAO,CAAC,OAAO,EAAE,GAAG,OAAO,CAAC,OAAO,EAAE,EAAE;QACrD,OAAO,IAAI,YAAY,CAAC,OAAO,CAAC,CAAC;KACjC;IAED,IAAI,OAAO,IAAI,OAAO,CAAC,OAAO,EAAE,GAAG,OAAO,CAAC,OAAO,EAAE,EAAE;QACrD,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 minDate minimum date to enforce\n * @param maxDate maximum date to enforce\n */\nconst modifyDateBy = (date: CalendarDate, amount: number, unit: string, minDate?: CalendarDate, maxDate?: CalendarDate) => {\n\tconst newDate = new CalendarDate(date);\n\tif (unit === \"day\") {\n\t\tnewDate.setDate(date.getDate() + amount);\n\t} else if (unit === \"month\") {\n\t\tnewDate.setMonth(date.getMonth() + amount);\n\t\tconst stillSameMonth = amount === -1 && newDate.getMonth() === date.getMonth(); // f.e. PageUp remained in the same month\n\t\tconst monthSkipped = amount === 1 && newDate.getMonth() - date.getMonth() > 1; // f.e. PageDown skipped a whole month\n\t\tif (stillSameMonth || monthSkipped) { // Select the last day of the month in any of these 2 scenarios\n\t\t\tnewDate.setDate(0);\n\t\t}\n\t} else {\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}\n\n\tif (minDate && newDate.valueOf() < minDate.valueOf()) {\n\t\treturn new CalendarDate(minDate);\n\t}\n\n\tif (maxDate && newDate.valueOf() > maxDate.valueOf()) {\n\t\treturn new CalendarDate(maxDate);\n\t}\n\n\treturn newDate;\n};\n\nexport default modifyDateBy;\n"]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"transformDateToSecondaryType.js","sourceRoot":"","sources":["../../src/dates/transformDateToSecondaryType.ts"],"names":[],"mappings":"AACA,OAAO,YAAY,MAAM,mBAAmB,CAAC;AAC7C,OAAO,cAAc,MAAM,qBAAqB,CAAC;AAEjD,MAAM,4BAA4B,GAAG,CAAC,mBAA6C,EAAE,qBAA8C,EAAE,SAAiB,EAAE,aAAuB,EAAE,EAAE;IAClL,IAAI,SAAS,GAAG,YAAY,CAAC,eAAe,CAAC,IAAI,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,EAAE,mBAAmB,CAAC,CAAC;IAC9F,IAAI,QAAQ,GAAG,YAAY,CAAC,eAAe,CAAC,IAAI,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,EAAE,mBAAmB,CAAC,CAAC;IAC7F,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IAErB,IAAI,aAAa,EAAE;QAClB,SAAS,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;QACtB,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;KACtB;IAED,QAAQ,CAAC,OAAO,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC,CAAC;IAC3C,SAAS,GAAG,IAAI,YAAY,CAAC,SAAS,EAAE,qBAAqB,CAAC,CAAC;IAC/D,QAAQ,GAAG,IAAI,YAAY,CAAC,QAAQ,EAAE,qBAAqB,CAAC,CAAC;IAC7D,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,CAAC;AAChC,CAAC,CAAC;AAEF,eAAe,4BAA4B,CAAC"}
|
1
|
+
{"version":3,"file":"transformDateToSecondaryType.js","sourceRoot":"","sources":["../../src/dates/transformDateToSecondaryType.ts"],"names":[],"mappings":"AACA,OAAO,YAAY,MAAM,mBAAmB,CAAC;AAC7C,OAAO,cAAc,MAAM,qBAAqB,CAAC;AAEjD,MAAM,4BAA4B,GAAG,CAAC,mBAA6C,EAAE,qBAA8C,EAAE,SAAiB,EAAE,aAAuB,EAAE,EAAE;IAClL,IAAI,SAAS,GAAG,YAAY,CAAC,eAAe,CAAC,IAAI,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,EAAE,mBAAmB,CAAC,CAAC;IAC9F,IAAI,QAAQ,GAAG,YAAY,CAAC,eAAe,CAAC,IAAI,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,EAAE,mBAAmB,CAAC,CAAC;IAC7F,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IAErB,IAAI,aAAa,EAAE;QAClB,SAAS,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;QACtB,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;KACtB;IAED,QAAQ,CAAC,OAAO,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC,CAAC;IAC3C,SAAS,GAAG,IAAI,YAAY,CAAC,SAAS,EAAE,qBAAqB,CAAC,CAAC;IAC/D,QAAQ,GAAG,IAAI,YAAY,CAAC,QAAQ,EAAE,qBAAqB,CAAC,CAAC;IAC7D,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,CAAC;AAChC,CAAC,CAAC;AAEF,eAAe,4BAA4B,CAAC","sourcesContent":["import type CalendarType from \"@ui5/webcomponents-base/dist/types/CalendarType.js\";\nimport CalendarDate from \"./CalendarDate.js\";\nimport getDaysInMonth from \"./getDaysInMonth.js\";\n\nconst transformDateToSecondaryType = (primaryCalendarType: CalendarType | undefined, secondaryCalendarType: CalendarType| undefined, timeStamp: number, hasYearPicker?: boolean) => {\n\tlet firstDate = CalendarDate.fromLocalJSDate(new Date(timeStamp * 1000), primaryCalendarType);\n\tlet lastDate = CalendarDate.fromLocalJSDate(new Date(timeStamp * 1000), primaryCalendarType);\n\tfirstDate.setDate(1);\n\n\tif (hasYearPicker) {\n\t\tfirstDate.setMonth(0);\n\t\tlastDate.setMonth(11);\n\t}\n\n\tlastDate.setDate(getDaysInMonth(lastDate));\n\tfirstDate = new CalendarDate(firstDate, secondaryCalendarType);\n\tlastDate = new CalendarDate(lastDate, secondaryCalendarType);\n\treturn { firstDate, lastDate };\n};\n\nexport default transformDateToSecondaryType;\n"]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Buddhist.js","sourceRoot":"","sources":["../../../src/features/calendar/Buddhist.ts"],"names":[],"mappings":"AAAA,OAAO,oCAAoC,CAAC"}
|
1
|
+
{"version":3,"file":"Buddhist.js","sourceRoot":"","sources":["../../../src/features/calendar/Buddhist.ts"],"names":[],"mappings":"AAAA,OAAO,oCAAoC,CAAC","sourcesContent":["import \"../../sap/ui/core/date/Buddhist.js\";\n"]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Gregorian.js","sourceRoot":"","sources":["../../../src/features/calendar/Gregorian.ts"],"names":[],"mappings":"AAAA,OAAO,qCAAqC,CAAC"}
|
1
|
+
{"version":3,"file":"Gregorian.js","sourceRoot":"","sources":["../../../src/features/calendar/Gregorian.ts"],"names":[],"mappings":"AAAA,OAAO,qCAAqC,CAAC","sourcesContent":["import \"../../sap/ui/core/date/Gregorian.js\";\n"]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Islamic.js","sourceRoot":"","sources":["../../../src/features/calendar/Islamic.ts"],"names":[],"mappings":"AAAA,OAAO,mCAAmC,CAAC"}
|
1
|
+
{"version":3,"file":"Islamic.js","sourceRoot":"","sources":["../../../src/features/calendar/Islamic.ts"],"names":[],"mappings":"AAAA,OAAO,mCAAmC,CAAC","sourcesContent":["import \"../../sap/ui/core/date/Islamic.js\";\n"]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Japanese.js","sourceRoot":"","sources":["../../../src/features/calendar/Japanese.ts"],"names":[],"mappings":"AAAA,OAAO,oCAAoC,CAAC"}
|
1
|
+
{"version":3,"file":"Japanese.js","sourceRoot":"","sources":["../../../src/features/calendar/Japanese.ts"],"names":[],"mappings":"AAAA,OAAO,oCAAoC,CAAC","sourcesContent":["import \"../../sap/ui/core/date/Japanese.js\";\n"]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Persian.js","sourceRoot":"","sources":["../../../src/features/calendar/Persian.ts"],"names":[],"mappings":"AAAA,OAAO,mCAAmC,CAAC"}
|
1
|
+
{"version":3,"file":"Persian.js","sourceRoot":"","sources":["../../../src/features/calendar/Persian.ts"],"names":[],"mappings":"AAAA,OAAO,mCAAmC,CAAC","sourcesContent":["import \"../../sap/ui/core/date/Persian.js\";\n"]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"getCachedLocaleDataInstance.js","sourceRoot":"","sources":["../src/getCachedLocaleDataInstance.ts"],"names":[],"mappings":"AAEA,OAAO,UAAU,MAAM,iBAAiB,CAAC;AAEzC,MAAM,KAAK,GAAG,IAAI,GAAG,EAAsB,CAAC;AAE5C,MAAM,2BAA2B,GAAG,CAAC,MAAc,EAAE,EAAE;IACtD,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE;QACvB,KAAK,CAAC,GAAG,CAAC,MAAM,EAAE,IAAI,UAAU,CAAC,MAA4B,CAAC,CAAC,CAAC;KAChE;IAED,OAAO,KAAK,CAAC,GAAG,CAAC,MAAM,CAAE,CAAC;AAC3B,CAAC,CAAC;AAEF,eAAe,2BAA2B,CAAC"}
|
1
|
+
{"version":3,"file":"getCachedLocaleDataInstance.js","sourceRoot":"","sources":["../src/getCachedLocaleDataInstance.ts"],"names":[],"mappings":"AAEA,OAAO,UAAU,MAAM,iBAAiB,CAAC;AAEzC,MAAM,KAAK,GAAG,IAAI,GAAG,EAAsB,CAAC;AAE5C,MAAM,2BAA2B,GAAG,CAAC,MAAc,EAAE,EAAE;IACtD,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE;QACvB,KAAK,CAAC,GAAG,CAAC,MAAM,EAAE,IAAI,UAAU,CAAC,MAA4B,CAAC,CAAC,CAAC;KAChE;IAED,OAAO,KAAK,CAAC,GAAG,CAAC,MAAM,CAAE,CAAC;AAC3B,CAAC,CAAC;AAEF,eAAe,2BAA2B,CAAC","sourcesContent":["import type Locale from \"@ui5/webcomponents-base/dist/locale/Locale.js\";\nimport type LocaleT from \"sap/ui/core/Locale\";\nimport LocaleData from \"./LocaleData.js\";\n\nconst cache = new Map<Locale, LocaleData>();\n\nconst getCachedLocaleDataInstance = (locale: Locale) => {\n\tif (!cache.has(locale)) {\n\t\tcache.set(locale, new LocaleData(locale as unknown as LocaleT));\n\t}\n\n\treturn cache.get(locale)!;\n};\n\nexport default getCachedLocaleDataInstance;\n"]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"getLocaleData.js","sourceRoot":"","sources":["../../src/locale/getLocaleData.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,6DAA6D,CAAC;AACxF,OAAO,SAAS,MAAM,kDAAkD,CAAC;AAEzE,OAAO,UAAU,MAAM,kBAAkB,CAAC;AAE1C,MAAM,SAAS,GAAG,IAAI,GAAG,EAAsB,CAAC;AAEhD;;;;;;;GAOG;AACH,MAAM,aAAa,GAAG,KAAK,EAAE,IAAY,EAAuB,EAAE;IACjE,MAAM,MAAM,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC;IAC/B,MAAM,UAAU,GAAG,MAAM,CAAC,WAAW,EAAE,CAAC;IAExC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE;QAC/B,MAAM,SAAS,CAAC,MAAM,CAAC,WAAW,EAAE,EAAE,MAAM,CAAC,SAAS,EAAE,EAAE,MAAM,CAAC,SAAS,EAAE,CAAC,CAAC;QAC9E,SAAS,CAAC,GAAG,CAAC,UAAU,EAAE,IAAI,UAAU,CAAC,MAA4B,CAAC,CAAC,CAAC;KACxE;IAED,OAAO,SAAS,CAAC,GAAG,CAAC,UAAU,CAAE,CAAC;AACnC,CAAC,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
1
|
+
{"version":3,"file":"getLocaleData.js","sourceRoot":"","sources":["../../src/locale/getLocaleData.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,6DAA6D,CAAC;AACxF,OAAO,SAAS,MAAM,kDAAkD,CAAC;AAEzE,OAAO,UAAU,MAAM,kBAAkB,CAAC;AAE1C,MAAM,SAAS,GAAG,IAAI,GAAG,EAAsB,CAAC;AAEhD;;;;;;;GAOG;AACH,MAAM,aAAa,GAAG,KAAK,EAAE,IAAY,EAAuB,EAAE;IACjE,MAAM,MAAM,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC;IAC/B,MAAM,UAAU,GAAG,MAAM,CAAC,WAAW,EAAE,CAAC;IAExC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE;QAC/B,MAAM,SAAS,CAAC,MAAM,CAAC,WAAW,EAAE,EAAE,MAAM,CAAC,SAAS,EAAE,EAAE,MAAM,CAAC,SAAS,EAAE,CAAC,CAAC;QAC9E,SAAS,CAAC,GAAG,CAAC,UAAU,EAAE,IAAI,UAAU,CAAC,MAA4B,CAAC,CAAC,CAAC;KACxE;IAED,OAAO,SAAS,CAAC,GAAG,CAAC,UAAU,CAAE,CAAC;AACnC,CAAC,CAAC;AAEF,eAAe,aAAa,CAAC","sourcesContent":["import { fetchCldr } from \"@ui5/webcomponents-base/dist/asset-registries/LocaleData.js\";\nimport getLocale from \"@ui5/webcomponents-base/dist/locale/getLocale.js\";\nimport type LocaleT from \"sap/ui/core/Locale\";\nimport LocaleData from \"../LocaleData.js\";\n\nconst instances = new Map<string, LocaleData>();\n\n/**\n * Fetches and returns а LocaleData object for the required locale\n * For more information on this object's API, please see:\n * https://sdk.openui5.org/api/sap.ui.core.LocaleData\n *\n * @param { string } lang - if left empty, will use the configured/current locale\n * @returns { Promise<LocaleData> }\n */\nconst getLocaleData = async (lang: string): Promise<LocaleData> => {\n\tconst locale = getLocale(lang);\n\tconst localeLang = locale.getLanguage();\n\n\tif (!instances.has(localeLang)) {\n\t\tawait fetchCldr(locale.getLanguage(), locale.getRegion(), locale.getScript());\n\t\tinstances.set(localeLang, new LocaleData(locale as unknown as LocaleT));\n\t}\n\n\treturn instances.get(localeLang)!;\n};\n\nexport default getLocaleData;\n"]}
|
@@ -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;QAClB,MAAM,IAAI,KAAK,CAAC,mBAAmB,UAAU,GAAG,CAAC,CAAC;KAClD;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"}
|
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;QAClB,MAAM,IAAI,KAAK,CAAC,mBAAmB,UAAU,GAAG,CAAC,CAAC;KAClD;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"]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Configuration.js","sourceRoot":"","sources":["../../../../src/sap/ui/core/Configuration.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,iDAAiD,CAAC;AAC9E,OAAO,EAAE,eAAe,EAAE,MAAM,qDAAqD,CAAC;AACtF,OAAO,4BAA4B,MAAM,mEAAmE,CAAC;AAC7G,aAAa;AACb,OAAO,YAAY,MAAM,0BAA0B,CAAC;AACpD,OAAO,cAAc,MAAM,qBAAqB,CAAC;AAEjD,MAAM,OAAO,GAAG,GAAG,EAAE,GAAE,CAAC,CAAC;AAEzB;;GAEG;AACH,MAAM,aAAa,GAAG;IACrB,WAAW;IACX,eAAe;IACf,qBAAqB,EAAE,GAAG,EAAE,CAAC,4BAA4B,CAAC,2IAA2I,CAAC;IACtM,aAAa,EAAE,OAAO;IACtB,iBAAiB,EAAE,GAAG,EAAE,CAAC,cAAc;IACvC,WAAW,EAAE,GAAG,EAAE,CAAC,YAAY,CAAC,gBAAgB,EAAY;CAC5D,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
1
|
+
{"version":3,"file":"Configuration.js","sourceRoot":"","sources":["../../../../src/sap/ui/core/Configuration.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,iDAAiD,CAAC;AAC9E,OAAO,EAAE,eAAe,EAAE,MAAM,qDAAqD,CAAC;AACtF,OAAO,4BAA4B,MAAM,mEAAmE,CAAC;AAC7G,aAAa;AACb,OAAO,YAAY,MAAM,0BAA0B,CAAC;AACpD,OAAO,cAAc,MAAM,qBAAqB,CAAC;AAEjD,MAAM,OAAO,GAAG,GAAG,EAAE,GAAE,CAAC,CAAC;AAEzB;;GAEG;AACH,MAAM,aAAa,GAAG;IACrB,WAAW;IACX,eAAe;IACf,qBAAqB,EAAE,GAAG,EAAE,CAAC,4BAA4B,CAAC,2IAA2I,CAAC;IACtM,aAAa,EAAE,OAAO;IACtB,iBAAiB,EAAE,GAAG,EAAE,CAAC,cAAc;IACvC,WAAW,EAAE,GAAG,EAAE,CAAC,YAAY,CAAC,gBAAgB,EAAY;CAC5D,CAAC;AAEF,eAAe,aAAa,CAAC","sourcesContent":["import { getLanguage } from \"@ui5/webcomponents-base/dist/config/Language.js\";\nimport { getCalendarType } from \"@ui5/webcomponents-base/dist/config/CalendarType.js\";\nimport getDesigntimePropertyAsArray from \"@ui5/webcomponents-base/dist/util/getDesigntimePropertyAsArray.js\";\n// @ts-ignore\nimport TimezoneUtil from \"./format/TimezoneUtil.js\";\nimport FormatSettings from \"./FormatSettings.js\";\n\nconst emptyFn = () => {};\n\n/**\n * OpenUI5 Configuration Shim\n */\nconst Configuration = {\n\tgetLanguage,\n\tgetCalendarType,\n\tgetSupportedLanguages: () => getDesigntimePropertyAsArray(\"$core-i18n-locales:,ar,bg,ca,cs,da,de,el,en,es,et,fi,fr,hi,hr,hu,it,iw,ja,ko,lt,lv,nl,no,pl,pt,ro,ru,sh,sk,sl,sv,th,tr,uk,vi,zh_CN,zh_TW$\"),\n\tgetOriginInfo: emptyFn,\n\tgetFormatSettings: () => FormatSettings,\n\tgetTimezone: () => TimezoneUtil.getLocalTimezone() as string,\n};\n\nexport default Configuration;\n"]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Core.js","sourceRoot":"","sources":["../../../../src/sap/ui/core/Core.ts"],"names":[],"mappings":"AAAA,OAAO,cAAc,MAAM,qBAAqB,CAAC;AACjD,OAAO,aAAa,MAAM,oBAAoB,CAAC;AAE/C,MAAM,OAAO,GAAG,GAAG,EAAE,GAAE,CAAC,CAAC;AAEzB;;GAEG;AACH,MAAM,IAAI,GAAG;IACZ,gBAAgB,EAAE,GAAG,EAAE,CAAC,aAAa;IACrC,wBAAwB,EAAE,OAAO,EAAE;IACnC,iBAAiB,EAAE,GAAG,EAAE,CAAC,cAAc;CACvC,CAAC;AAEF,eAAe,IAAI,CAAC"}
|
1
|
+
{"version":3,"file":"Core.js","sourceRoot":"","sources":["../../../../src/sap/ui/core/Core.ts"],"names":[],"mappings":"AAAA,OAAO,cAAc,MAAM,qBAAqB,CAAC;AACjD,OAAO,aAAa,MAAM,oBAAoB,CAAC;AAE/C,MAAM,OAAO,GAAG,GAAG,EAAE,GAAE,CAAC,CAAC;AAEzB;;GAEG;AACH,MAAM,IAAI,GAAG;IACZ,gBAAgB,EAAE,GAAG,EAAE,CAAC,aAAa;IACrC,wBAAwB,EAAE,OAAO,EAAE;IACnC,iBAAiB,EAAE,GAAG,EAAE,CAAC,cAAc;CACvC,CAAC;AAEF,eAAe,IAAI,CAAC","sourcesContent":["import FormatSettings from \"./FormatSettings.js\";\nimport Configuration from \"./Configuration.js\";\n\nconst emptyFn = () => {};\n\n/**\n * OpenUI5 Core shim\n */\nconst Core = {\n\tgetConfiguration: () => Configuration,\n\tgetLibraryResourceBundle: emptyFn(),\n\tgetFormatSettings: () => FormatSettings,\n};\n\nexport default Core;\n"]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"FormatSettings.js","sourceRoot":"","sources":["../../../../src/sap/ui/core/FormatSettings.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,kDAAkD,CAAC;AACzE,OAAO,EAAE,gCAAgC,EAAE,MAAM,uDAAuD,CAAC;AAEzG,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;IAC5B,gCAAgC;CAChC,CAAC;AAEF,eAAe,cAAc,CAAC"}
|
1
|
+
{"version":3,"file":"FormatSettings.js","sourceRoot":"","sources":["../../../../src/sap/ui/core/FormatSettings.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,kDAAkD,CAAC;AACzE,OAAO,EAAE,gCAAgC,EAAE,MAAM,uDAAuD,CAAC;AAEzG,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;IAC5B,gCAAgC;CAChC,CAAC;AAEF,eAAe,cAAc,CAAC","sourcesContent":["import getLocale from \"@ui5/webcomponents-base/dist/locale/getLocale.js\";\nimport { getLegacyDateCalendarCustomizing } from \"@ui5/webcomponents-base/dist/config/FormatSettings.js\";\n\nconst emptyFn = () => {};\n\n/**\n * OpenUI5 FormatSettings shim\n */\nconst FormatSettings = {\n\tgetFormatLocale: getLocale,\n\tgetLegacyDateFormat: emptyFn,\n\tgetCustomLocaleData: emptyFn,\n\tgetLegacyDateCalendarCustomizing,\n};\n\nexport default FormatSettings;\n"]}
|
package/package-scripts.js
CHANGED
@@ -5,7 +5,7 @@ const esmAbsToRel = resolve.sync("@ui5/webcomponents-tools/lib/esm-abs-to-rel/in
|
|
5
5
|
|
6
6
|
const scripts = {
|
7
7
|
clean: "rimraf dist",
|
8
|
-
lint: "eslint . --config config/.eslintrc.js",
|
8
|
+
lint: "cross-env UI5_TS=true eslint . --config config/.eslintrc.js",
|
9
9
|
build: {
|
10
10
|
"default": "nps lint clean copy.used-modules copy.cldr copy.overlay build.replace-amd build.replace-export-true build.replace-export-false build.amd-to-es6 build.replace-global-core-usage build.esm-abs-to-rel build.jsonImports build.typescript copy.src",
|
11
11
|
"replace-amd": "replace-in-file sap.ui.define define dist/**/*.js",
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@ui5/webcomponents-localization",
|
3
|
-
"version": "1.12.0-rc.
|
3
|
+
"version": "1.12.0-rc.3",
|
4
4
|
"description": "Localization for UI5 Web Components",
|
5
5
|
"author": "SAP SE (https://www.sap.com)",
|
6
6
|
"license": "Apache-2.0",
|
@@ -28,14 +28,14 @@
|
|
28
28
|
},
|
29
29
|
"devDependencies": {
|
30
30
|
"@openui5/sap.ui.core": "1.109.0",
|
31
|
-
"@ui5/webcomponents-tools": "1.12.0-rc.
|
31
|
+
"@ui5/webcomponents-tools": "1.12.0-rc.3",
|
32
32
|
"chromedriver": "110.0.0",
|
33
33
|
"mkdirp": "^1.0.4",
|
34
34
|
"resolve": "^1.20.0"
|
35
35
|
},
|
36
36
|
"dependencies": {
|
37
37
|
"@types/openui5": "^1.109.0",
|
38
|
-
"@ui5/webcomponents-base": "1.12.0-rc.
|
38
|
+
"@ui5/webcomponents-base": "1.12.0-rc.3"
|
39
39
|
},
|
40
|
-
"gitHead": "
|
40
|
+
"gitHead": "ae6ca4708b81a04de42ec2be50383fa80630e250"
|
41
41
|
}
|
package/tsconfig.json
CHANGED
package/src/Assets-static.ts
DELETED
package/src/Assets.ts
DELETED
package/src/DateFormat.ts
DELETED
@@ -1,8 +0,0 @@
|
|
1
|
-
import type DateFormatT from "sap/ui/core/format/DateFormat";
|
2
|
-
// @ts-ignore
|
3
|
-
import DateFormatNative from "./sap/ui/core/format/DateFormat.js";
|
4
|
-
|
5
|
-
const DateFormatWrapped = DateFormatNative as typeof DateFormatT;
|
6
|
-
class DateFormat extends DateFormatWrapped {}
|
7
|
-
|
8
|
-
export default DateFormat;
|
package/src/LocaleData.ts
DELETED
@@ -1,8 +0,0 @@
|
|
1
|
-
import type LocaleDataOpenUI5T from "sap/ui/core/LocaleData";
|
2
|
-
// @ts-ignore
|
3
|
-
import LocaleDataNative from "./sap/ui/core/LocaleData.js";
|
4
|
-
|
5
|
-
const LocaleDataWrapped = LocaleDataNative as typeof LocaleDataOpenUI5T;
|
6
|
-
class LocaleData extends LocaleDataWrapped {}
|
7
|
-
|
8
|
-
export default LocaleData;
|
@@ -1,232 +0,0 @@
|
|
1
|
-
import type CalendarType from "@ui5/webcomponents-base/dist/types/CalendarType.js";
|
2
|
-
import UniversalDate from "./UniversalDate.js";
|
3
|
-
|
4
|
-
class CalendarDate {
|
5
|
-
_oUDate!: Date | UniversalDate;
|
6
|
-
|
7
|
-
constructor(year?: number | CalendarDate, month?: number | string, date?: number, calendarType?: string) { // eslint-disable-line
|
8
|
-
let aArgs = arguments, // eslint-disable-line
|
9
|
-
oJSDate: Date,
|
10
|
-
oNow: Date,
|
11
|
-
sCalendarType!: CalendarType;
|
12
|
-
|
13
|
-
switch (aArgs.length) {
|
14
|
-
case 0: // defaults to the current date
|
15
|
-
oNow = new Date();
|
16
|
-
return (this.constructor(oNow.getFullYear(), oNow.getMonth(), oNow.getDate()) as CalendarDate);
|
17
|
-
|
18
|
-
case 1: // CalendarDate
|
19
|
-
case 2: // CalendarDate, sCalendarType
|
20
|
-
if (!(aArgs[0] instanceof CalendarDate)) {
|
21
|
-
throw new Error("Invalid arguments: the first argument must be of type CalendarDate.");
|
22
|
-
}
|
23
|
-
sCalendarType = aArgs[1] ? aArgs[1] : (aArgs[0]._oUDate as UniversalDate).sCalendarType;
|
24
|
-
// Use source.valueOf() (returns the same point of time regardless calendar type) instead of
|
25
|
-
// source's getters to avoid non-gregorian Year, Month and Date may be used to construct a Gregorian date
|
26
|
-
oJSDate = new Date(aArgs[0].valueOf());
|
27
|
-
|
28
|
-
// Make this date really local. Now getters are safe.
|
29
|
-
oJSDate.setFullYear(oJSDate.getUTCFullYear(), oJSDate.getUTCMonth(), oJSDate.getUTCDate());
|
30
|
-
oJSDate.setHours(oJSDate.getUTCHours(), oJSDate.getUTCMinutes(), oJSDate.getUTCSeconds(), oJSDate.getUTCMilliseconds());
|
31
|
-
|
32
|
-
this._oUDate = createUniversalUTCDate(oJSDate, sCalendarType);
|
33
|
-
break;
|
34
|
-
|
35
|
-
case 3: // year, month, date
|
36
|
-
case 4: // year, month, date, sCalendarType
|
37
|
-
checkNumericLike(aArgs[0] as number, `Invalid year: ${aArgs[0] as number}`);
|
38
|
-
checkNumericLike(aArgs[1] as number, `Invalid month: ${aArgs[1] as number}`);
|
39
|
-
checkNumericLike(aArgs[2] as number, `Invalid date: ${aArgs[2] as number}`);
|
40
|
-
|
41
|
-
oJSDate = new Date(0, 0, 1);
|
42
|
-
oJSDate.setFullYear(aArgs[0] as number, aArgs[1] as number, aArgs[2] as number); // 2 digits year is not supported. If so, it is considered as full year as well.
|
43
|
-
|
44
|
-
if (aArgs[3]) {
|
45
|
-
sCalendarType = aArgs[3];
|
46
|
-
}
|
47
|
-
this._oUDate = createUniversalUTCDate(oJSDate, sCalendarType);
|
48
|
-
break;
|
49
|
-
|
50
|
-
default:
|
51
|
-
throw new Error(`${"Invalid arguments. Accepted arguments are: 1) oCalendarDate, (optional)calendarType"
|
52
|
-
+ "or 2) year, month, date, (optional) calendarType"}${aArgs as unknown as string}`);
|
53
|
-
}
|
54
|
-
}
|
55
|
-
|
56
|
-
getYear() {
|
57
|
-
return this._oUDate.getUTCFullYear();
|
58
|
-
}
|
59
|
-
|
60
|
-
setYear(year: number) {
|
61
|
-
checkNumericLike(year, `Invalid year: ${year}`);
|
62
|
-
this._oUDate.setUTCFullYear(year);
|
63
|
-
return this;
|
64
|
-
}
|
65
|
-
|
66
|
-
getMonth() {
|
67
|
-
return this._oUDate.getUTCMonth();
|
68
|
-
}
|
69
|
-
|
70
|
-
/**
|
71
|
-
* Sets the given month as ordinal month of the year.
|
72
|
-
* @param {int} month An integer between 0 and 11, representing the months January through December( or their
|
73
|
-
* equivalent month names for the given calendar).
|
74
|
-
* If the specified value is is outside of the expected range, this method attempts to update the date information
|
75
|
-
* accordingly. For example, if 12 is given as a month, the year will be incremented by 1, and 1 will be used for month.
|
76
|
-
* @param {int} [date] An integer between 1 and 31, representing the day of the month, but other values are allowed.
|
77
|
-
* 0 will result in the previous month's last day.
|
78
|
-
* -1 will result in the day before the previous month's last day.
|
79
|
-
* 32 will result in:
|
80
|
-
* - first day of the next month if the current month has 31 days.
|
81
|
-
* - second day of the next month if the current month has 30 days.
|
82
|
-
* Other value will result in adding or subtracting days according to the given value.
|
83
|
-
* @returns {sap.ui.unified.calendar.CalendarDate} <code>this</code> for method chaining.
|
84
|
-
*/
|
85
|
-
setMonth(month: number, date?: number) {
|
86
|
-
checkNumericLike(month, `Invalid month: ${month}`);
|
87
|
-
if (date || date === 0) {
|
88
|
-
checkNumericLike(date, `Invalid date: ${date}`);
|
89
|
-
this._oUDate.setUTCMonth(month, date);
|
90
|
-
} else {
|
91
|
-
this._oUDate.setUTCMonth(month);
|
92
|
-
}
|
93
|
-
return this;
|
94
|
-
}
|
95
|
-
|
96
|
-
getDate() {
|
97
|
-
return this._oUDate.getUTCDate();
|
98
|
-
}
|
99
|
-
|
100
|
-
setDate(date: number) {
|
101
|
-
checkNumericLike(date, `Invalid date: ${date}`);
|
102
|
-
this._oUDate.setUTCDate(date);
|
103
|
-
return this;
|
104
|
-
}
|
105
|
-
|
106
|
-
getDay() {
|
107
|
-
return this._oUDate.getUTCDay();
|
108
|
-
}
|
109
|
-
|
110
|
-
getCalendarType() {
|
111
|
-
return (this._oUDate as UniversalDate).sCalendarType;
|
112
|
-
}
|
113
|
-
|
114
|
-
isBefore(oCalendarDate: CalendarDate) {
|
115
|
-
checkCalendarDate(oCalendarDate);
|
116
|
-
return this.valueOf() < oCalendarDate.valueOf();
|
117
|
-
}
|
118
|
-
|
119
|
-
isAfter(oCalendarDate: CalendarDate) {
|
120
|
-
checkCalendarDate(oCalendarDate);
|
121
|
-
return this.valueOf() > oCalendarDate.valueOf();
|
122
|
-
}
|
123
|
-
|
124
|
-
isSameOrBefore(oCalendarDate: CalendarDate) {
|
125
|
-
checkCalendarDate(oCalendarDate);
|
126
|
-
return this.valueOf() <= oCalendarDate.valueOf();
|
127
|
-
}
|
128
|
-
|
129
|
-
isSameOrAfter(oCalendarDate: CalendarDate) {
|
130
|
-
checkCalendarDate(oCalendarDate);
|
131
|
-
return this.valueOf() >= oCalendarDate.valueOf();
|
132
|
-
}
|
133
|
-
|
134
|
-
isSame(oCalendarDate: CalendarDate) {
|
135
|
-
checkCalendarDate(oCalendarDate);
|
136
|
-
return this.valueOf() === oCalendarDate.valueOf();
|
137
|
-
}
|
138
|
-
|
139
|
-
toLocalJSDate() {
|
140
|
-
// Use this._oUDate.getTime()(returns the same point of time regardless calendar type) instead of
|
141
|
-
// this._oUDate's getters to avoid non-gregorian Year, Month and Date to be used to construct a Gregorian date
|
142
|
-
const oLocalDate = new Date(this._oUDate.getTime());
|
143
|
-
|
144
|
-
// Make this date really local. Now getters are safe.
|
145
|
-
oLocalDate.setFullYear(oLocalDate.getUTCFullYear(), oLocalDate.getUTCMonth(), oLocalDate.getUTCDate());
|
146
|
-
oLocalDate.setHours(0, 0, 0, 0);
|
147
|
-
|
148
|
-
return oLocalDate;
|
149
|
-
}
|
150
|
-
|
151
|
-
toUTCJSDate() {
|
152
|
-
// Use this._oUDate.getTime()(returns the same point of time regardless calendar type) instead of
|
153
|
-
// this._oUDate's getters to avoid non-gregorian Year, Month and Date to be used to construct a Gregorian date
|
154
|
-
const oUTCDate = new Date(this._oUDate.getTime());
|
155
|
-
oUTCDate.setUTCHours(0, 0, 0, 0);
|
156
|
-
|
157
|
-
return oUTCDate;
|
158
|
-
}
|
159
|
-
|
160
|
-
toString() {
|
161
|
-
return `${(this._oUDate as UniversalDate).sCalendarType}: ${this.getYear()}/${this.getMonth() + 1}/${this.getDate()}`;
|
162
|
-
}
|
163
|
-
|
164
|
-
valueOf() {
|
165
|
-
return this._oUDate.getTime();
|
166
|
-
}
|
167
|
-
|
168
|
-
static fromLocalJSDate(oJSDate: Date, sCalendarType?: CalendarType) {
|
169
|
-
// Cross frame check for a date should be performed here otherwise setDateValue would fail in OPA tests
|
170
|
-
// because Date object in the test is different than the Date object in the application (due to the iframe).
|
171
|
-
// We can use jQuery.type or this method:
|
172
|
-
function isValidDate(date: Date) {
|
173
|
-
return date && Object.prototype.toString.call(date) === "[object Date]" && !isNaN(date as unknown as number); // eslint-disable-line
|
174
|
-
}
|
175
|
-
if (!isValidDate(oJSDate)) {
|
176
|
-
throw new Error(`Date parameter must be a JavaScript Date object: [${oJSDate as unknown as string}].`);
|
177
|
-
}
|
178
|
-
return new CalendarDate(oJSDate.getFullYear(), oJSDate.getMonth(), oJSDate.getDate(), sCalendarType);
|
179
|
-
}
|
180
|
-
|
181
|
-
static fromTimestamp(iTimestamp: number, sCalendarType?: CalendarType) {
|
182
|
-
const oCalDate = new CalendarDate(0, 0, 1);
|
183
|
-
let oUDate;
|
184
|
-
try {
|
185
|
-
oUDate = UniversalDate.getInstance(new Date(iTimestamp), sCalendarType);
|
186
|
-
} catch (e) {
|
187
|
-
oUDate = new Date(NaN); // UniversalDate.getInstance may now throw an Exception - keep the old behavior
|
188
|
-
}
|
189
|
-
oCalDate._oUDate = oUDate;
|
190
|
-
return oCalDate;
|
191
|
-
}
|
192
|
-
}
|
193
|
-
|
194
|
-
function createUniversalUTCDate(oDate: Date, sCalendarType: CalendarType) {
|
195
|
-
if (sCalendarType) {
|
196
|
-
return UniversalDate.getInstance(createUTCDate(oDate), sCalendarType);
|
197
|
-
}
|
198
|
-
return new UniversalDate(createUTCDate(oDate).getTime());
|
199
|
-
}
|
200
|
-
|
201
|
-
/**
|
202
|
-
* Creates a JavaScript UTC Date corresponding to the given JavaScript Date.
|
203
|
-
* @param {Date} oDate JavaScript date object. Time related information is cut.
|
204
|
-
* @returns {Date} JavaScript date created from the date object, but this time considered as UTC date information.
|
205
|
-
*/
|
206
|
-
function createUTCDate(oDate: Date) {
|
207
|
-
const oUTCDate = new Date(Date.UTC(0, 0, 1));
|
208
|
-
|
209
|
-
oUTCDate.setUTCFullYear(oDate.getFullYear(), oDate.getMonth(), oDate.getDate());
|
210
|
-
|
211
|
-
return oUTCDate;
|
212
|
-
}
|
213
|
-
|
214
|
-
function checkCalendarDate(oCalendarDate: CalendarDate) {
|
215
|
-
if (!(oCalendarDate instanceof CalendarDate)) {
|
216
|
-
throw new Error(`Invalid calendar date: [${oCalendarDate as unknown as string}]. Expected: CalendarDate`);
|
217
|
-
}
|
218
|
-
}
|
219
|
-
|
220
|
-
/**
|
221
|
-
* Verifies the given value is numeric like, i.e. 3, "3" and throws an error if it is not.
|
222
|
-
* @param {any} value The value of any type to check. If null or undefined, this method throws an error.
|
223
|
-
* @param {string} message The message to be used if an error is to be thrown
|
224
|
-
* @throws will throw an error if the value is null or undefined or is not like a number
|
225
|
-
*/
|
226
|
-
function checkNumericLike(value: any, message: string) {
|
227
|
-
if (value === undefined || value === Infinity || isNaN(value)) { // eslint-disable-line
|
228
|
-
throw message;
|
229
|
-
}
|
230
|
-
}
|
231
|
-
|
232
|
-
export default CalendarDate;
|
@@ -1,40 +0,0 @@
|
|
1
|
-
import CalendarType from "@ui5/webcomponents-base/dist/types/CalendarType.js";
|
2
|
-
import CalendarDate from "./CalendarDate.js";
|
3
|
-
|
4
|
-
const cache = new Map<string, CalendarDate>();
|
5
|
-
|
6
|
-
const getMinCalendarDate = (primaryCalendarType: CalendarType) => {
|
7
|
-
const key = `min ${primaryCalendarType}`;
|
8
|
-
|
9
|
-
if (!cache.has(key)) {
|
10
|
-
const minDate = new CalendarDate(1, 0, 1, primaryCalendarType);
|
11
|
-
minDate.setYear(1);
|
12
|
-
minDate.setMonth(0);
|
13
|
-
minDate.setDate(1);
|
14
|
-
cache.set(key, minDate);
|
15
|
-
}
|
16
|
-
|
17
|
-
return cache.get(key)!;
|
18
|
-
};
|
19
|
-
|
20
|
-
const getMaxCalendarDate = (primaryCalendarType: CalendarType) => {
|
21
|
-
const key = `max ${primaryCalendarType}`;
|
22
|
-
|
23
|
-
if (!cache.has(key)) {
|
24
|
-
const maxDate = new CalendarDate(1, 0, 1, primaryCalendarType);
|
25
|
-
maxDate.setYear(9999);
|
26
|
-
maxDate.setMonth(11);
|
27
|
-
const tempDate = new CalendarDate(maxDate, primaryCalendarType);
|
28
|
-
tempDate.setDate(1);
|
29
|
-
tempDate.setMonth(tempDate.getMonth() + 1, 0);
|
30
|
-
maxDate.setDate(tempDate.getDate());// 31st for Gregorian Calendar
|
31
|
-
cache.set(key, maxDate);
|
32
|
-
}
|
33
|
-
|
34
|
-
return cache.get(key)!;
|
35
|
-
};
|
36
|
-
|
37
|
-
export {
|
38
|
-
getMinCalendarDate,
|
39
|
-
getMaxCalendarDate,
|
40
|
-
};
|
@@ -1,51 +0,0 @@
|
|
1
|
-
import type CalendarType from "@ui5/webcomponents-base/dist/types/CalendarType.js";
|
2
|
-
// @ts-ignore
|
3
|
-
import UniversalDateNative from "../sap/ui/core/date/UniversalDate.js";
|
4
|
-
|
5
|
-
type UniversalDate = {
|
6
|
-
new (time: number): UniversalDate;
|
7
|
-
oDate: Date,
|
8
|
-
sCalendarType: string,
|
9
|
-
getInstance: (oDate: Date, sCalendarType?: CalendarType) => UniversalDate,
|
10
|
-
getDate: () => number,
|
11
|
-
getMonth: () => number,
|
12
|
-
getFullYear: () => number,
|
13
|
-
getYear: () => number,
|
14
|
-
getDay: () => number,
|
15
|
-
getHours: () => number,
|
16
|
-
getMinutes: () => number,
|
17
|
-
getSeconds: () => number,
|
18
|
-
getMilliseconds: () => number,
|
19
|
-
getUTCDate: () => number,
|
20
|
-
getUTCMonth: () => number,
|
21
|
-
getUTCFullYear: () => number,
|
22
|
-
getUTCDay: () => number,
|
23
|
-
getUTCHours: () => number,
|
24
|
-
getUTCMinutes: () => number,
|
25
|
-
getUTCSeconds: () => number,
|
26
|
-
getUTCMilliseconds: () => number,
|
27
|
-
getTime: () => number,
|
28
|
-
valueOf: () => number,
|
29
|
-
getTimezoneOffset: () => number,
|
30
|
-
toString: () => string,
|
31
|
-
toDateString: () => string,
|
32
|
-
setDate: (dayValue: number) => number,
|
33
|
-
setFullYear: (yearValue: number, monthValue?: number, dateValue?: number) => number,
|
34
|
-
setYear: (yearValue: number) => number,
|
35
|
-
setMonth: (monthValue: number, dayValue?: number) => number,
|
36
|
-
setHours: (hoursValue: number, minutesValue?: number, secondsValue?: number, msValue?: number) => number,
|
37
|
-
setMinutes: (minutesValue: number, secondsValue?: number, msValue?: number) => number,
|
38
|
-
setSeconds: (secondsValue: number, msValue?: number) => number,
|
39
|
-
setMilliseconds: (setMilliseconds: number) => number,
|
40
|
-
setUTCDate:(dayValue: number) => number,
|
41
|
-
setUTCFullYear: (yearValue: number, monthValue?: number, dayValue?: number) => number,
|
42
|
-
setUTCMonth: (monthValue: number, dayValue?: number) => number,
|
43
|
-
setUTCHours: (hoursValue: number, minutesValue?: number, secondsValue?: number, msValue?: number) => number,
|
44
|
-
setUTCMinutes: (minutesValue: number, secondsValue?: number, msValue?: number) => number,
|
45
|
-
setUTCSeconds: (secondsValue: number, msValue?: number) => number,
|
46
|
-
setUTCMilliseconds: (setMilliseconds: number) => number,
|
47
|
-
}
|
48
|
-
|
49
|
-
const UniversalDate: UniversalDate = UniversalDateNative;
|
50
|
-
|
51
|
-
export default UniversalDate;
|
@@ -1,53 +0,0 @@
|
|
1
|
-
import type Locale from "@ui5/webcomponents-base/dist/locale/Locale.js";
|
2
|
-
import UniversalDate from "./UniversalDate.js";
|
3
|
-
import type LocaleData from "../LocaleData.js";
|
4
|
-
|
5
|
-
const calculateWeekNumber = (confFirstDayOfWeek: number | undefined, oDate: Date, iYear: number, oLocale: Locale, oLocaleData: LocaleData) => {
|
6
|
-
let iWeekNum = 0;
|
7
|
-
let iWeekDay = 0;
|
8
|
-
const iFirstDayOfWeek = Number.isInteger(confFirstDayOfWeek) ? confFirstDayOfWeek! : oLocaleData.getFirstDayOfWeek();
|
9
|
-
|
10
|
-
// search Locale for containing "en-US", since sometimes
|
11
|
-
// when any user settings have been defined, subtag "sapufmt" is added to the locale name
|
12
|
-
// this is described inside sap.ui.core.Configuration file
|
13
|
-
if (oLocale && (oLocale.getLanguage() === "en" && oLocale.getRegion() === "US")) {
|
14
|
-
/*
|
15
|
-
* in US the week starts with Sunday
|
16
|
-
* The first week of the year starts with January 1st. But Dec. 31 is still in the last year
|
17
|
-
* So the week beginning in December and ending in January has 2 week numbers
|
18
|
-
*/
|
19
|
-
const oJanFirst = new UniversalDate(oDate.getTime());
|
20
|
-
oJanFirst.setUTCFullYear(iYear, 0, 1);
|
21
|
-
iWeekDay = oJanFirst.getUTCDay();
|
22
|
-
|
23
|
-
// get the date for the same weekday like jan 1.
|
24
|
-
const oCheckDate = new UniversalDate(oDate.getTime());
|
25
|
-
oCheckDate.setUTCDate(oCheckDate.getUTCDate() - oCheckDate.getUTCDay() + iWeekDay);
|
26
|
-
|
27
|
-
iWeekNum = Math.round((oCheckDate.getTime() - oJanFirst.getTime()) / 86400000 / 7) + 1;
|
28
|
-
} else {
|
29
|
-
// normally the first week of the year is the one where the first Thursday of the year is
|
30
|
-
// find Thursday of this week
|
31
|
-
// if the checked day is before the 1. day of the week use a day of the previous week to check
|
32
|
-
const oThursday = new UniversalDate(oDate.getTime());
|
33
|
-
oThursday.setUTCDate(oThursday.getUTCDate() - iFirstDayOfWeek);
|
34
|
-
iWeekDay = oThursday.getUTCDay();
|
35
|
-
oThursday.setUTCDate(oThursday.getUTCDate() - iWeekDay + 4);
|
36
|
-
|
37
|
-
const oFirstDayOfYear = new UniversalDate(oThursday.getTime());
|
38
|
-
oFirstDayOfYear.setUTCMonth(0, 1);
|
39
|
-
iWeekDay = oFirstDayOfYear.getUTCDay();
|
40
|
-
let iAddDays = 0;
|
41
|
-
if (iWeekDay > 4) {
|
42
|
-
iAddDays = 7; // first day of year is after Thursday, so first Thursday is in the next week
|
43
|
-
}
|
44
|
-
const oFirstThursday = new UniversalDate(oFirstDayOfYear.getTime());
|
45
|
-
oFirstThursday.setUTCDate(1 - iWeekDay + 4 + iAddDays);
|
46
|
-
|
47
|
-
iWeekNum = Math.round((oThursday.getTime() - oFirstThursday.getTime()) / 86400000 / 7) + 1;
|
48
|
-
}
|
49
|
-
|
50
|
-
return iWeekNum;
|
51
|
-
};
|
52
|
-
|
53
|
-
export default calculateWeekNumber;
|
@@ -1,34 +0,0 @@
|
|
1
|
-
import getLocale from "@ui5/webcomponents-base/dist/locale/getLocale.js";
|
2
|
-
import type CalendarType from "@ui5/webcomponents-base/dist/types/CalendarType.js";
|
3
|
-
import getCachedLocaleDataInstance from "../getCachedLocaleDataInstance.js";
|
4
|
-
|
5
|
-
/**
|
6
|
-
* Convert month number to month name (text).
|
7
|
-
* If the numbers of the two months are the same you will get the name of the month,
|
8
|
-
* otherwise you will get the two names separated by a dash
|
9
|
-
*
|
10
|
-
* @param firstMonth CalendarDate Month
|
11
|
-
* @param lastMonth CalendarDate Month
|
12
|
-
* @param calendarType calendar type
|
13
|
-
* @returns {String}
|
14
|
-
*/
|
15
|
-
const convertMonthNumbersToMonthNames = (firstMonth: number, lastMonth: number, calendarType?: CalendarType) => {
|
16
|
-
const localeData = getCachedLocaleDataInstance(getLocale());
|
17
|
-
const pattern = localeData.getIntervalPattern("");
|
18
|
-
const secondaryMonthsNames = localeData.getMonthsStandAlone("abbreviated", calendarType) as Array<string>;
|
19
|
-
const secondaryMonthsNamesWide = localeData.getMonthsStandAlone("wide", calendarType) as Array<string>;
|
20
|
-
|
21
|
-
if (firstMonth === lastMonth) {
|
22
|
-
return {
|
23
|
-
text: localeData.getMonths("abbreviated", calendarType)[firstMonth],
|
24
|
-
textInfo: localeData.getMonths("wide", calendarType)[firstMonth],
|
25
|
-
};
|
26
|
-
}
|
27
|
-
|
28
|
-
return {
|
29
|
-
text: pattern.replace(/\{0\}/, secondaryMonthsNames[firstMonth]).replace(/\{1\}/, secondaryMonthsNames[lastMonth]),
|
30
|
-
textInfo: pattern.replace(/\{0\}/, secondaryMonthsNamesWide[firstMonth]).replace(/\{1\}/, secondaryMonthsNamesWide[lastMonth]),
|
31
|
-
};
|
32
|
-
};
|
33
|
-
|
34
|
-
export default convertMonthNumbersToMonthNames;
|
@@ -1,11 +0,0 @@
|
|
1
|
-
import CalendarDate from "./CalendarDate.js";
|
2
|
-
|
3
|
-
const getDaysInMonth = (date: CalendarDate) => {
|
4
|
-
const tempCalendarDate = new CalendarDate(date);
|
5
|
-
tempCalendarDate.setDate(1);
|
6
|
-
tempCalendarDate.setMonth(tempCalendarDate.getMonth() + 1);
|
7
|
-
tempCalendarDate.setDate(0);
|
8
|
-
return tempCalendarDate.getDate();
|
9
|
-
};
|
10
|
-
|
11
|
-
export default getDaysInMonth;
|
@@ -1,14 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* Returns a timestamp with only the year, month and day (with zero hours, minutes and seconds) and without 000 for milliseconds
|
3
|
-
* @param { number } millisecondsUTC
|
4
|
-
* @returns { number }
|
5
|
-
*/
|
6
|
-
const getRoundedTimestamp = (millisecondsUTC: number) => {
|
7
|
-
if (!millisecondsUTC) {
|
8
|
-
millisecondsUTC = new Date().getTime();
|
9
|
-
}
|
10
|
-
const rounded = millisecondsUTC - (millisecondsUTC % (24 * 60 * 60 * 1000));
|
11
|
-
return rounded / 1000;
|
12
|
-
};
|
13
|
-
|
14
|
-
export default getRoundedTimestamp;
|
@@ -1,10 +0,0 @@
|
|
1
|
-
import type CalendarType from "@ui5/webcomponents-base/dist/types/CalendarType.js";
|
2
|
-
import CalendarDate from "./CalendarDate.js";
|
3
|
-
|
4
|
-
/**
|
5
|
-
* Returns a UTC timestamp representing today
|
6
|
-
* @public
|
7
|
-
*/
|
8
|
-
const getTodayUTCTimestamp = (primaryCalendarType: CalendarType) => CalendarDate.fromLocalJSDate(new Date(), primaryCalendarType).valueOf() / 1000;
|
9
|
-
|
10
|
-
export default getTodayUTCTimestamp;
|
@@ -1,42 +0,0 @@
|
|
1
|
-
import CalendarDate from "./CalendarDate.js";
|
2
|
-
|
3
|
-
/**
|
4
|
-
* Adds or subtracts a given amount of days/months/years from a date.
|
5
|
-
* If minDate or maxDate are given, the result will be enforced within these limits
|
6
|
-
*
|
7
|
-
* @param date CalendarDate instance
|
8
|
-
* @param amount how many days/months/years to add (can be a negative number)
|
9
|
-
* @param unit what to modify: "day", "month" or "year"
|
10
|
-
* @param minDate minimum date to enforce
|
11
|
-
* @param maxDate maximum date to enforce
|
12
|
-
*/
|
13
|
-
const modifyDateBy = (date: CalendarDate, amount: number, unit: string, minDate?: CalendarDate, maxDate?: CalendarDate) => {
|
14
|
-
const newDate = new CalendarDate(date);
|
15
|
-
if (unit === "day") {
|
16
|
-
newDate.setDate(date.getDate() + amount);
|
17
|
-
} else if (unit === "month") {
|
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
|
-
} else {
|
25
|
-
newDate.setYear(date.getYear() + amount);
|
26
|
-
if (newDate.getMonth() !== date.getMonth()) { // f.e. 29th Feb to next/prev year
|
27
|
-
newDate.setDate(0); // Select the last day of the month
|
28
|
-
}
|
29
|
-
}
|
30
|
-
|
31
|
-
if (minDate && newDate.valueOf() < minDate.valueOf()) {
|
32
|
-
return new CalendarDate(minDate);
|
33
|
-
}
|
34
|
-
|
35
|
-
if (maxDate && newDate.valueOf() > maxDate.valueOf()) {
|
36
|
-
return new CalendarDate(maxDate);
|
37
|
-
}
|
38
|
-
|
39
|
-
return newDate;
|
40
|
-
};
|
41
|
-
|
42
|
-
export default modifyDateBy;
|
@@ -1,21 +0,0 @@
|
|
1
|
-
import type CalendarType from "@ui5/webcomponents-base/dist/types/CalendarType.js";
|
2
|
-
import CalendarDate from "./CalendarDate.js";
|
3
|
-
import getDaysInMonth from "./getDaysInMonth.js";
|
4
|
-
|
5
|
-
const transformDateToSecondaryType = (primaryCalendarType: CalendarType | undefined, secondaryCalendarType: CalendarType| undefined, timeStamp: number, hasYearPicker?: boolean) => {
|
6
|
-
let firstDate = CalendarDate.fromLocalJSDate(new Date(timeStamp * 1000), primaryCalendarType);
|
7
|
-
let lastDate = CalendarDate.fromLocalJSDate(new Date(timeStamp * 1000), primaryCalendarType);
|
8
|
-
firstDate.setDate(1);
|
9
|
-
|
10
|
-
if (hasYearPicker) {
|
11
|
-
firstDate.setMonth(0);
|
12
|
-
lastDate.setMonth(11);
|
13
|
-
}
|
14
|
-
|
15
|
-
lastDate.setDate(getDaysInMonth(lastDate));
|
16
|
-
firstDate = new CalendarDate(firstDate, secondaryCalendarType);
|
17
|
-
lastDate = new CalendarDate(lastDate, secondaryCalendarType);
|
18
|
-
return { firstDate, lastDate };
|
19
|
-
};
|
20
|
-
|
21
|
-
export default transformDateToSecondaryType;
|
@@ -1 +0,0 @@
|
|
1
|
-
import "../../sap/ui/core/date/Buddhist.js";
|
@@ -1 +0,0 @@
|
|
1
|
-
import "../../sap/ui/core/date/Gregorian.js";
|
@@ -1 +0,0 @@
|
|
1
|
-
import "../../sap/ui/core/date/Islamic.js";
|
@@ -1 +0,0 @@
|
|
1
|
-
import "../../sap/ui/core/date/Japanese.js";
|
@@ -1 +0,0 @@
|
|
1
|
-
import "../../sap/ui/core/date/Persian.js";
|
@@ -1,15 +0,0 @@
|
|
1
|
-
import type Locale from "@ui5/webcomponents-base/dist/locale/Locale.js";
|
2
|
-
import type LocaleT from "sap/ui/core/Locale";
|
3
|
-
import LocaleData from "./LocaleData.js";
|
4
|
-
|
5
|
-
const cache = new Map<Locale, LocaleData>();
|
6
|
-
|
7
|
-
const getCachedLocaleDataInstance = (locale: Locale) => {
|
8
|
-
if (!cache.has(locale)) {
|
9
|
-
cache.set(locale, new LocaleData(locale as unknown as LocaleT));
|
10
|
-
}
|
11
|
-
|
12
|
-
return cache.get(locale)!;
|
13
|
-
};
|
14
|
-
|
15
|
-
export default getCachedLocaleDataInstance;
|
@@ -1,28 +0,0 @@
|
|
1
|
-
import { fetchCldr } from "@ui5/webcomponents-base/dist/asset-registries/LocaleData.js";
|
2
|
-
import getLocale from "@ui5/webcomponents-base/dist/locale/getLocale.js";
|
3
|
-
import type LocaleT from "sap/ui/core/Locale";
|
4
|
-
import LocaleData from "../LocaleData.js";
|
5
|
-
|
6
|
-
const instances = new Map<string, LocaleData>();
|
7
|
-
|
8
|
-
/**
|
9
|
-
* Fetches and returns а LocaleData object for the required locale
|
10
|
-
* For more information on this object's API, please see:
|
11
|
-
* https://sdk.openui5.org/api/sap.ui.core.LocaleData
|
12
|
-
*
|
13
|
-
* @param { string } lang - if left empty, will use the configured/current locale
|
14
|
-
* @returns { Promise<LocaleData> }
|
15
|
-
*/
|
16
|
-
const getLocaleData = async (lang: string): Promise<LocaleData> => {
|
17
|
-
const locale = getLocale(lang);
|
18
|
-
const localeLang = locale.getLanguage();
|
19
|
-
|
20
|
-
if (!instances.has(localeLang)) {
|
21
|
-
await fetchCldr(locale.getLanguage(), locale.getRegion(), locale.getScript());
|
22
|
-
instances.set(localeLang, new LocaleData(locale as unknown as LocaleT));
|
23
|
-
}
|
24
|
-
|
25
|
-
return instances.get(localeLang)!;
|
26
|
-
};
|
27
|
-
|
28
|
-
export default getLocaleData;
|
@@ -1,17 +0,0 @@
|
|
1
|
-
import { getLocaleData } from "@ui5/webcomponents-base/dist/asset-registries/LocaleData.js";
|
2
|
-
|
3
|
-
const loadResource = (moduleName: string) => {
|
4
|
-
const moduleFormat = moduleName.match(/sap\/ui\/core\/cldr\/(\w+)\.json/);
|
5
|
-
if (!moduleFormat) {
|
6
|
-
throw new Error(`Unknown module "${moduleName}"`);
|
7
|
-
}
|
8
|
-
|
9
|
-
const localeId = moduleFormat[1];
|
10
|
-
return getLocaleData(localeId);
|
11
|
-
};
|
12
|
-
|
13
|
-
const LoaderExtensions = {
|
14
|
-
loadResource,
|
15
|
-
};
|
16
|
-
|
17
|
-
export default LoaderExtensions;
|
@@ -1,22 +0,0 @@
|
|
1
|
-
import { getLanguage } from "@ui5/webcomponents-base/dist/config/Language.js";
|
2
|
-
import { getCalendarType } from "@ui5/webcomponents-base/dist/config/CalendarType.js";
|
3
|
-
import getDesigntimePropertyAsArray from "@ui5/webcomponents-base/dist/util/getDesigntimePropertyAsArray.js";
|
4
|
-
// @ts-ignore
|
5
|
-
import TimezoneUtil from "./format/TimezoneUtil.js";
|
6
|
-
import FormatSettings from "./FormatSettings.js";
|
7
|
-
|
8
|
-
const emptyFn = () => {};
|
9
|
-
|
10
|
-
/**
|
11
|
-
* OpenUI5 Configuration Shim
|
12
|
-
*/
|
13
|
-
const Configuration = {
|
14
|
-
getLanguage,
|
15
|
-
getCalendarType,
|
16
|
-
getSupportedLanguages: () => getDesigntimePropertyAsArray("$core-i18n-locales:,ar,bg,ca,cs,da,de,el,en,es,et,fi,fr,hi,hr,hu,it,iw,ja,ko,lt,lv,nl,no,pl,pt,ro,ru,sh,sk,sl,sv,th,tr,uk,vi,zh_CN,zh_TW$"),
|
17
|
-
getOriginInfo: emptyFn,
|
18
|
-
getFormatSettings: () => FormatSettings,
|
19
|
-
getTimezone: () => TimezoneUtil.getLocalTimezone() as string,
|
20
|
-
};
|
21
|
-
|
22
|
-
export default Configuration;
|
package/src/sap/ui/core/Core.ts
DELETED
@@ -1,15 +0,0 @@
|
|
1
|
-
import FormatSettings from "./FormatSettings.js";
|
2
|
-
import Configuration from "./Configuration.js";
|
3
|
-
|
4
|
-
const emptyFn = () => {};
|
5
|
-
|
6
|
-
/**
|
7
|
-
* OpenUI5 Core shim
|
8
|
-
*/
|
9
|
-
const Core = {
|
10
|
-
getConfiguration: () => Configuration,
|
11
|
-
getLibraryResourceBundle: emptyFn(),
|
12
|
-
getFormatSettings: () => FormatSettings,
|
13
|
-
};
|
14
|
-
|
15
|
-
export default Core;
|
@@ -1,16 +0,0 @@
|
|
1
|
-
import getLocale from "@ui5/webcomponents-base/dist/locale/getLocale.js";
|
2
|
-
import { getLegacyDateCalendarCustomizing } from "@ui5/webcomponents-base/dist/config/FormatSettings.js";
|
3
|
-
|
4
|
-
const emptyFn = () => {};
|
5
|
-
|
6
|
-
/**
|
7
|
-
* OpenUI5 FormatSettings shim
|
8
|
-
*/
|
9
|
-
const FormatSettings = {
|
10
|
-
getFormatLocale: getLocale,
|
11
|
-
getLegacyDateFormat: emptyFn,
|
12
|
-
getCustomLocaleData: emptyFn,
|
13
|
-
getLegacyDateCalendarCustomizing,
|
14
|
-
};
|
15
|
-
|
16
|
-
export default FormatSettings;
|