@ui5/webcomponents-localization 0.0.0-998083e44 → 0.0.0-99b763015

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 (184) hide show
  1. package/.eslintrc.js +3 -0
  2. package/CHANGELOG.md +170 -0
  3. package/{src/Assets-static.js → dist/Assets-static.d.ts} +0 -1
  4. package/dist/Assets-static.js +1 -0
  5. package/dist/Assets-static.js.map +1 -0
  6. package/dist/Assets.d.ts +1 -0
  7. package/dist/Assets.js +1 -0
  8. package/dist/Assets.js.map +1 -0
  9. package/dist/DateFormat.d.ts +6 -0
  10. package/dist/DateFormat.js +6 -2
  11. package/dist/DateFormat.js.map +1 -0
  12. package/dist/LocaleData.d.ts +6 -0
  13. package/dist/LocaleData.js +6 -2
  14. package/dist/LocaleData.js.map +1 -0
  15. package/dist/dates/CalendarDate.d.ts +41 -0
  16. package/dist/dates/CalendarDate.js +170 -207
  17. package/dist/dates/CalendarDate.js.map +1 -0
  18. package/dist/dates/ExtremeDates.d.ts +5 -0
  19. package/dist/dates/ExtremeDates.js +25 -35
  20. package/dist/dates/ExtremeDates.js.map +1 -0
  21. package/dist/dates/UniversalDate.d.ts +46 -0
  22. package/dist/dates/UniversalDate.js +5 -0
  23. package/dist/dates/UniversalDate.js.map +1 -0
  24. package/dist/dates/calculateWeekNumber.d.ts +4 -0
  25. package/dist/dates/calculateWeekNumber.js +42 -48
  26. package/dist/dates/calculateWeekNumber.js.map +1 -0
  27. package/dist/dates/convertMonthNumbersToMonthNames.d.ts +16 -0
  28. package/dist/dates/convertMonthNumbersToMonthNames.js +15 -18
  29. package/dist/dates/convertMonthNumbersToMonthNames.js.map +1 -0
  30. package/dist/dates/getDaysInMonth.d.ts +3 -0
  31. package/dist/dates/getDaysInMonth.js +7 -8
  32. package/dist/dates/getDaysInMonth.js.map +1 -0
  33. package/dist/dates/getRoundedTimestamp.d.ts +7 -0
  34. package/dist/dates/getRoundedTimestamp.js +9 -9
  35. package/dist/dates/getRoundedTimestamp.js.map +1 -0
  36. package/dist/dates/getTodayUTCTimestamp.d.ts +7 -0
  37. package/dist/dates/getTodayUTCTimestamp.js +2 -3
  38. package/dist/dates/getTodayUTCTimestamp.js.map +1 -0
  39. package/dist/dates/modifyDateBy.d.ts +13 -0
  40. package/dist/dates/modifyDateBy.js +27 -29
  41. package/dist/dates/modifyDateBy.js.map +1 -0
  42. package/dist/dates/transformDateToSecondaryType.d.ts +7 -0
  43. package/dist/dates/transformDateToSecondaryType.js +12 -15
  44. package/dist/dates/transformDateToSecondaryType.js.map +1 -0
  45. package/dist/features/calendar/Buddhist.js +1 -0
  46. package/dist/features/calendar/Buddhist.js.map +1 -0
  47. package/dist/features/calendar/Gregorian.js +1 -0
  48. package/dist/features/calendar/Gregorian.js.map +1 -0
  49. package/dist/features/calendar/Islamic.js +1 -0
  50. package/dist/features/calendar/Islamic.js.map +1 -0
  51. package/dist/features/calendar/Japanese.js +1 -0
  52. package/dist/features/calendar/Japanese.js.map +1 -0
  53. package/dist/features/calendar/Persian.js +1 -0
  54. package/dist/features/calendar/Persian.js.map +1 -0
  55. package/dist/generated/assets/cldr/ar.json +2804 -5906
  56. package/dist/generated/assets/cldr/ar_EG.json +2804 -5906
  57. package/dist/generated/assets/cldr/ar_SA.json +2804 -5906
  58. package/dist/generated/assets/cldr/bg.json +2727 -4979
  59. package/dist/generated/assets/cldr/ca.json +2670 -4996
  60. package/dist/generated/assets/cldr/cs.json +2710 -5498
  61. package/dist/generated/assets/cldr/cy.json +2791 -5884
  62. package/dist/generated/assets/cldr/da.json +2591 -4888
  63. package/dist/generated/assets/cldr/de.json +2608 -4916
  64. package/dist/generated/assets/cldr/de_AT.json +2608 -4917
  65. package/dist/generated/assets/cldr/de_CH.json +2608 -4915
  66. package/dist/generated/assets/cldr/el.json +2589 -4883
  67. package/dist/generated/assets/cldr/el_CY.json +2589 -4883
  68. package/dist/generated/assets/cldr/en.json +2577 -4971
  69. package/dist/generated/assets/cldr/en_AU.json +2586 -4962
  70. package/dist/generated/assets/cldr/en_GB.json +2578 -4971
  71. package/dist/generated/assets/cldr/en_HK.json +2584 -4977
  72. package/dist/generated/assets/cldr/en_IE.json +2578 -4971
  73. package/dist/generated/assets/cldr/en_IN.json +2579 -4972
  74. package/dist/generated/assets/cldr/en_NZ.json +2578 -4971
  75. package/dist/generated/assets/cldr/en_PG.json +2578 -4972
  76. package/dist/generated/assets/cldr/en_SG.json +2579 -4973
  77. package/dist/generated/assets/cldr/en_ZA.json +2578 -4972
  78. package/dist/generated/assets/cldr/es.json +2633 -4912
  79. package/dist/generated/assets/cldr/es_AR.json +2638 -4914
  80. package/dist/generated/assets/cldr/es_BO.json +2638 -4913
  81. package/dist/generated/assets/cldr/es_CL.json +2638 -4914
  82. package/dist/generated/assets/cldr/es_CO.json +2637 -4913
  83. package/dist/generated/assets/cldr/es_MX.json +2638 -4915
  84. package/dist/generated/assets/cldr/es_PE.json +2638 -4913
  85. package/dist/generated/assets/cldr/es_UY.json +2638 -4915
  86. package/dist/generated/assets/cldr/es_VE.json +2638 -4914
  87. package/dist/generated/assets/cldr/et.json +2593 -4967
  88. package/dist/generated/assets/cldr/fa.json +2606 -4883
  89. package/dist/generated/assets/cldr/fi.json +2635 -5008
  90. package/dist/generated/assets/cldr/fr.json +2583 -4979
  91. package/dist/generated/assets/cldr/fr_BE.json +2583 -4979
  92. package/dist/generated/assets/cldr/fr_CA.json +2598 -4973
  93. package/dist/generated/assets/cldr/fr_CH.json +2600 -4997
  94. package/dist/generated/assets/cldr/fr_LU.json +2583 -4979
  95. package/dist/generated/assets/cldr/he.json +2699 -5378
  96. package/dist/generated/assets/cldr/hi.json +2593 -4829
  97. package/dist/generated/assets/cldr/hr.json +2646 -4919
  98. package/dist/generated/assets/cldr/hu.json +2592 -4856
  99. package/dist/generated/assets/cldr/id.json +2538 -4658
  100. package/dist/generated/assets/cldr/it.json +2583 -4950
  101. package/dist/generated/assets/cldr/it_CH.json +2583 -4950
  102. package/dist/generated/assets/cldr/ja.json +2655 -4830
  103. package/dist/generated/assets/cldr/kk.json +2583 -4725
  104. package/dist/generated/assets/cldr/ko.json +2632 -4738
  105. package/dist/generated/assets/cldr/lt.json +2714 -5481
  106. package/dist/generated/assets/cldr/lv.json +2638 -5112
  107. package/dist/generated/assets/cldr/ms.json +2532 -4515
  108. package/dist/generated/assets/cldr/nb.json +2615 -4977
  109. package/dist/generated/assets/cldr/nl.json +2595 -4884
  110. package/dist/generated/assets/cldr/nl_BE.json +2595 -4884
  111. package/dist/generated/assets/cldr/pl.json +2717 -5176
  112. package/dist/generated/assets/cldr/pt.json +2600 -4805
  113. package/dist/generated/assets/cldr/pt_PT.json +2651 -4940
  114. package/dist/generated/assets/cldr/ro.json +2639 -5090
  115. package/dist/generated/assets/cldr/ru.json +2698 -5407
  116. package/dist/generated/assets/cldr/ru_UA.json +2698 -5407
  117. package/dist/generated/assets/cldr/sk.json +2720 -5370
  118. package/dist/generated/assets/cldr/sl.json +2682 -5340
  119. package/dist/generated/assets/cldr/sr.json +2657 -5126
  120. package/dist/generated/assets/cldr/sr_Latn.json +2658 -5127
  121. package/dist/generated/assets/cldr/sv.json +2625 -5011
  122. package/dist/generated/assets/cldr/th.json +2626 -4797
  123. package/dist/generated/assets/cldr/tr.json +2606 -4979
  124. package/dist/generated/assets/cldr/uk.json +2678 -5353
  125. package/dist/generated/assets/cldr/vi.json +2549 -4673
  126. package/dist/generated/assets/cldr/zh_CN.json +2541 -4632
  127. package/dist/generated/assets/cldr/zh_HK.json +2549 -4640
  128. package/dist/generated/assets/cldr/zh_SG.json +2548 -4640
  129. package/dist/generated/assets/cldr/zh_TW.json +2556 -4728
  130. package/dist/getCachedLocaleDataInstance.d.ts +4 -0
  131. package/dist/getCachedLocaleDataInstance.js +6 -9
  132. package/dist/getCachedLocaleDataInstance.js.map +1 -0
  133. package/dist/locale/getLocaleData.d.ts +11 -0
  134. package/dist/locale/getLocaleData.js +13 -17
  135. package/dist/locale/getLocaleData.js.map +1 -0
  136. package/dist/sap/base/Log.js +28 -29
  137. package/dist/sap/base/assert.js +5 -6
  138. package/dist/sap/base/util/LoaderExtensions.d.ts +4 -0
  139. package/dist/sap/base/util/LoaderExtensions.js +9 -12
  140. package/dist/sap/base/util/LoaderExtensions.js.map +1 -0
  141. package/dist/sap/ui/core/Configuration.d.ts +17 -0
  142. package/dist/sap/ui/core/Configuration.js +20 -0
  143. package/dist/sap/ui/core/Configuration.js.map +1 -0
  144. package/dist/sap/ui/core/Core.d.ts +26 -0
  145. package/dist/sap/ui/core/Core.js +7 -34
  146. package/dist/sap/ui/core/Core.js.map +1 -0
  147. package/dist/sap/ui/core/FormatSettings.d.ts +10 -0
  148. package/dist/sap/ui/core/FormatSettings.js +14 -0
  149. package/dist/sap/ui/core/FormatSettings.js.map +1 -0
  150. package/dist/sap/ui/core/Locale.js +3 -0
  151. package/dist/sap/ui/core/LocaleData.js +78 -3
  152. package/dist/sap/ui/core/date/Buddhist.js +0 -6
  153. package/dist/sap/ui/core/date/CalendarUtils.js +36 -0
  154. package/dist/sap/ui/core/date/CalendarWeekNumbering.js +7 -0
  155. package/dist/sap/ui/core/date/Islamic.js +3 -3
  156. package/dist/sap/ui/core/date/Japanese.js +4 -4
  157. package/dist/sap/ui/core/date/UniversalDate.js +73 -22
  158. package/dist/sap/ui/core/format/DateFormat.js +157 -57
  159. package/dist/sap/ui/core/format/TimezoneUtil.js +12 -1
  160. package/package-scripts.js +7 -4
  161. package/package.json +6 -5
  162. package/tsconfig.json +14 -0
  163. package/used-modules.txt +3 -1
  164. package/src/Assets.js +0 -2
  165. package/src/DateFormat.js +0 -3
  166. package/src/LocaleData.js +0 -3
  167. package/src/dates/CalendarDate.js +0 -229
  168. package/src/dates/ExtremeDates.js +0 -39
  169. package/src/dates/calculateWeekNumber.js +0 -51
  170. package/src/dates/convertMonthNumbersToMonthNames.js +0 -33
  171. package/src/dates/getDaysInMonth.js +0 -11
  172. package/src/dates/getRoundedTimestamp.js +0 -14
  173. package/src/dates/getTodayUTCTimestamp.js +0 -9
  174. package/src/dates/modifyDateBy.js +0 -42
  175. package/src/dates/transformDateToSecondaryType.js +0 -20
  176. package/src/getCachedLocaleDataInstance.js +0 -13
  177. package/src/locale/getLocaleData.js +0 -27
  178. package/src/sap/base/util/LoaderExtensions.js +0 -17
  179. package/src/sap/ui/core/Core.js +0 -40
  180. /package/{src/features/calendar/Buddhist.js → dist/features/calendar/Buddhist.d.ts} +0 -0
  181. /package/{src/features/calendar/Gregorian.js → dist/features/calendar/Gregorian.d.ts} +0 -0
  182. /package/{src/features/calendar/Islamic.js → dist/features/calendar/Islamic.d.ts} +0 -0
  183. /package/{src/features/calendar/Japanese.js → dist/features/calendar/Japanese.d.ts} +0 -0
  184. /package/{src/features/calendar/Persian.js → dist/features/calendar/Persian.d.ts} +0 -0
@@ -0,0 +1,4 @@
1
+ import type Locale from "@ui5/webcomponents-base/dist/locale/Locale.js";
2
+ import LocaleData from "./LocaleData.js";
3
+ declare const getCachedLocaleDataInstance: (locale: Locale) => LocaleData;
4
+ export default getCachedLocaleDataInstance;
@@ -1,13 +1,10 @@
1
1
  import LocaleData from "./LocaleData.js";
2
-
3
2
  const cache = new Map();
4
-
5
- const getCachedLocaleDataInstance = locale => {
6
- if (!cache.has(locale)) {
7
- cache.set(locale, LocaleData.getInstance(locale));
8
- }
9
-
10
- return cache.get(locale);
3
+ const getCachedLocaleDataInstance = (locale) => {
4
+ if (!cache.has(locale)) {
5
+ cache.set(locale, new LocaleData(locale));
6
+ }
7
+ return cache.get(locale);
11
8
  };
12
-
13
9
  export default getCachedLocaleDataInstance;
10
+ //# sourceMappingURL=getCachedLocaleDataInstance.js.map
@@ -0,0 +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","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"]}
@@ -0,0 +1,11 @@
1
+ import LocaleData from "../LocaleData.js";
2
+ /**
3
+ * Fetches and returns а LocaleData object for the required locale
4
+ * For more information on this object's API, please see:
5
+ * https://sdk.openui5.org/api/sap.ui.core.LocaleData
6
+ *
7
+ * @param { string } lang - if left empty, will use the configured/current locale
8
+ * @returns { Promise<LocaleData> }
9
+ */
10
+ declare const getLocaleData: (lang: string) => Promise<LocaleData>;
11
+ export default getLocaleData;
@@ -1,27 +1,23 @@
1
1
  import { fetchCldr } from "@ui5/webcomponents-base/dist/asset-registries/LocaleData.js";
2
2
  import getLocale from "@ui5/webcomponents-base/dist/locale/getLocale.js";
3
- import LocaleData from "../sap/ui/core/LocaleData.js";
4
-
3
+ import LocaleData from "../LocaleData.js";
5
4
  const instances = new Map();
6
-
7
5
  /**
8
6
  * Fetches and returns а LocaleData object for the required locale
9
7
  * For more information on this object's API, please see:
10
- * https://ui5.sap.com/#/api/sap.ui.core.LocaleData
8
+ * https://sdk.openui5.org/api/sap.ui.core.LocaleData
11
9
  *
12
- * @param lang - if left empty, will use the configured/current locale
13
- * @returns {LocaleData}
10
+ * @param { string } lang - if left empty, will use the configured/current locale
11
+ * @returns { Promise<LocaleData> }
14
12
  */
15
- const getLocaleData = async lang => {
16
- const locale = getLocale(lang);
17
- const localeLang = locale.getLanguage();
18
-
19
- if (!instances.has(localeLang)) {
20
- await fetchCldr(locale.getLanguage(), locale.getRegion(), locale.getScript());
21
- instances.set(localeLang, LocaleData.getInstance(locale));
22
- }
23
-
24
- return instances.get(localeLang);
13
+ const getLocaleData = async (lang) => {
14
+ const locale = getLocale(lang);
15
+ const localeLang = locale.getLanguage();
16
+ if (!instances.has(localeLang)) {
17
+ await fetchCldr(locale.getLanguage(), locale.getRegion(), locale.getScript());
18
+ instances.set(localeLang, new LocaleData(locale));
19
+ }
20
+ return instances.get(localeLang);
25
21
  };
26
-
27
22
  export default getLocaleData;
23
+ //# sourceMappingURL=getLocaleData.js.map
@@ -0,0 +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","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"]}
@@ -10,7 +10,7 @@ Log.Level = {
10
10
  TRACE: 5,
11
11
  ALL: 5 + 1
12
12
  };
13
- var sDefaultComponent, aLog = [], mMaxLevel = { '': Log.Level.ERROR }, iLogEntriesLimit = 3000, oListener = null, bLogSupportInfo = false;
13
+ var aLog = [], mMaxLevel = { '': Log.Level.ERROR }, iLogEntriesLimit = 3000, oListener = null, bLogSupportInfo = false;
14
14
  function pad0(i, w) {
15
15
  return ('000' + String(i)).slice(-w);
16
16
  }
@@ -72,26 +72,26 @@ function getLogEntryListenerInstance() {
72
72
  }
73
73
  return oListener;
74
74
  }
75
- Log.fatal = function (sMessage, sDetails, sComponent, fnSupportInfo) {
76
- log(Log.Level.FATAL, sMessage, sDetails, sComponent, fnSupportInfo);
75
+ Log.fatal = function (sMessage, vDetails, sComponent, fnSupportInfo) {
76
+ log(Log.Level.FATAL, sMessage, vDetails, sComponent, fnSupportInfo);
77
77
  };
78
- Log.error = function (sMessage, sDetails, sComponent, fnSupportInfo) {
79
- log(Log.Level.ERROR, sMessage, sDetails, sComponent, fnSupportInfo);
78
+ Log.error = function (sMessage, vDetails, sComponent, fnSupportInfo) {
79
+ log(Log.Level.ERROR, sMessage, vDetails, sComponent, fnSupportInfo);
80
80
  };
81
- Log.warning = function (sMessage, sDetails, sComponent, fnSupportInfo) {
82
- log(Log.Level.WARNING, sMessage, sDetails, sComponent, fnSupportInfo);
81
+ Log.warning = function (sMessage, vDetails, sComponent, fnSupportInfo) {
82
+ log(Log.Level.WARNING, sMessage, vDetails, sComponent, fnSupportInfo);
83
83
  };
84
- Log.info = function (sMessage, sDetails, sComponent, fnSupportInfo) {
85
- log(Log.Level.INFO, sMessage, sDetails, sComponent, fnSupportInfo);
84
+ Log.info = function (sMessage, vDetails, sComponent, fnSupportInfo) {
85
+ log(Log.Level.INFO, sMessage, vDetails, sComponent, fnSupportInfo);
86
86
  };
87
- Log.debug = function (sMessage, sDetails, sComponent, fnSupportInfo) {
88
- log(Log.Level.DEBUG, sMessage, sDetails, sComponent, fnSupportInfo);
87
+ Log.debug = function (sMessage, vDetails, sComponent, fnSupportInfo) {
88
+ log(Log.Level.DEBUG, sMessage, vDetails, sComponent, fnSupportInfo);
89
89
  };
90
- Log.trace = function (sMessage, sDetails, sComponent, fnSupportInfo) {
91
- log(Log.Level.TRACE, sMessage, sDetails, sComponent, fnSupportInfo);
90
+ Log.trace = function (sMessage, vDetails, sComponent, fnSupportInfo) {
91
+ log(Log.Level.TRACE, sMessage, vDetails, sComponent, fnSupportInfo);
92
92
  };
93
93
  Log.setLevel = function (iLogLevel, sComponent, _bDefault) {
94
- sComponent = sComponent || sDefaultComponent || '';
94
+ sComponent = sComponent || '';
95
95
  if (!_bDefault || mMaxLevel[sComponent] == null) {
96
96
  mMaxLevel[sComponent] = iLogLevel;
97
97
  var sLogLevel;
@@ -104,24 +104,23 @@ Log.setLevel = function (iLogLevel, sComponent, _bDefault) {
104
104
  }
105
105
  };
106
106
  Log.getLevel = function (sComponent) {
107
- return level(sComponent || sDefaultComponent);
107
+ return level(sComponent);
108
108
  };
109
109
  Log.isLoggable = function (iLevel, sComponent) {
110
- return (iLevel == null ? Log.Level.DEBUG : iLevel) <= level(sComponent || sDefaultComponent);
110
+ return (iLevel == null ? Log.Level.DEBUG : iLevel) <= level(sComponent);
111
111
  };
112
112
  Log.logSupportInfo = function (bEnabled) {
113
113
  bLogSupportInfo = bEnabled;
114
114
  };
115
- function log(iLevel, sMessage, sDetails, sComponent, fnSupportInfo) {
116
- if (!fnSupportInfo && !sComponent && typeof sDetails === 'function') {
117
- fnSupportInfo = sDetails;
118
- sDetails = '';
115
+ function log(iLevel, sMessage, vDetails, sComponent, fnSupportInfo) {
116
+ if (!fnSupportInfo && !sComponent && typeof vDetails === 'function') {
117
+ fnSupportInfo = vDetails;
118
+ vDetails = '';
119
119
  }
120
120
  if (!fnSupportInfo && typeof sComponent === 'function') {
121
121
  fnSupportInfo = sComponent;
122
122
  sComponent = '';
123
123
  }
124
- sComponent = sComponent || sDefaultComponent;
125
124
  if (iLevel <= level(sComponent)) {
126
125
  var fNow = now(), oNow = new Date(fNow), iMicroSeconds = Math.floor((fNow - Math.floor(fNow)) * 1000), oLogEntry = {
127
126
  time: pad0(oNow.getHours(), 2) + ':' + pad0(oNow.getMinutes(), 2) + ':' + pad0(oNow.getSeconds(), 2) + '.' + pad0(oNow.getMilliseconds(), 3) + pad0(iMicroSeconds, 3),
@@ -129,7 +128,7 @@ function log(iLevel, sMessage, sDetails, sComponent, fnSupportInfo) {
129
128
  timestamp: fNow,
130
129
  level: iLevel,
131
130
  message: String(sMessage || ''),
132
- details: String(sDetails || ''),
131
+ details: String(vDetails || ''),
133
132
  component: String(sComponent || '')
134
133
  };
135
134
  if (bLogSupportInfo && typeof fnSupportInfo === 'function') {
@@ -145,27 +144,27 @@ function log(iLevel, sMessage, sDetails, sComponent, fnSupportInfo) {
145
144
  oListener.onLogEntry(oLogEntry);
146
145
  }
147
146
  if (console) {
148
- var isDetailsError = sDetails instanceof Error, logText = oLogEntry.date + ' ' + oLogEntry.time + ' ' + oLogEntry.message + ' - ' + oLogEntry.details + ' ' + oLogEntry.component;
147
+ var isDetailsError = vDetails instanceof Error, logText = oLogEntry.date + ' ' + oLogEntry.time + ' ' + oLogEntry.message + ' - ' + oLogEntry.details + ' ' + oLogEntry.component;
149
148
  switch (iLevel) {
150
149
  case Log.Level.FATAL:
151
150
  case Log.Level.ERROR:
152
- isDetailsError ? console.error(logText, '\n', sDetails) : console.error(logText);
151
+ isDetailsError ? console.error(logText, '\n', vDetails) : console.error(logText);
153
152
  break;
154
153
  case Log.Level.WARNING:
155
- isDetailsError ? console.warn(logText, '\n', sDetails) : console.warn(logText);
154
+ isDetailsError ? console.warn(logText, '\n', vDetails) : console.warn(logText);
156
155
  break;
157
156
  case Log.Level.INFO:
158
157
  if (console.info) {
159
- isDetailsError ? console.info(logText, '\n', sDetails) : console.info(logText);
158
+ isDetailsError ? console.info(logText, '\n', vDetails) : console.info(logText);
160
159
  } else {
161
- isDetailsError ? console.log(logText, '\n', sDetails) : console.log(logText);
160
+ isDetailsError ? console.log(logText, '\n', vDetails) : console.log(logText);
162
161
  }
163
162
  break;
164
163
  case Log.Level.DEBUG:
165
- isDetailsError ? console.debug(logText, '\n', sDetails) : console.debug(logText);
164
+ isDetailsError ? console.debug(logText, '\n', vDetails) : console.debug(logText);
166
165
  break;
167
166
  case Log.Level.TRACE:
168
- isDetailsError ? console.trace(logText, '\n', sDetails) : console.trace(logText);
167
+ isDetailsError ? console.trace(logText, '\n', vDetails) : console.trace(logText);
169
168
  break;
170
169
  }
171
170
  if (console.info && oLogEntry.supportInfo) {
@@ -1,8 +1,7 @@
1
- import Log from './Log.js';
2
1
  var fnAssert = function (bResult, vMessage) {
3
- if (!bResult) {
4
- var sMessage = typeof vMessage === 'function' ? vMessage() : vMessage;
5
- console.assert(bResult, sMessage);
6
- }
2
+ if (!bResult) {
3
+ var sMessage = typeof vMessage === "function" ? vMessage() : vMessage;
4
+ console.assert(bResult, sMessage);
5
+ }
7
6
  };
8
- export default fnAssert;
7
+ export default fnAssert;
@@ -0,0 +1,4 @@
1
+ declare const LoaderExtensions: {
2
+ loadResource: (moduleName: string) => import("@ui5/webcomponents-base/dist/asset-registries/LocaleData.js").CLDRData;
3
+ };
4
+ export default LoaderExtensions;
@@ -1,17 +1,14 @@
1
1
  import { getLocaleData } from "@ui5/webcomponents-base/dist/asset-registries/LocaleData.js";
2
-
3
- const loadResource = moduleName => {
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);
2
+ const loadResource = (moduleName) => {
3
+ const moduleFormat = moduleName.match(/sap\/ui\/core\/cldr\/(\w+)\.json/);
4
+ if (!moduleFormat) {
5
+ throw new Error(`Unknown module "${moduleName}"`);
6
+ }
7
+ const localeId = moduleFormat[1];
8
+ return getLocaleData(localeId);
11
9
  };
12
-
13
10
  const LoaderExtensions = {
14
- loadResource,
11
+ loadResource,
15
12
  };
16
-
17
13
  export default LoaderExtensions;
14
+ //# sourceMappingURL=LoaderExtensions.js.map
@@ -0,0 +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","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"]}
@@ -0,0 +1,17 @@
1
+ /**
2
+ * OpenUI5 Configuration Shim
3
+ */
4
+ declare const Configuration: {
5
+ getLanguage: () => string | undefined;
6
+ getCalendarType: () => import("@ui5/webcomponents-base/dist/types/CalendarType.js").default;
7
+ getSupportedLanguages: () => string[] | null;
8
+ getOriginInfo: () => void;
9
+ getFormatSettings: () => {
10
+ getFormatLocale: (lang?: string | undefined) => import("@ui5/webcomponents-base/dist/locale/Locale.js").default;
11
+ getLegacyDateFormat: () => void;
12
+ getCustomLocaleData: () => void;
13
+ getLegacyDateCalendarCustomizing: typeof import("@ui5/webcomponents-base/dist/features/LegacyDateFormats.js").default.getLegacyDateCalendarCustomizing;
14
+ };
15
+ getTimezone: () => string;
16
+ };
17
+ export default Configuration;
@@ -0,0 +1,20 @@
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
+ const emptyFn = () => { };
8
+ /**
9
+ * OpenUI5 Configuration Shim
10
+ */
11
+ const Configuration = {
12
+ getLanguage,
13
+ getCalendarType,
14
+ 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$"),
15
+ getOriginInfo: emptyFn,
16
+ getFormatSettings: () => FormatSettings,
17
+ getTimezone: () => TimezoneUtil.getLocalTimezone(),
18
+ };
19
+ export default Configuration;
20
+ //# sourceMappingURL=Configuration.js.map
@@ -0,0 +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","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"]}
@@ -0,0 +1,26 @@
1
+ /**
2
+ * OpenUI5 Core shim
3
+ */
4
+ declare const Core: {
5
+ getConfiguration: () => {
6
+ getLanguage: () => string | undefined;
7
+ getCalendarType: () => import("@ui5/webcomponents-base/dist/types/CalendarType.js").default;
8
+ getSupportedLanguages: () => string[] | null;
9
+ getOriginInfo: () => void;
10
+ getFormatSettings: () => {
11
+ getFormatLocale: (lang?: string | undefined) => import("@ui5/webcomponents-base/dist/locale/Locale.js").default;
12
+ getLegacyDateFormat: () => void;
13
+ getCustomLocaleData: () => void;
14
+ getLegacyDateCalendarCustomizing: typeof import("@ui5/webcomponents-base/dist/features/LegacyDateFormats.js").default.getLegacyDateCalendarCustomizing;
15
+ };
16
+ getTimezone: () => string;
17
+ };
18
+ getLibraryResourceBundle: void;
19
+ getFormatSettings: () => {
20
+ getFormatLocale: (lang?: string | undefined) => import("@ui5/webcomponents-base/dist/locale/Locale.js").default;
21
+ getLegacyDateFormat: () => void;
22
+ getCustomLocaleData: () => void;
23
+ getLegacyDateCalendarCustomizing: typeof import("@ui5/webcomponents-base/dist/features/LegacyDateFormats.js").default.getLegacyDateCalendarCustomizing;
24
+ };
25
+ };
26
+ export default Core;
@@ -1,40 +1,13 @@
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
- import getLocale from "@ui5/webcomponents-base/dist/locale/getLocale.js";
5
- import TimezoneUtil from "./format/TimezoneUtil.js";
6
-
7
- const emptyFn = () => {};
8
-
9
- /**
10
- * OpenUI5 FormatSettings shim
11
- */
12
- const FormatSettings = {
13
- getFormatLocale: getLocale,
14
- getLegacyDateFormat: emptyFn,
15
- getLegacyDateCalendarCustomizing: emptyFn,
16
- getCustomLocaleData: emptyFn,
17
- };
18
-
19
- /**
20
- * OpenUI5 Configuration Shim
21
- */
22
- const Configuration = {
23
- getLanguage,
24
- getCalendarType,
25
- 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$"),
26
- getOriginInfo: emptyFn,
27
- getFormatSettings: () => FormatSettings,
28
- getTimezone: () => TimezoneUtil.getLocalTimezone(),
29
- };
30
-
1
+ import FormatSettings from "./FormatSettings.js";
2
+ import Configuration from "./Configuration.js";
3
+ const emptyFn = () => { };
31
4
  /**
32
5
  * OpenUI5 Core shim
33
6
  */
34
7
  const Core = {
35
- getConfiguration: () => Configuration,
36
- getLibraryResourceBundle: emptyFn(),
37
- getFormatSettings: () => FormatSettings,
8
+ getConfiguration: () => Configuration,
9
+ getLibraryResourceBundle: emptyFn(),
10
+ getFormatSettings: () => FormatSettings,
38
11
  };
39
-
40
12
  export default Core;
13
+ //# sourceMappingURL=Core.js.map
@@ -0,0 +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","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"]}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * OpenUI5 FormatSettings shim
3
+ */
4
+ declare const FormatSettings: {
5
+ getFormatLocale: (lang?: string | undefined) => import("@ui5/webcomponents-base/dist/locale/Locale").default;
6
+ getLegacyDateFormat: () => void;
7
+ getCustomLocaleData: () => void;
8
+ getLegacyDateCalendarCustomizing: typeof import("@ui5/webcomponents-base/dist/features/LegacyDateFormats").default.getLegacyDateCalendarCustomizing;
9
+ };
10
+ export default FormatSettings;
@@ -0,0 +1,14 @@
1
+ import getLocale from "@ui5/webcomponents-base/dist/locale/getLocale.js";
2
+ import { getLegacyDateCalendarCustomizing } from "@ui5/webcomponents-base/dist/config/FormatSettings.js";
3
+ const emptyFn = () => { };
4
+ /**
5
+ * OpenUI5 FormatSettings shim
6
+ */
7
+ const FormatSettings = {
8
+ getFormatLocale: getLocale,
9
+ getLegacyDateFormat: emptyFn,
10
+ getCustomLocaleData: emptyFn,
11
+ getLegacyDateCalendarCustomizing,
12
+ };
13
+ export default FormatSettings;
14
+ //# sourceMappingURL=FormatSettings.js.map
@@ -0,0 +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","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"]}
@@ -75,6 +75,9 @@ var Locale = BaseObject.extend('sap.ui.core.Locale', {
75
75
  return M_ISO639_OLD_TO_NEW[this.sLanguage] || this.sLanguage;
76
76
  },
77
77
  getSAPLogonLanguage: function () {
78
+ return this._getSAPLogonLanguage();
79
+ },
80
+ _getSAPLogonLanguage: function () {
78
81
  var sLanguage = this.sLanguage || '';
79
82
  if (sLanguage.indexOf('-') >= 0) {
80
83
  sLanguage = sLanguage.slice(0, sLanguage.indexOf('-'));
@@ -5,6 +5,7 @@ import CalendarType from './CalendarType.js';
5
5
  import Locale from './Locale.js';
6
6
  import assert from '../../base/assert.js';
7
7
  import LoaderExtensions from '../../base/util/LoaderExtensions.js';
8
+ import Configuration from './Configuration.js';
8
9
  var LocaleData = BaseObject.extend('sap.ui.core.LocaleData', {
9
10
  constructor: function (oLocale) {
10
11
  this.oLocale = oLocale;
@@ -97,6 +98,56 @@ var LocaleData = BaseObject.extend('sap.ui.core.LocaleData', {
97
98
  assert(sStyle == 'short' || sStyle == 'medium' || sStyle == 'long' || sStyle == 'full', 'sStyle must be short, medium, long or full');
98
99
  return this._get(getCLDRCalendarName(sCalendarType), 'dateFormats', sStyle);
99
100
  },
101
+ getFlexibleDayPeriods: function (sWidth, sCalendarType) {
102
+ return this._get(getCLDRCalendarName(sCalendarType), 'flexibleDayPeriods', 'format', sWidth);
103
+ },
104
+ getFlexibleDayPeriodsStandAlone: function (sWidth, sCalendarType) {
105
+ return this._get(getCLDRCalendarName(sCalendarType), 'flexibleDayPeriods', 'stand-alone', sWidth);
106
+ },
107
+ getFlexibleDayPeriodOfTime: function (iHour, iMinute) {
108
+ var iAbsoluteMinutes, oDayPeriodRules, sPeriodMatch;
109
+ iAbsoluteMinutes = (iHour * 60 + iMinute) % 1440;
110
+ oDayPeriodRules = this._get('dayPeriodRules');
111
+ function parseToAbsoluteMinutes(sValue) {
112
+ var aSplit = sValue.split(':'), sHour = aSplit[0], sMinute = aSplit[1];
113
+ return parseInt(sHour) * 60 + parseInt(sMinute);
114
+ }
115
+ sPeriodMatch = Object.keys(oDayPeriodRules).find(function (sDayPeriodRule) {
116
+ var oDayPeriodRule = oDayPeriodRules[sDayPeriodRule];
117
+ return oDayPeriodRule['_at'] && parseToAbsoluteMinutes(oDayPeriodRule['_at']) === iAbsoluteMinutes;
118
+ });
119
+ if (sPeriodMatch) {
120
+ return sPeriodMatch;
121
+ }
122
+ return Object.keys(oDayPeriodRules).find(function (sDayPeriodRule) {
123
+ var iEndValue, aIntervals, iStartValue, oDayPeriodRule = oDayPeriodRules[sDayPeriodRule];
124
+ if (oDayPeriodRule['_at']) {
125
+ return false;
126
+ }
127
+ iStartValue = parseToAbsoluteMinutes(oDayPeriodRule['_from']);
128
+ iEndValue = parseToAbsoluteMinutes(oDayPeriodRule['_before']);
129
+ if (iStartValue > iEndValue) {
130
+ aIntervals = [
131
+ {
132
+ start: iStartValue,
133
+ end: 1440
134
+ },
135
+ {
136
+ start: 0,
137
+ end: iEndValue
138
+ }
139
+ ];
140
+ } else {
141
+ aIntervals = [{
142
+ start: iStartValue,
143
+ end: iEndValue
144
+ }];
145
+ }
146
+ return aIntervals.some(function (oInterval) {
147
+ return oInterval.start <= iAbsoluteMinutes && oInterval.end > iAbsoluteMinutes;
148
+ });
149
+ });
150
+ },
100
151
  getTimePattern: function (sStyle, sCalendarType) {
101
152
  assert(sStyle == 'short' || sStyle == 'medium' || sStyle == 'long' || sStyle == 'full', 'sStyle must be short, medium, long or full');
102
153
  return this._get(getCLDRCalendarName(sCalendarType), 'timeFormats', sStyle);
@@ -125,6 +176,10 @@ var LocaleData = BaseObject.extend('sap.ui.core.LocaleData', {
125
176
  this._appendItems(aPatterns, aMissingTokens);
126
177
  return aPatterns[0];
127
178
  },
179
+ getTimezoneTranslations: function () {
180
+ this.mTimezoneTranslations = this.mTimezoneTranslations || _resolveTimezoneTranslationStructure(this._get('timezoneNames'));
181
+ return Object.assign({}, this.mTimezoneTranslations);
182
+ },
128
183
  getCustomDateTimePattern: function (sSkeleton, sCalendarType) {
129
184
  var oAvailableFormats = this._get(getCLDRCalendarName(sCalendarType), 'dateTimeFormats', 'availableFormats');
130
185
  return this._getFormatPattern(sSkeleton, oAvailableFormats, sCalendarType);
@@ -743,7 +798,7 @@ var LocaleData = BaseObject.extend('sap.ui.core.LocaleData', {
743
798
  return oMessageBundle.getText(sKey, iWeekNumber);
744
799
  },
745
800
  firstDayStartsFirstWeek: function () {
746
- return this._get('weekData-algorithm') === 'FIRSTDAY_STARTS_FIRSTWEEK';
801
+ return this.oLocale.getLanguage() === 'en' && this.oLocale.getRegion() === 'US';
747
802
  },
748
803
  getPreferredCalendarType: function () {
749
804
  var sCalendarPreference = this._get('calendarPreference'), aCalendars = sCalendarPreference ? sCalendarPreference.split(' ') : [], sCalendarName, sType, i;
@@ -1171,9 +1226,29 @@ var M_SUPPORTED_LOCALES = function () {
1171
1226
  return result;
1172
1227
  }();
1173
1228
  var mLocaleDatas = {};
1229
+ function _resolveTimezoneTranslationStructure(oNode, sKey, oResult, aParentTranslations) {
1230
+ aParentTranslations = aParentTranslations ? aParentTranslations.slice() : [];
1231
+ oResult = oResult || {};
1232
+ sKey = sKey || '';
1233
+ Object.keys(oNode).forEach(function (sChildKey) {
1234
+ var vChildNode = oNode[sChildKey];
1235
+ if (typeof vChildNode === 'object') {
1236
+ var aParentTranslationForChild = aParentTranslations.slice();
1237
+ var sParent = vChildNode['_parent'];
1238
+ if (sParent) {
1239
+ aParentTranslationForChild.push(sParent);
1240
+ }
1241
+ _resolveTimezoneTranslationStructure(vChildNode, sKey + sChildKey + '/', oResult, aParentTranslationForChild);
1242
+ } else if (typeof vChildNode === 'string' && sChildKey !== '_parent') {
1243
+ var sParents = aParentTranslations.length ? aParentTranslations.join(', ') + ', ' : '';
1244
+ oResult[sKey + sChildKey] = sParents + vChildNode;
1245
+ }
1246
+ });
1247
+ return oResult;
1248
+ }
1174
1249
  function getCLDRCalendarName(sCalendarType) {
1175
1250
  if (!sCalendarType) {
1176
- sCalendarType = Core.getConfiguration().getCalendarType();
1251
+ sCalendarType = Configuration.getCalendarType();
1177
1252
  }
1178
1253
  return 'ca-' + sCalendarType.toLowerCase();
1179
1254
  }
@@ -1248,7 +1323,7 @@ function getData(oLocale) {
1248
1323
  var CustomLocaleData = LocaleData.extend('sap.ui.core.CustomLocaleData', {
1249
1324
  constructor: function (oLocale) {
1250
1325
  LocaleData.apply(this, arguments);
1251
- this.mCustomData = Core.getConfiguration().getFormatSettings().getCustomLocaleData();
1326
+ this.mCustomData = Configuration.getFormatSettings().getCustomLocaleData();
1252
1327
  },
1253
1328
  _get: function () {
1254
1329
  var aArguments = Array.prototype.slice.call(arguments), sCalendar, sKey;
@@ -117,11 +117,5 @@ Buddhist.prototype.setUTCFullYear = function (iYear, iMonth, iDay) {
117
117
  }
118
118
  return this._setUTCBuddhist(oBuddhist);
119
119
  };
120
- Buddhist.prototype.getWeek = function () {
121
- return UniversalDate.getWeekByDate(this.sCalendarType, this.oDate.getFullYear(), this.getMonth(), this.getDate());
122
- };
123
- Buddhist.prototype.getUTCWeek = function () {
124
- return UniversalDate.getWeekByDate(this.sCalendarType, this.oDate.getUTCFullYear(), this.getUTCMonth(), this.getUTCDate());
125
- };
126
120
  _Calendars.set(CalendarType.Buddhist, Buddhist);
127
121
  export default Buddhist;
@@ -0,0 +1,36 @@
1
+ import CalendarWeekNumbering from './CalendarWeekNumbering.js';
2
+ import Configuration from '../Configuration.js';
3
+ import LocaleData from '../LocaleData.js';
4
+ var mWeekNumberingConfiguration = {
5
+ ISO_8601: {
6
+ firstDayOfWeek: 1,
7
+ minimalDaysInFirstWeek: 4
8
+ },
9
+ MiddleEastern: {
10
+ firstDayOfWeek: 6,
11
+ minimalDaysInFirstWeek: 1
12
+ },
13
+ WesternTraditional: {
14
+ firstDayOfWeek: 0,
15
+ minimalDaysInFirstWeek: 1
16
+ }
17
+ };
18
+ var CalendarUtils = {
19
+ getWeekConfigurationValues: function (sCalendarWeekNumbering, oLocale) {
20
+ var oLocaleData;
21
+ if (mWeekNumberingConfiguration.hasOwnProperty(sCalendarWeekNumbering)) {
22
+ return mWeekNumberingConfiguration[sCalendarWeekNumbering];
23
+ }
24
+ sCalendarWeekNumbering = sCalendarWeekNumbering || CalendarWeekNumbering.Default;
25
+ if (sCalendarWeekNumbering === CalendarWeekNumbering.Default) {
26
+ oLocale = oLocale || Configuration.getFormatSettings().getFormatLocale();
27
+ oLocaleData = LocaleData.getInstance(oLocale);
28
+ return {
29
+ firstDayOfWeek: oLocaleData.getFirstDayOfWeek(),
30
+ minimalDaysInFirstWeek: oLocaleData.getMinimalDaysInFirstWeek()
31
+ };
32
+ }
33
+ return undefined;
34
+ }
35
+ };
36
+ export default CalendarUtils;
@@ -0,0 +1,7 @@
1
+ var CalendarWeekNumbering = {
2
+ Default: "Default",
3
+ ISO_8601: "ISO_8601",
4
+ MiddleEastern: "MiddleEastern",
5
+ WesternTraditional: "WesternTraditional"
6
+ };
7
+ export default CalendarWeekNumbering;