@ui5/webcomponents-localization 1.13.1 → 1.14.0-rc.0

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.
Files changed (94) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/dist/DateFormat.d.ts +1 -1
  3. package/dist/LocaleData.d.ts +1 -1
  4. package/dist/dates/CalendarDate.d.ts +3 -3
  5. package/dist/dates/CalendarDate.js.map +1 -1
  6. package/dist/dates/ExtremeDates.d.ts +2 -2
  7. package/dist/dates/ExtremeDates.js.map +1 -1
  8. package/dist/dates/UI5Date.d.ts +1 -1
  9. package/dist/dates/UniversalDate.d.ts +1 -1
  10. package/dist/dates/UniversalDate.js.map +1 -1
  11. package/dist/dates/convertMonthNumbersToMonthNames.d.ts +1 -1
  12. package/dist/dates/convertMonthNumbersToMonthNames.js.map +1 -1
  13. package/dist/dates/getTodayUTCTimestamp.d.ts +1 -1
  14. package/dist/dates/getTodayUTCTimestamp.js.map +1 -1
  15. package/dist/dates/transformDateToSecondaryType.d.ts +1 -1
  16. package/dist/dates/transformDateToSecondaryType.js.map +1 -1
  17. package/dist/generated/assets/cldr/ar.json +522 -0
  18. package/dist/generated/assets/cldr/ar_EG.json +522 -0
  19. package/dist/generated/assets/cldr/ar_SA.json +522 -0
  20. package/dist/generated/assets/cldr/bg.json +492 -0
  21. package/dist/generated/assets/cldr/ca.json +522 -0
  22. package/dist/generated/assets/cldr/cs.json +522 -0
  23. package/dist/generated/assets/cldr/cy.json +462 -0
  24. package/dist/generated/assets/cldr/da.json +492 -0
  25. package/dist/generated/assets/cldr/de.json +522 -0
  26. package/dist/generated/assets/cldr/de_AT.json +522 -0
  27. package/dist/generated/assets/cldr/de_CH.json +522 -0
  28. package/dist/generated/assets/cldr/el.json +432 -0
  29. package/dist/generated/assets/cldr/el_CY.json +432 -0
  30. package/dist/generated/assets/cldr/en.json +492 -0
  31. package/dist/generated/assets/cldr/en_AU.json +492 -0
  32. package/dist/generated/assets/cldr/en_GB.json +492 -0
  33. package/dist/generated/assets/cldr/en_HK.json +492 -0
  34. package/dist/generated/assets/cldr/en_IE.json +492 -0
  35. package/dist/generated/assets/cldr/en_IN.json +492 -0
  36. package/dist/generated/assets/cldr/en_NZ.json +492 -0
  37. package/dist/generated/assets/cldr/en_PG.json +492 -0
  38. package/dist/generated/assets/cldr/en_SG.json +492 -0
  39. package/dist/generated/assets/cldr/en_ZA.json +492 -0
  40. package/dist/generated/assets/cldr/es.json +462 -0
  41. package/dist/generated/assets/cldr/es_AR.json +462 -0
  42. package/dist/generated/assets/cldr/es_BO.json +462 -0
  43. package/dist/generated/assets/cldr/es_CL.json +462 -0
  44. package/dist/generated/assets/cldr/es_CO.json +462 -0
  45. package/dist/generated/assets/cldr/es_MX.json +462 -0
  46. package/dist/generated/assets/cldr/es_PE.json +462 -0
  47. package/dist/generated/assets/cldr/es_UY.json +462 -0
  48. package/dist/generated/assets/cldr/es_VE.json +462 -0
  49. package/dist/generated/assets/cldr/et.json +492 -0
  50. package/dist/generated/assets/cldr/fa.json +492 -0
  51. package/dist/generated/assets/cldr/fi.json +522 -0
  52. package/dist/generated/assets/cldr/fr.json +492 -0
  53. package/dist/generated/assets/cldr/fr_BE.json +492 -0
  54. package/dist/generated/assets/cldr/fr_CA.json +492 -0
  55. package/dist/generated/assets/cldr/fr_CH.json +492 -0
  56. package/dist/generated/assets/cldr/fr_LU.json +492 -0
  57. package/dist/generated/assets/cldr/he.json +522 -0
  58. package/dist/generated/assets/cldr/hi.json +462 -0
  59. package/dist/generated/assets/cldr/hr.json +492 -0
  60. package/dist/generated/assets/cldr/hu.json +552 -0
  61. package/dist/generated/assets/cldr/id.json +492 -0
  62. package/dist/generated/assets/cldr/it.json +492 -0
  63. package/dist/generated/assets/cldr/it_CH.json +492 -0
  64. package/dist/generated/assets/cldr/ja.json +522 -0
  65. package/dist/generated/assets/cldr/kk.json +492 -0
  66. package/dist/generated/assets/cldr/ko.json +522 -0
  67. package/dist/generated/assets/cldr/lt.json +492 -0
  68. package/dist/generated/assets/cldr/lv.json +492 -0
  69. package/dist/generated/assets/cldr/ms.json +462 -0
  70. package/dist/generated/assets/cldr/nb.json +492 -0
  71. package/dist/generated/assets/cldr/nl.json +462 -0
  72. package/dist/generated/assets/cldr/nl_BE.json +462 -0
  73. package/dist/generated/assets/cldr/pl.json +522 -0
  74. package/dist/generated/assets/cldr/pt.json +492 -0
  75. package/dist/generated/assets/cldr/pt_PT.json +492 -0
  76. package/dist/generated/assets/cldr/ro.json +492 -0
  77. package/dist/generated/assets/cldr/ru.json +492 -0
  78. package/dist/generated/assets/cldr/ru_UA.json +492 -0
  79. package/dist/generated/assets/cldr/sk.json +522 -0
  80. package/dist/generated/assets/cldr/sl.json +522 -0
  81. package/dist/generated/assets/cldr/sr.json +492 -0
  82. package/dist/generated/assets/cldr/sr_Latn.json +492 -0
  83. package/dist/generated/assets/cldr/sv.json +492 -0
  84. package/dist/generated/assets/cldr/th.json +552 -0
  85. package/dist/generated/assets/cldr/tr.json +552 -0
  86. package/dist/generated/assets/cldr/uk.json +492 -0
  87. package/dist/generated/assets/cldr/vi.json +492 -0
  88. package/dist/generated/assets/cldr/zh_CN.json +522 -0
  89. package/dist/generated/assets/cldr/zh_HK.json +522 -0
  90. package/dist/generated/assets/cldr/zh_SG.json +522 -0
  91. package/dist/generated/assets/cldr/zh_TW.json +522 -0
  92. package/dist/sap/ui/core/FormatSettings.d.ts +2 -2
  93. package/package.json +4 -4
  94. package/tsconfig.json +1 -2
package/CHANGELOG.md CHANGED
@@ -3,6 +3,25 @@
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.14.0-rc.0](https://github.com/SAP/ui5-webcomponents/compare/v1.13.2...v1.14.0-rc.0) (2023-05-18)
7
+
8
+
9
+ ### Features
10
+
11
+ * **framework:** use `template literal notation` for enum types ([#6856](https://github.com/SAP/ui5-webcomponents/issues/6856)) ([0de21e8](https://github.com/SAP/ui5-webcomponents/commit/0de21e8ba37c6a75fd3d2a29a16cc82661619cb1)), closes [#6636](https://github.com/SAP/ui5-webcomponents/issues/6636)
12
+
13
+
14
+
15
+
16
+
17
+ ## [1.13.2](https://github.com/SAP/ui5-webcomponents/compare/v1.13.1...v1.13.2) (2023-05-15)
18
+
19
+ **Note:** Version bump only for package @ui5/webcomponents-localization
20
+
21
+
22
+
23
+
24
+
6
25
  ## [1.13.1](https://github.com/SAP/ui5-webcomponents/compare/v1.13.0-rc.5...v1.13.1) (2023-05-11)
7
26
 
8
27
  **Note:** Version bump only for package @ui5/webcomponents-localization
@@ -1,4 +1,4 @@
1
- /// <reference types="openui5" resolution-mode="require"/>
1
+ /// <reference types="openui5" />
2
2
  import type DateFormatT from "sap/ui/core/format/DateFormat";
3
3
  declare const DateFormatWrapped: typeof DateFormatT;
4
4
  declare class DateFormat extends DateFormatWrapped {
@@ -1,4 +1,4 @@
1
- /// <reference types="openui5" resolution-mode="require"/>
1
+ /// <reference types="openui5" />
2
2
  import type LocaleDataOpenUI5T from "sap/ui/core/LocaleData";
3
3
  declare const LocaleDataWrapped: typeof LocaleDataOpenUI5T;
4
4
  declare class LocaleData extends LocaleDataWrapped {
@@ -1,4 +1,4 @@
1
- /// <reference types="openui5" resolution-mode="require"/>
1
+ /// <reference types="openui5" />
2
2
  import type CalendarType from "@ui5/webcomponents-base/dist/types/CalendarType.js";
3
3
  import UI5Date from "./UI5Date.js";
4
4
  import UniversalDate from "./UniversalDate.js";
@@ -37,7 +37,7 @@ declare class CalendarDate {
37
37
  toUTCJSDate(): import("sap/ui/core/date/UI5Date").default | Date;
38
38
  toString(): string;
39
39
  valueOf(): number;
40
- static fromLocalJSDate(oJSDate: Date | UI5Date, sCalendarType?: CalendarType): CalendarDate;
41
- static fromTimestamp(iTimestamp: number, sCalendarType?: CalendarType): CalendarDate;
40
+ static fromLocalJSDate(oJSDate: Date | UI5Date, sCalendarType?: `${CalendarType}`): CalendarDate;
41
+ static fromTimestamp(iTimestamp: number, sCalendarType?: `${CalendarType}`): CalendarDate;
42
42
  }
43
43
  export default CalendarDate;
@@ -1 +1 @@
1
- {"version":3,"file":"CalendarDate.js","sourceRoot":"","sources":["../../src/dates/CalendarDate.ts"],"names":[],"mappings":"AACA,OAAO,OAAO,MAAM,cAAc,CAAC;AACnC,OAAO,aAAa,MAAM,oBAAoB,CAAC;AAE/C,MAAM,YAAY;IAGjB,YAAY,IAA4B,EAAE,KAAuB,EAAE,IAAa,EAAE,YAAqB;QACtG,IAAI,KAAK,GAAG,SAAS,EAAE,sBAAsB;QAC5C,OAAuB,EACvB,IAAoB,EACpB,aAA4B,CAAC;QAE9B,QAAQ,KAAK,CAAC,MAAM,EAAE;YACtB,KAAK,CAAC,EAAE,+BAA+B;gBACtC,IAAI,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC;gBAC7B,OAAQ,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,WAAW,EAAE,EAAE,IAAI,CAAC,QAAQ,EAAE,EAAE,IAAI,CAAC,OAAO,EAAE,CAAkB,CAAC;YAEhG,KAAK,CAAC,CAAC,CAAC,eAAe;YACvB,KAAK,CAAC,EAAE,8BAA8B;gBACrC,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,YAAY,YAAY,CAAC,EAAE;oBACxC,MAAM,IAAI,KAAK,CAAC,qEAAqE,CAAC,CAAC;iBACvF;gBACD,aAAa,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAE,KAAK,CAAC,CAAC,CAAC,CAAC,OAAyB,CAAC,aAAa,CAAC;gBACxF,4FAA4F;gBAC5F,yGAAyG;gBACzG,OAAO,GAAG,OAAO,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC;gBAElD,qDAAqD;gBACrD,OAAO,CAAC,WAAW,CAAC,OAAO,CAAC,cAAc,EAAE,E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./UI5Date.js\";\nimport UniversalDate from \"./UniversalDate.js\";\n\nclass CalendarDate {\n\t_oUDate!: UI5Date | 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: UI5Date | Date,\n\t\t\toNow: UI5Date | 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 = UI5Date.getInstance();\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 = UI5Date.getInstance(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 = UI5Date.getInstance(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 = UI5Date.getInstance(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 = UI5Date.getInstance(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 | UI5Date, 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 | UI5Date) {\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(UI5Date.getInstance(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: UI5Date | 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: UI5Date | Date) {\n\tconst oUTCDate = new Date(Date.UTC(0, 0, 1)); // no need to replace with UI5Date as we are creating a new UTC date object\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 CalendarDate;\n"]}
1
+ {"version":3,"file":"CalendarDate.js","sourceRoot":"","sources":["../../src/dates/CalendarDate.ts"],"names":[],"mappings":"AACA,OAAO,OAAO,MAAM,cAAc,CAAC;AACnC,OAAO,aAAa,MAAM,oBAAoB,CAAC;AAE/C,MAAM,YAAY;IAGjB,YAAY,IAA4B,EAAE,KAAuB,EAAE,IAAa,EAAE,YAAqB;QACtG,IAAI,KAAK,GAAG,SAAS,EAAE,sBAAsB;QAC5C,OAAuB,EACvB,IAAoB,EACpB,aAA4B,CAAC;QAE9B,QAAQ,KAAK,CAAC,MAAM,EAAE;YACtB,KAAK,CAAC,EAAE,+BAA+B;gBACtC,IAAI,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC;gBAC7B,OAAQ,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,WAA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EAA2E;IAEzH,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 UI5Date from \"./UI5Date.js\";\nimport UniversalDate from \"./UniversalDate.js\";\n\nclass CalendarDate {\n\t_oUDate!: UI5Date | 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: UI5Date | Date,\n\t\t\toNow: UI5Date | 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 = UI5Date.getInstance();\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 = UI5Date.getInstance(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 = UI5Date.getInstance(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 = UI5Date.getInstance(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 = UI5Date.getInstance(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 | UI5Date, 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 | UI5Date) {\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(UI5Date.getInstance(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: UI5Date | 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: UI5Date | Date) {\n\tconst oUTCDate = new Date(Date.UTC(0, 0, 1)); // no need to replace with UI5Date as we are creating a new UTC date object\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 CalendarDate;\n"]}
@@ -1,5 +1,5 @@
1
1
  import CalendarType from "@ui5/webcomponents-base/dist/types/CalendarType.js";
2
2
  import CalendarDate from "./CalendarDate.js";
3
- declare const getMinCalendarDate: (primaryCalendarType: CalendarType) => CalendarDate;
4
- declare const getMaxCalendarDate: (primaryCalendarType: CalendarType) => CalendarDate;
3
+ declare const getMinCalendarDate: (primaryCalendarType: `${CalendarType}`) => CalendarDate;
4
+ declare const getMaxCalendarDate: (primaryCalendarType: `${CalendarType}`) => CalendarDate;
5
5
  export { getMinCalendarDate, getMaxCalendarDate, };
@@ -1 +1 @@
1
- {"version":3,"file":"ExtremeDates.js","sourceRoot":"","sources":["../../src/dates/ExtremeDates.ts"],"names":[],"mappings":"AACA,OAAO,YAAY,MAAM,mBAAmB,CAAC;AAE7C,MAAM,KAAK,GAAG,IAAI,GAAG,EAAwB,CAAC;AAE9C,MAAM,kBAAkB,GAAG,CAAC,mBAAiC,EAAE,EAAE;IAChE,MAAM,GAAG,GAAG,OAAO,mBAAmB,EAAE,CAAC;IAEzC,IAAI,CAAC,KAAK,CAAC,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,CAAC,CAAC,CAAC;QACnB,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;QACpB,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;QACnB,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;KACxB;IAED,OAAO,KAAK,CAAC,GAAG,CAAC,GAAG,CAAE,CAAC;AACxB,CAAC,CAAC;AAEF,MAAM,kBAAkB,GAAG,CAAC,mBAAiC,EAAE,EAAE;IAChE,MAAM,GAAG,GAAG,OAAO,mBAAmB,EAAE,CAAC;IAEzC,IAAI,CAAC,KAAK,CAAC,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
+ {"version":3,"file":"ExtremeDates.js","sourceRoot":"","sources":["../../src/dates/ExtremeDates.ts"],"names":[],"mappings":"AACA,OAAO,YAAY,MAAM,mBAAmB,CAAC;AAE7C,MAAM,KAAK,GAAG,IAAI,GAAG,EAAwB,CAAC;AAE9C,MAAM,kBAAkB,GAAG,CAAC,mBAAsC,EAAE,EAAE;IACrE,MAAM,GAAG,GAAG,OAAO,mBAAmB,EAAE,CAAC;IAEzC,IAAI,CAAC,KAAK,CAAC,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,CAAC,CAAC,CAAC;QACnB,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;QACpB,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;QACnB,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;KACxB;IAED,OAAO,KAAK,CAAC,GAAG,CAAC,GAAG,CAAE,CAAC;AACxB,CAAC,CAAC;AAEF,MAAM,kBAAkB,GAAG,CAAC,mBAAsC,EAAE,EAAE;IACrE,MAAM,GAAG,GAAG,OAAO,mBAAmB,EAAE,CAAC;IAEzC,IAAI,CAAC,KAAK,CAAC,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,4 +1,4 @@
1
- /// <reference types="openui5" resolution-mode="require"/>
1
+ /// <reference types="openui5" />
2
2
  import type UIDateT from "sap/ui/core/date/UI5Date";
3
3
  declare const UI5DateWrapped: typeof UIDateT;
4
4
  declare class UI5Date extends UI5DateWrapped {
@@ -4,7 +4,7 @@ type UniversalDate = {
4
4
  new (time: number): UniversalDate;
5
5
  oDate: Date;
6
6
  sCalendarType: string;
7
- getInstance: (oDate: UI5Date | Date, sCalendarType?: CalendarType) => UniversalDate;
7
+ getInstance: (oDate: UI5Date | Date, sCalendarType?: `${CalendarType}`) => UniversalDate;
8
8
  getDate: () => number;
9
9
  getMonth: () => number;
10
10
  getFullYear: () => number;
@@ -1 +1 @@
1
- {"version":3,"file":"UniversalDate.js","sourceRoot":"","sources":["../../src/dates/UniversalDate.ts"],"names":[],"mappings":"AACA,aAAa;AACb,OAAO,mBAAmB,MAAM,sCAAsC,CAAC;AA+CvE,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\";\nimport type UI5Date from \"./UI5Date.js\";\n\ntype UniversalDate = {\n new (time: number): UniversalDate;\n oDate: Date,\n sCalendarType: string,\n getInstance: (oDate: UI5Date | 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
+ {"version":3,"file":"UniversalDate.js","sourceRoot":"","sources":["../../src/dates/UniversalDate.ts"],"names":[],"mappings":"AACA,aAAa;AACb,OAAO,mBAAmB,MAAM,sCAAsC,CAAC;AA+CvE,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\";\nimport type UI5Date from \"./UI5Date.js\";\n\ntype UniversalDate = {\n new (time: number): UniversalDate;\n oDate: Date,\n sCalendarType: string,\n getInstance: (oDate: UI5Date | 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"]}
@@ -9,7 +9,7 @@ import type CalendarType from "@ui5/webcomponents-base/dist/types/CalendarType.j
9
9
  * @param calendarType calendar type
10
10
  * @returns {String}
11
11
  */
12
- declare const convertMonthNumbersToMonthNames: (firstMonth: number, lastMonth: number, calendarType?: CalendarType) => {
12
+ declare const convertMonthNumbersToMonthNames: (firstMonth: number, lastMonth: number, calendarType?: `${CalendarType}`) => {
13
13
  text: any;
14
14
  textInfo: any;
15
15
  };
@@ -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;IAEvG,IAAI,UAAU,KAAK,SAAS,EAAE;QAC7B,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
+ {"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,YAAgC,EAAE,EAAE;IACnH,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;IAEvG,IAAI,UAAU,KAAK,SAAS,EAAE;QAC7B,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"]}
@@ -3,5 +3,5 @@ import type CalendarType from "@ui5/webcomponents-base/dist/types/CalendarType.j
3
3
  * Returns a UTC timestamp representing today
4
4
  * @public
5
5
  */
6
- declare const getTodayUTCTimestamp: (primaryCalendarType: CalendarType) => number;
6
+ declare const getTodayUTCTimestamp: (primaryCalendarType: `${CalendarType}`) => number;
7
7
  export default getTodayUTCTimestamp;
@@ -1 +1 @@
1
- {"version":3,"file":"getTodayUTCTimestamp.js","sourceRoot":"","sources":["../../src/dates/getTodayUTCTimestamp.ts"],"names":[],"mappings":"AACA,OAAO,YAAY,MAAM,mBAAmB,CAAC;AAC7C,OAAO,OAAO,MAAM,cAAc,CAAC;AAEnC;;;GAGG;AACH,MAAM,oBAAoB,GAAG,CAAC,mBAAiC,EAAE,EAAE,CAAC,YAAY,CAAC,eAAe,CAAC,OAAO,CAAC,WAAW,EAAE,EAAE,mBAAmB,CAAC,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC;AAE9J,eAAe,oBAAoB,CAAC","sourcesContent":["import type CalendarType from \"@ui5/webcomponents-base/dist/types/CalendarType.js\";\nimport CalendarDate from \"./CalendarDate.js\";\nimport UI5Date from \"./UI5Date.js\";\n\n/**\n * Returns a UTC timestamp representing today\n * @public\n */\nconst getTodayUTCTimestamp = (primaryCalendarType: CalendarType) => CalendarDate.fromLocalJSDate(UI5Date.getInstance(), primaryCalendarType).valueOf() / 1000;\n\nexport default getTodayUTCTimestamp;\n"]}
1
+ {"version":3,"file":"getTodayUTCTimestamp.js","sourceRoot":"","sources":["../../src/dates/getTodayUTCTimestamp.ts"],"names":[],"mappings":"AACA,OAAO,YAAY,MAAM,mBAAmB,CAAC;AAC7C,OAAO,OAAO,MAAM,cAAc,CAAC;AAEnC;;;GAGG;AACH,MAAM,oBAAoB,GAAG,CAAC,mBAAsC,EAAE,EAAE,CAAC,YAAY,CAAC,eAAe,CAAC,OAAO,CAAC,WAAW,EAAE,EAAE,mBAAmB,CAAC,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC;AAEnK,eAAe,oBAAoB,CAAC","sourcesContent":["import type CalendarType from \"@ui5/webcomponents-base/dist/types/CalendarType.js\";\nimport CalendarDate from \"./CalendarDate.js\";\nimport UI5Date from \"./UI5Date.js\";\n\n/**\n * Returns a UTC timestamp representing today\n * @public\n */\nconst getTodayUTCTimestamp = (primaryCalendarType: `${CalendarType}`) => CalendarDate.fromLocalJSDate(UI5Date.getInstance(), primaryCalendarType).valueOf() / 1000;\n\nexport default getTodayUTCTimestamp;\n"]}
@@ -1,6 +1,6 @@
1
1
  import type CalendarType from "@ui5/webcomponents-base/dist/types/CalendarType.js";
2
2
  import CalendarDate from "./CalendarDate.js";
3
- declare const transformDateToSecondaryType: (primaryCalendarType: CalendarType | undefined, secondaryCalendarType: CalendarType | undefined, timeStamp: number, hasYearPicker?: boolean) => {
3
+ declare const transformDateToSecondaryType: (primaryCalendarType: `${CalendarType}` | undefined, secondaryCalendarType: `${CalendarType}` | undefined, timeStamp: number, hasYearPicker?: boolean) => {
4
4
  firstDate: CalendarDate;
5
5
  lastDate: CalendarDate;
6
6
  };
@@ -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;AACjD,OAAO,OAAO,MAAM,cAAc,CAAC;AAEnC,MAAM,4BAA4B,GAAG,CAAC,mBAA6C,EAAE,qBAA8C,EAAE,SAAiB,EAAE,aAAuB,EAAE,EAAE;IAClL,IAAI,SAAS,GAAG,YAAY,CAAC,eAAe,CAAC,OAAO,CAAC,WAAW,CAAC,SAAS,GAAG,IAAI,CAAC,EAAE,mBAAmB,CAAC,CAAC;IACzG,IAAI,QAAQ,GAAG,YAAY,CAAC,eAAe,CAAC,OAAO,CAAC,WAAW,CAAC,SAAS,GAAG,IAAI,CAAC,EAAE,mBAAmB,CAAC,CAAC;IACxG,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\";\nimport UI5Date from \"./UI5Date.js\";\n\nconst transformDateToSecondaryType = (primaryCalendarType: CalendarType | undefined, secondaryCalendarType: CalendarType| undefined, timeStamp: number, hasYearPicker?: boolean) => {\n\tlet firstDate = CalendarDate.fromLocalJSDate(UI5Date.getInstance(timeStamp * 1000), primaryCalendarType);\n\tlet lastDate = CalendarDate.fromLocalJSDate(UI5Date.getInstance(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
+ {"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;AACjD,OAAO,OAAO,MAAM,cAAc,CAAC;AAEnC,MAAM,4BAA4B,GAAG,CAAC,mBAAkD,EAAE,qBAAmD,EAAE,SAAiB,EAAE,aAAuB,EAAE,EAAE;IAC5L,IAAI,SAAS,GAAG,YAAY,CAAC,eAAe,CAAC,OAAO,CAAC,WAAW,CAAC,SAAS,GAAG,IAAI,CAAC,EAAE,mBAAmB,CAAC,CAAC;IACzG,IAAI,QAAQ,GAAG,YAAY,CAAC,eAAe,CAAC,OAAO,CAAC,WAAW,CAAC,SAAS,GAAG,IAAI,CAAC,EAAE,mBAAmB,CAAC,CAAC;IACxG,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\";\nimport UI5Date from \"./UI5Date.js\";\n\nconst transformDateToSecondaryType = (primaryCalendarType: `${CalendarType}` | undefined, secondaryCalendarType: `${CalendarType}`| undefined, timeStamp: number, hasYearPicker?: boolean) => {\n\tlet firstDate = CalendarDate.fromLocalJSDate(UI5Date.getInstance(timeStamp * 1000), primaryCalendarType);\n\tlet lastDate = CalendarDate.fromLocalJSDate(UI5Date.getInstance(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"]}