@openui5/sap.ui.core 1.102.9 → 1.102.11

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 (250) hide show
  1. package/package.json +1 -1
  2. package/src/jquery.sap.global.js +1 -1
  3. package/src/jquery.sap.properties.js +1 -1
  4. package/src/jquery.sap.resources.js +1 -1
  5. package/src/jquery.sap.script.js +1 -1
  6. package/src/jquery.sap.storage.js +3 -3
  7. package/src/sap/base/security/URLListValidator.js +36 -3
  8. package/src/sap/base/util/restricted/_CancelablePromise.js +1 -1
  9. package/src/sap/base/util/restricted/_castArray.js +1 -1
  10. package/src/sap/base/util/restricted/_compact.js +1 -1
  11. package/src/sap/base/util/restricted/_curry.js +1 -1
  12. package/src/sap/base/util/restricted/_debounce.js +1 -1
  13. package/src/sap/base/util/restricted/_difference.js +1 -1
  14. package/src/sap/base/util/restricted/_differenceBy.js +1 -1
  15. package/src/sap/base/util/restricted/_differenceWith.js +1 -1
  16. package/src/sap/base/util/restricted/_flatMap.js +1 -1
  17. package/src/sap/base/util/restricted/_flatMapDeep.js +1 -1
  18. package/src/sap/base/util/restricted/_flatMapDepth.js +1 -1
  19. package/src/sap/base/util/restricted/_flatten.js +1 -1
  20. package/src/sap/base/util/restricted/_flattenDeep.js +1 -1
  21. package/src/sap/base/util/restricted/_flattenDepth.js +1 -1
  22. package/src/sap/base/util/restricted/_intersection.js +1 -1
  23. package/src/sap/base/util/restricted/_intersectionBy.js +1 -1
  24. package/src/sap/base/util/restricted/_intersectionWith.js +1 -1
  25. package/src/sap/base/util/restricted/_isEqual.js +1 -1
  26. package/src/sap/base/util/restricted/_isEqualWith.js +1 -1
  27. package/src/sap/base/util/restricted/_isNil.js +1 -1
  28. package/src/sap/base/util/restricted/_max.js +1 -1
  29. package/src/sap/base/util/restricted/_merge.js +1 -1
  30. package/src/sap/base/util/restricted/_mergeWith.js +1 -1
  31. package/src/sap/base/util/restricted/_min.js +1 -1
  32. package/src/sap/base/util/restricted/_omit.js +1 -1
  33. package/src/sap/base/util/restricted/_pick.js +1 -1
  34. package/src/sap/base/util/restricted/_pickBy.js +1 -1
  35. package/src/sap/base/util/restricted/_throttle.js +1 -1
  36. package/src/sap/base/util/restricted/_toArray.js +1 -1
  37. package/src/sap/base/util/restricted/_union.js +1 -1
  38. package/src/sap/base/util/restricted/_unionBy.js +1 -1
  39. package/src/sap/base/util/restricted/_unionWith.js +1 -1
  40. package/src/sap/base/util/restricted/_uniq.js +1 -1
  41. package/src/sap/base/util/restricted/_uniqBy.js +1 -1
  42. package/src/sap/base/util/restricted/_uniqWith.js +1 -1
  43. package/src/sap/base/util/restricted/_without.js +1 -1
  44. package/src/sap/base/util/restricted/_xor.js +1 -1
  45. package/src/sap/base/util/restricted/_xorBy.js +1 -1
  46. package/src/sap/base/util/restricted/_xorWith.js +1 -1
  47. package/src/sap/base/util/restricted/_zipObject.js +1 -1
  48. package/src/sap/base/util/restricted/_zipObjectDeep.js +1 -1
  49. package/src/sap/ui/Device.js +3 -3
  50. package/src/sap/ui/Global.js +4 -4
  51. package/src/sap/ui/base/Event.js +1 -1
  52. package/src/sap/ui/base/EventProvider.js +1 -1
  53. package/src/sap/ui/base/Interface.js +1 -1
  54. package/src/sap/ui/base/ManagedObject.js +1 -1
  55. package/src/sap/ui/base/ManagedObjectMetadata.js +1 -1
  56. package/src/sap/ui/base/Metadata.js +1 -1
  57. package/src/sap/ui/base/Object.js +1 -1
  58. package/src/sap/ui/base/ObjectPool.js +1 -1
  59. package/src/sap/ui/core/.library +1 -1
  60. package/src/sap/ui/core/BusyIndicator.js +1 -1
  61. package/src/sap/ui/core/Component.js +1 -1
  62. package/src/sap/ui/core/ComponentContainer.js +1 -1
  63. package/src/sap/ui/core/ComponentMetadata.js +1 -1
  64. package/src/sap/ui/core/ComponentSupport.js +1 -1
  65. package/src/sap/ui/core/Control.js +1 -1
  66. package/src/sap/ui/core/Core.js +1 -1
  67. package/src/sap/ui/core/CustomData.js +1 -1
  68. package/src/sap/ui/core/DeclarativeSupport.js +1 -1
  69. package/src/sap/ui/core/Element.js +1 -1
  70. package/src/sap/ui/core/ElementMetadata.js +1 -1
  71. package/src/sap/ui/core/EnabledPropagator.js +1 -1
  72. package/src/sap/ui/core/EventBus.js +1 -1
  73. package/src/sap/ui/core/Fragment.js +1 -1
  74. package/src/sap/ui/core/HTML.js +1 -1
  75. package/src/sap/ui/core/History.js +1 -1
  76. package/src/sap/ui/core/Icon.js +1 -1
  77. package/src/sap/ui/core/IndicationColorSupport.js +1 -1
  78. package/src/sap/ui/core/IntervalTrigger.js +1 -1
  79. package/src/sap/ui/core/InvisibleMessage.js +1 -1
  80. package/src/sap/ui/core/InvisibleRenderer.js +1 -1
  81. package/src/sap/ui/core/InvisibleText.js +1 -1
  82. package/src/sap/ui/core/Item.js +1 -1
  83. package/src/sap/ui/core/LabelEnablement.js +1 -1
  84. package/src/sap/ui/core/LayoutData.js +1 -1
  85. package/src/sap/ui/core/ListItem.js +1 -1
  86. package/src/sap/ui/core/LocalBusyIndicator.js +1 -1
  87. package/src/sap/ui/core/Locale.js +1 -1
  88. package/src/sap/ui/core/LocaleData.js +1 -1
  89. package/src/sap/ui/core/Manifest.js +1 -1
  90. package/src/sap/ui/core/Message.js +1 -1
  91. package/src/sap/ui/core/RenderManager.js +1 -1
  92. package/src/sap/ui/core/Renderer.js +1 -1
  93. package/src/sap/ui/core/ResizeHandler.js +1 -1
  94. package/src/sap/ui/core/ScrollBar.js +1 -1
  95. package/src/sap/ui/core/SeparatorItem.js +1 -1
  96. package/src/sap/ui/core/Title.js +1 -1
  97. package/src/sap/ui/core/TooltipBase.js +1 -1
  98. package/src/sap/ui/core/UIArea.js +1 -1
  99. package/src/sap/ui/core/UIComponent.js +1 -1
  100. package/src/sap/ui/core/UIComponentMetadata.js +1 -1
  101. package/src/sap/ui/core/ValueStateSupport.js +1 -1
  102. package/src/sap/ui/core/VariantLayoutData.js +1 -1
  103. package/src/sap/ui/core/XMLComposite.js +1 -1
  104. package/src/sap/ui/core/XMLCompositeMetadata.js +1 -1
  105. package/src/sap/ui/core/date/Buddhist.js +15 -13
  106. package/src/sap/ui/core/date/CalendarUtils.js +92 -0
  107. package/src/sap/ui/core/date/CalendarWeekNumbering.js +76 -0
  108. package/src/sap/ui/core/date/Japanese.js +0 -6
  109. package/src/sap/ui/core/date/UniversalDate.js +187 -40
  110. package/src/sap/ui/core/delegate/ItemNavigation.js +1 -1
  111. package/src/sap/ui/core/delegate/ScrollEnablement.js +1 -1
  112. package/src/sap/ui/core/dnd/DragDropBase.js +1 -1
  113. package/src/sap/ui/core/dnd/DragDropInfo.js +1 -1
  114. package/src/sap/ui/core/dnd/DragInfo.js +1 -1
  115. package/src/sap/ui/core/dnd/DropInfo.js +1 -1
  116. package/src/sap/ui/core/format/DateFormat.js +36 -9
  117. package/src/sap/ui/core/format/TimezoneUtil.js +1 -1
  118. package/src/sap/ui/core/hyphenation/Hyphenation.js +1 -1
  119. package/src/sap/ui/core/library.js +3 -3
  120. package/src/sap/ui/core/message/ControlMessageProcessor.js +1 -1
  121. package/src/sap/ui/core/message/Message.js +1 -1
  122. package/src/sap/ui/core/message/MessageManager.js +1 -1
  123. package/src/sap/ui/core/message/MessageParser.js +1 -1
  124. package/src/sap/ui/core/message/MessageProcessor.js +1 -1
  125. package/src/sap/ui/core/mvc/HTMLView.js +1 -1
  126. package/src/sap/ui/core/mvc/JSONView.js +1 -1
  127. package/src/sap/ui/core/mvc/JSView.js +1 -1
  128. package/src/sap/ui/core/mvc/TemplateView.js +1 -1
  129. package/src/sap/ui/core/mvc/View.js +1 -1
  130. package/src/sap/ui/core/mvc/XMLView.js +1 -1
  131. package/src/sap/ui/core/plugin/DeclarativeSupport.js +1 -1
  132. package/src/sap/ui/core/plugin/LessSupport.js +1 -1
  133. package/src/sap/ui/core/plugin/TemplatingSupport.js +1 -1
  134. package/src/sap/ui/core/postmessage/Bus.js +1 -1
  135. package/src/sap/ui/core/postmessage/confirmationDialog.js +1 -1
  136. package/src/sap/ui/core/search/OpenSearchProvider.js +1 -1
  137. package/src/sap/ui/core/search/SearchProvider.js +1 -1
  138. package/src/sap/ui/core/service/Service.js +1 -1
  139. package/src/sap/ui/core/service/ServiceFactory.js +1 -1
  140. package/src/sap/ui/core/service/ServiceFactoryRegistry.js +1 -1
  141. package/src/sap/ui/core/support/Plugin.js +1 -1
  142. package/src/sap/ui/core/support/Support.js +1 -1
  143. package/src/sap/ui/core/support/plugins/ControlTree.js +1 -1
  144. package/src/sap/ui/core/support/plugins/Interaction.js +1 -1
  145. package/src/sap/ui/core/support/plugins/LocalStorage.js +1 -1
  146. package/src/sap/ui/core/support/plugins/Performance.js +1 -1
  147. package/src/sap/ui/core/support/plugins/Selector.js +1 -1
  148. package/src/sap/ui/core/support/plugins/TechInfo.js +1 -1
  149. package/src/sap/ui/core/support/plugins/Trace.js +1 -1
  150. package/src/sap/ui/core/support/plugins/ViewInfo.js +1 -1
  151. package/src/sap/ui/core/tmpl/DOMAttribute.js +1 -1
  152. package/src/sap/ui/core/tmpl/DOMElement.js +1 -1
  153. package/src/sap/ui/core/tmpl/HandlebarsTemplate.js +1 -1
  154. package/src/sap/ui/core/tmpl/Template.js +1 -1
  155. package/src/sap/ui/core/tmpl/TemplateControl.js +1 -1
  156. package/src/sap/ui/core/util/AsyncHintsHelper.js +1 -1
  157. package/src/sap/ui/core/util/Export.js +1 -1
  158. package/src/sap/ui/core/util/ExportCell.js +1 -1
  159. package/src/sap/ui/core/util/ExportColumn.js +1 -1
  160. package/src/sap/ui/core/util/ExportRow.js +1 -1
  161. package/src/sap/ui/core/util/ExportType.js +1 -1
  162. package/src/sap/ui/core/util/ExportTypeCSV.js +1 -1
  163. package/src/sap/ui/core/util/File.js +1 -1
  164. package/src/sap/ui/core/util/LibraryInfo.js +1 -1
  165. package/src/sap/ui/core/util/MockServer.js +1 -1
  166. package/src/sap/ui/core/util/PasteHelper.js +1 -1
  167. package/src/sap/ui/core/util/serializer/HTMLViewSerializer.js +1 -1
  168. package/src/sap/ui/core/util/serializer/Serializer.js +1 -1
  169. package/src/sap/ui/core/util/serializer/ViewSerializer.js +1 -1
  170. package/src/sap/ui/core/util/serializer/XMLViewSerializer.js +1 -1
  171. package/src/sap/ui/core/util/serializer/delegate/Delegate.js +1 -1
  172. package/src/sap/ui/core/util/serializer/delegate/HTML.js +1 -1
  173. package/src/sap/ui/core/util/serializer/delegate/XML.js +1 -1
  174. package/src/sap/ui/core/ws/ReadyState.js +1 -1
  175. package/src/sap/ui/core/ws/SapPcpWebSocket.js +1 -1
  176. package/src/sap/ui/core/ws/WebSocket.js +1 -1
  177. package/src/sap/ui/debug/ControlTree.js +1 -1
  178. package/src/sap/ui/debug/DebugEnv.js +1 -1
  179. package/src/sap/ui/debug/PropertyList.js +1 -1
  180. package/src/sap/ui/model/ClientModel.js +1 -1
  181. package/src/sap/ui/model/CompositeDataState.js +1 -1
  182. package/src/sap/ui/model/CompositeType.js +1 -1
  183. package/src/sap/ui/model/DataState.js +1 -1
  184. package/src/sap/ui/model/MetaModel.js +1 -1
  185. package/src/sap/ui/model/Model.js +1 -1
  186. package/src/sap/ui/model/SelectionModel.js +1 -1
  187. package/src/sap/ui/model/SimpleType.js +1 -1
  188. package/src/sap/ui/model/TreeAutoExpandMode.js +1 -1
  189. package/src/sap/ui/model/Type.js +1 -1
  190. package/src/sap/ui/model/analytics/AnalyticalTreeBindingAdapter.js +28 -34
  191. package/src/sap/ui/model/json/JSONModel.js +1 -1
  192. package/src/sap/ui/model/message/MessageModel.js +1 -1
  193. package/src/sap/ui/model/odata/ODataAnnotations.js +1 -1
  194. package/src/sap/ui/model/odata/ODataMessageParser.js +1 -1
  195. package/src/sap/ui/model/odata/ODataMetaModel.js +1 -1
  196. package/src/sap/ui/model/odata/ODataMetadata.js +1 -1
  197. package/src/sap/ui/model/odata/ODataModel.js +1 -1
  198. package/src/sap/ui/model/odata/type/Boolean.js +1 -1
  199. package/src/sap/ui/model/odata/type/Byte.js +1 -1
  200. package/src/sap/ui/model/odata/type/Currency.js +1 -1
  201. package/src/sap/ui/model/odata/type/Date.js +1 -1
  202. package/src/sap/ui/model/odata/type/DateTime.js +1 -1
  203. package/src/sap/ui/model/odata/type/DateTimeBase.js +1 -1
  204. package/src/sap/ui/model/odata/type/DateTimeOffset.js +1 -1
  205. package/src/sap/ui/model/odata/type/DateTimeWithTimezone.js +1 -1
  206. package/src/sap/ui/model/odata/type/Decimal.js +1 -1
  207. package/src/sap/ui/model/odata/type/Double.js +1 -1
  208. package/src/sap/ui/model/odata/type/Guid.js +1 -1
  209. package/src/sap/ui/model/odata/type/Int.js +1 -1
  210. package/src/sap/ui/model/odata/type/Int16.js +1 -1
  211. package/src/sap/ui/model/odata/type/Int32.js +1 -1
  212. package/src/sap/ui/model/odata/type/Int64.js +1 -1
  213. package/src/sap/ui/model/odata/type/ODataType.js +1 -1
  214. package/src/sap/ui/model/odata/type/Raw.js +1 -1
  215. package/src/sap/ui/model/odata/type/SByte.js +1 -1
  216. package/src/sap/ui/model/odata/type/Single.js +1 -1
  217. package/src/sap/ui/model/odata/type/Stream.js +1 -1
  218. package/src/sap/ui/model/odata/type/String.js +1 -1
  219. package/src/sap/ui/model/odata/type/Time.js +1 -1
  220. package/src/sap/ui/model/odata/type/TimeOfDay.js +1 -1
  221. package/src/sap/ui/model/odata/type/Unit.js +1 -1
  222. package/src/sap/ui/model/odata/v2/Context.js +1 -1
  223. package/src/sap/ui/model/odata/v2/ODataAnnotations.js +1 -1
  224. package/src/sap/ui/model/odata/v2/ODataModel.js +1 -1
  225. package/src/sap/ui/model/odata/v2/ODataTreeBinding.js +1 -1
  226. package/src/sap/ui/model/odata/v4/Context.js +1 -1
  227. package/src/sap/ui/model/odata/v4/ODataContextBinding.js +1 -1
  228. package/src/sap/ui/model/odata/v4/ODataListBinding.js +1 -1
  229. package/src/sap/ui/model/odata/v4/ODataMetaModel.js +1 -1
  230. package/src/sap/ui/model/odata/v4/ODataModel.js +1 -1
  231. package/src/sap/ui/model/odata/v4/ODataPropertyBinding.js +1 -1
  232. package/src/sap/ui/model/resource/ResourceModel.js +1 -1
  233. package/src/sap/ui/model/type/Boolean.js +1 -1
  234. package/src/sap/ui/model/type/Currency.js +1 -1
  235. package/src/sap/ui/model/type/Date.js +1 -1
  236. package/src/sap/ui/model/type/DateInterval.js +1 -1
  237. package/src/sap/ui/model/type/DateTime.js +1 -1
  238. package/src/sap/ui/model/type/DateTimeInterval.js +1 -1
  239. package/src/sap/ui/model/type/FileSize.js +1 -1
  240. package/src/sap/ui/model/type/Float.js +1 -1
  241. package/src/sap/ui/model/type/Integer.js +1 -1
  242. package/src/sap/ui/model/type/String.js +1 -1
  243. package/src/sap/ui/model/type/Time.js +1 -1
  244. package/src/sap/ui/model/type/TimeInterval.js +1 -1
  245. package/src/sap/ui/model/type/Unit.js +1 -1
  246. package/src/sap/ui/model/xml/XMLModel.js +1 -1
  247. package/src/sap/ui/qunit/utils/ControlIterator.js +1 -1
  248. package/src/sap/ui/qunit/utils/MemoryLeakCheck.js +1 -1
  249. package/src/sap/ui/test/generic/TestBase.js +1 -1
  250. package/src/sap/ui/util/Storage.js +1 -1
@@ -0,0 +1,92 @@
1
+ /*!
2
+ * OpenUI5
3
+ * (c) Copyright 2009-2022 SAP SE or an SAP affiliate company.
4
+ * Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
5
+ */
6
+
7
+ // Provides type sap.ui.core.date.CalendarUtils.
8
+ sap.ui.define([
9
+ "sap/ui/core/date/CalendarWeekNumbering",
10
+ "sap/ui/core/LocaleData"
11
+ ], function(
12
+ CalendarWeekNumbering,
13
+ LocaleData
14
+ ) {
15
+ "use strict";
16
+
17
+ var mWeekNumberingConfiguration = {
18
+ ISO_8601 : {
19
+ firstDayOfWeek : 1,
20
+ minimalDaysInFirstWeek : 4
21
+ },
22
+ MiddleEastern : {
23
+ firstDayOfWeek : 6,
24
+ minimalDaysInFirstWeek : 1
25
+ },
26
+ WesternTraditional : {
27
+ firstDayOfWeek : 0,
28
+ minimalDaysInFirstWeek : 1
29
+ }
30
+ };
31
+
32
+ /**
33
+ * Provides calendar-related utilities.
34
+ *
35
+ * Note: This API has been introduced with version 1.108 and downported to this release with
36
+ * patch level 11.
37
+ *
38
+ * @namespace
39
+ * @alias module:sap/ui/core/date/CalendarUtils
40
+ * @public
41
+ * @since 1.102.11
42
+ */
43
+ var CalendarUtils = {
44
+
45
+ /**
46
+ * Resolves calendar week configuration.
47
+ *
48
+ * Returns an object with the following fields:
49
+ * <ul>
50
+ * <li><code>firstDayOfWeek</code>: specifies the first day of the week starting with
51
+ * <code>0</code> (which is Sunday)</li>
52
+ * <li><code>minimalDaysInFirstWeek</code>: minimal days at the beginning of the year
53
+ * which define the first calendar week</li>
54
+ * </ul>
55
+ *
56
+ * Note: This API has been introduced with version 1.108 and downported to this release with
57
+ * patch level 11.
58
+ *
59
+ * @param {sap.ui.core.date.CalendarWeekNumbering} [sCalendarWeekNumbering=Default]
60
+ * The calendar week numbering; if omitted, <code>Default</code> is used.
61
+ * @param {sap.ui.core.Locale} [oLocale]
62
+ * The locale to use; if not provided, this falls back to the format locale from the
63
+ * Configuration; see {@link sap.ui.core.Configuration.FormatSettings#getFormatLocale}.
64
+ * Is only used when <code>sCalendarWeekNumbering</code> is set to <code>Default</code>.
65
+ * @returns {{firstDayOfWeek: int, minimalDaysInFirstWeek: int}|undefined}
66
+ * The calendar week configuration, or <code>undefined<code> for an invalid value of
67
+ * <code>sap.ui.core.date.CalendarWeekNumbering</code>.
68
+ * @public
69
+ * @since 1.102.11
70
+ */
71
+ getWeekConfigurationValues : function (sCalendarWeekNumbering, oLocale) {
72
+ var oLocaleData;
73
+
74
+ if (mWeekNumberingConfiguration.hasOwnProperty(sCalendarWeekNumbering)) {
75
+ return mWeekNumberingConfiguration[sCalendarWeekNumbering];
76
+ }
77
+ sCalendarWeekNumbering = sCalendarWeekNumbering || CalendarWeekNumbering.Default;
78
+ if (sCalendarWeekNumbering === CalendarWeekNumbering.Default) {
79
+ oLocale = oLocale ||
80
+ sap.ui.getCore().getConfiguration().getFormatSettings().getFormatLocale();
81
+ oLocaleData = LocaleData.getInstance(oLocale);
82
+ return {
83
+ firstDayOfWeek : oLocaleData.getFirstDayOfWeek(),
84
+ minimalDaysInFirstWeek : oLocaleData.getMinimalDaysInFirstWeek()
85
+ };
86
+ }
87
+ return undefined;
88
+ }
89
+ };
90
+
91
+ return CalendarUtils;
92
+ });
@@ -0,0 +1,76 @@
1
+ /*!
2
+ * OpenUI5
3
+ * (c) Copyright 2009-2022 SAP SE or an SAP affiliate company.
4
+ * Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
5
+ */
6
+
7
+ // Provides type sap.ui.core.date.CalendarWeekNumbering.
8
+ sap.ui.define([], function() {
9
+ "use strict";
10
+
11
+ /**
12
+ * The <code>CalendarWeekNumbering</code> enum defines how to calculate calendar weeks. Each
13
+ * value defines:
14
+ * <ul>
15
+ * <li>The first day of the week,</li>
16
+ * <li>the first week of the year.</li>
17
+ * </ul>
18
+ *
19
+ * Note: This API has been introduced with version 1.108 and downported to this release with
20
+ * patch level 11.
21
+ *
22
+ * @enum {string}
23
+ * @public
24
+ * @since 1.102.11
25
+ * @alias sap.ui.core.date.CalendarWeekNumbering
26
+ */
27
+ var CalendarWeekNumbering = {
28
+
29
+ /**
30
+ * The default calendar week numbering:
31
+ *
32
+ * The framework determines the week numbering scheme; currently it is derived from the
33
+ * active format locale. Future versions of UI5 might select a different week numbering
34
+ * scheme.
35
+ *
36
+ * @public
37
+ */
38
+ Default : "Default",
39
+
40
+ /**
41
+ * Official calendar week numbering in most of Europe (ISO 8601 standard):
42
+ * <ul>
43
+ * <li>Monday is first day of the week,
44
+ * <li>the week containing January 4th is first week of the year.
45
+ * </ul>
46
+ *
47
+ * @public
48
+ */
49
+ ISO_8601 : "ISO_8601",
50
+
51
+ /**
52
+ * Official calendar week numbering in much of the Middle East (Middle Eastern calendar):
53
+ * <ul>
54
+ * <li>Saturday is first day of the week,
55
+ * <li>the week containing January 1st is first week of the year.
56
+ * </ul>
57
+ *
58
+ * @public
59
+ */
60
+ MiddleEastern : "MiddleEastern",
61
+
62
+ /**
63
+ * Official calendar week numbering in the United States, Canada, Brazil, Israel, Japan, and
64
+ * other countries (Western traditional calendar):
65
+ * <ul>
66
+ * <li>Sunday is first day of the week,
67
+ * <li>the week containing January 1st is first week of the year.
68
+ * </ul>
69
+ *
70
+ * @public
71
+ */
72
+ WesternTraditional : "WesternTraditional"
73
+ };
74
+
75
+ return CalendarWeekNumbering;
76
+ }, /* bExport= */ true);
@@ -230,12 +230,6 @@ sap.ui.define(['./UniversalDate', '../CalendarType', './_Calendars'],
230
230
  }
231
231
  return this._setUTCJapanese(oJapanese);
232
232
  };
233
- Japanese.prototype.getWeek = function() {
234
- return UniversalDate.getWeekByDate(this.sCalendarType, this.oDate.getFullYear(), this.getMonth(), this.getDate());
235
- };
236
- Japanese.prototype.getUTCWeek = function() {
237
- return UniversalDate.getWeekByDate(this.sCalendarType, this.oDate.getUTCFullYear(), this.getUTCMonth(), this.getUTCDate());
238
- };
239
233
 
240
234
  _Calendars.set(CalendarType.Japanese, Japanese);
241
235
 
@@ -5,8 +5,21 @@
5
5
  */
6
6
 
7
7
  // Provides class sap.ui.core.date.UniversalDate
8
- sap.ui.define(['sap/ui/base/Object', 'sap/ui/core/LocaleData', './_Calendars'],
9
- function(BaseObject, LocaleData, _Calendars) {
8
+ sap.ui.define([
9
+ 'sap/ui/base/Object',
10
+ 'sap/ui/core/Locale',
11
+ 'sap/ui/core/LocaleData',
12
+ './_Calendars',
13
+ './CalendarUtils',
14
+ './CalendarWeekNumbering'
15
+ ], function(
16
+ BaseObject,
17
+ Locale,
18
+ LocaleData,
19
+ _Calendars,
20
+ CalendarUtils,
21
+ CalendarWeekNumbering
22
+ ) {
10
23
  "use strict";
11
24
 
12
25
 
@@ -153,18 +166,76 @@ sap.ui.define(['sap/ui/base/Object', 'sap/ui/core/LocaleData', './_Calendars'],
153
166
  UniversalDate.prototype.setUTCEra = function(iEra) {
154
167
  // The default implementation does not support setting the era
155
168
  };
156
- UniversalDate.prototype.getWeek = function() {
157
- return UniversalDate.getWeekByDate(this.sCalendarType, this.getFullYear(), this.getMonth(), this.getDate());
169
+
170
+ /**
171
+ * Retrieves the calendar week
172
+ *
173
+ * @param {sap.ui.core.Locale} [oLocale] the locale used to get the calendar week calculation properties, defaults to the formatLocale
174
+ * @param {sap.ui.core.date.CalendarWeekNumbering} [sCalendarWeekNumbering]
175
+ * calendar week numbering,
176
+ * the default is derived from <code>oLocale</code> but this parameter has precedence over oLocale if both are provided.
177
+ * If calendar week numbering is not determined from the locale then {@link LocaleData#firstDayStartsFirstWeek} is ignored.
178
+ * @returns {{week: int, year: int}} resulting calendar week, note: week index starts with <code>0</code>
179
+ * @private
180
+ * @throws {TypeError} If <code>sCalendarWeekNumbering</code> has an invalid week numbering value
181
+ */
182
+ UniversalDate.prototype.getWeek = function(oLocale, sCalendarWeekNumbering) {
183
+ checkWeekConfig(sCalendarWeekNumbering);
184
+ return UniversalDate.getWeekByDate(this.sCalendarType, this.getFullYear(), this.getMonth(), this.getDate(), oLocale, sCalendarWeekNumbering);
158
185
  };
159
- UniversalDate.prototype.setWeek = function(oWeek) {
160
- var oDate = UniversalDate.getFirstDateOfWeek(this.sCalendarType, oWeek.year || this.getFullYear(), oWeek.week);
186
+
187
+ /**
188
+ * Sets the calendar week
189
+ *
190
+ * @param {{week: int, year: int}} oWeek the calendar week, note: week index starts with <code>0</code>,
191
+ * <code>oWeek.year</code> is optional and defaults to {@link sap.ui.core.date.UniversalDate#getFullYear}
192
+ * @param {sap.ui.core.Locale} [oLocale] the locale used to get the calendar week calculation properties, defaults to the formatLocale
193
+ * @param {sap.ui.core.date.CalendarWeekNumbering} [sCalendarWeekNumbering]
194
+ * calendar week numbering,
195
+ * the default is derived from <code>oLocale</code> but this parameter has precedence over oLocale if both are provided.
196
+ * If calendar week numbering is not determined from the locale then {@link LocaleData#firstDayStartsFirstWeek} is ignored.
197
+ * @private
198
+ * @throws {TypeError} If <code>sCalendarWeekNumbering</code> has an invalid week numbering value
199
+ */
200
+ UniversalDate.prototype.setWeek = function(oWeek, oLocale, sCalendarWeekNumbering) {
201
+ checkWeekConfig(sCalendarWeekNumbering);
202
+ var oDate = UniversalDate.getFirstDateOfWeek(this.sCalendarType, oWeek.year || this.getFullYear(), oWeek.week, oLocale, sCalendarWeekNumbering);
161
203
  this.setFullYear(oDate.year, oDate.month, oDate.day);
162
204
  };
163
- UniversalDate.prototype.getUTCWeek = function() {
164
- return UniversalDate.getWeekByDate(this.sCalendarType, this.getUTCFullYear(), this.getUTCMonth(), this.getUTCDate());
205
+
206
+ /**
207
+ * Retrieves the UTC calendar week
208
+ *
209
+ * @param {sap.ui.core.Locale} [oLocale] the locale used to get the calendar week calculation properties, defaults to the formatLocale
210
+ * @param {sap.ui.core.date.CalendarWeekNumbering} [sCalendarWeekNumbering]
211
+ * calendar week numbering,
212
+ * the default is derived from <code>oLocale</code> but this parameter has precedence over oLocale if both are provided.
213
+ * If calendar week numbering is not determined from the locale then {@link LocaleData#firstDayStartsFirstWeek} is ignored.
214
+ * @returns {{week: int, year: int}} resulting calendar week, note: week index starts with <code>0</code>
215
+ * @private
216
+ * @throws {TypeError} If <code>sCalendarWeekNumbering</code> has an invalid week numbering value
217
+ */
218
+ UniversalDate.prototype.getUTCWeek = function(oLocale, sCalendarWeekNumbering) {
219
+ checkWeekConfig(sCalendarWeekNumbering);
220
+ return UniversalDate.getWeekByDate(this.sCalendarType, this.getUTCFullYear(), this.getUTCMonth(), this.getUTCDate(), oLocale, sCalendarWeekNumbering);
165
221
  };
166
- UniversalDate.prototype.setUTCWeek = function(oWeek) {
167
- var oDate = UniversalDate.getFirstDateOfWeek(this.sCalendarType, oWeek.year || this.getFullYear(), oWeek.week);
222
+
223
+ /**
224
+ * Sets the UTC calendar week
225
+ *
226
+ * @param {{week: int, year: int}} oWeek the calendar week, note: week index starts with <code>0</code>,
227
+ * <code>oWeek.year</code> is optional and defaults to {@link sap.ui.core.date.UniversalDate#getFullYear}
228
+ * @param {sap.ui.core.Locale} [oLocale] the locale used to get the calendar week calculation properties, defaults to the formatLocale
229
+ * @param {sap.ui.core.date.CalendarWeekNumbering} [sCalendarWeekNumbering]
230
+ * calendar week numbering,
231
+ * the default is derived from <code>oLocale</code> but this parameter has precedence over oLocale if both are provided.
232
+ * If calendar week numbering is not determined from the locale then {@link LocaleData#firstDayStartsFirstWeek} is ignored.
233
+ * @private
234
+ * @throws {TypeError} If <code>sCalendarWeekNumbering</code> has an invalid week numbering value
235
+ */
236
+ UniversalDate.prototype.setUTCWeek = function(oWeek, oLocale, sCalendarWeekNumbering) {
237
+ checkWeekConfig(sCalendarWeekNumbering);
238
+ var oDate = UniversalDate.getFirstDateOfWeek(this.sCalendarType, oWeek.year || this.getFullYear(), oWeek.week, oLocale, sCalendarWeekNumbering);
168
239
  this.setUTCFullYear(oDate.year, oDate.month, oDate.day);
169
240
  };
170
241
  UniversalDate.prototype.getQuarter = function() {
@@ -207,22 +278,38 @@ sap.ui.define(['sap/ui/base/Object', 'sap/ui/core/LocaleData', './_Calendars'],
207
278
  */
208
279
  var iMillisecondsInWeek = 7 * 24 * 60 * 60 * 1000;
209
280
 
210
- UniversalDate.getWeekByDate = function(sCalendarType, iYear, iMonth, iDay) {
211
- var oLocale = sap.ui.getCore().getConfiguration().getFormatSettings().getFormatLocale(),
212
- oLocaleData = LocaleData.getInstance(oLocale),
213
- clDate = this.getClass(sCalendarType),
214
- oFirstDay = getFirstDayOfFirstWeek(clDate, iYear),
215
- oDate = new clDate(clDate.UTC(iYear, iMonth, iDay)),
216
- iWeek, iLastYear, iNextYear, oLastFirstDay, oNextFirstDay;
217
- // If region is US, always calculate the week for the current year, otherwise
218
- // the week might be the last week of the previous year or first week of next year
219
- if (oLocaleData.firstDayStartsFirstWeek()) {
281
+ /**
282
+ * Retrieves the calendar week for a given date, specified by year, month, and day.
283
+ *
284
+ * @param {string} sCalendarType the calendar type, e.g. <code>"Gregorian"</code>
285
+ * @param {int} iYear year, e.g. <code>2016</code>
286
+ * @param {int} iMonth the month, e.g. <code>2</code>
287
+ * @param {int} iDay the date, e.g. <code>3</code>
288
+ * @param {sap.ui.core.Locale} [oLocale] the locale used for the week calculation, if oWeekConfig is not provided (falls back to the formatLocale)
289
+ * e.g. <code>new Locale("de-DE")</code>
290
+ * @param {sap.ui.core.date.CalendarWeekNumbering} [sCalendarWeekNumbering]
291
+ * calendar week numbering,
292
+ * the default is derived from <code>oLocale</code> but this parameter has precedence over oLocale if both are provided.
293
+ * If calendar week numbering is not determined from the locale then {@link LocaleData#firstDayStartsFirstWeek} is ignored.
294
+ * @returns {{week: int, year: int}} resulting calendar week, note: week index starts with <code>0</code>, e.g. <code>{year: 2016, week: 8}</code>
295
+ * @private
296
+ * @throws {TypeError} If <code>sCalendarWeekNumbering</code> has an invalid week numbering value
297
+ */
298
+ UniversalDate.getWeekByDate = function(sCalendarType, iYear, iMonth, iDay, oLocale, sCalendarWeekNumbering) {
299
+ checkWeekConfig(sCalendarWeekNumbering);
300
+ oLocale = oLocale || sap.ui.getCore().getConfiguration().getFormatSettings().getFormatLocale();
301
+ var clDate = this.getClass(sCalendarType);
302
+ var oFirstDay = getFirstDayOfFirstWeek(clDate, iYear, oLocale, sCalendarWeekNumbering);
303
+ var oDate = new clDate(clDate.UTC(iYear, iMonth, iDay));
304
+ var iWeek, iLastYear, iNextYear, oLastFirstDay, oNextFirstDay;
305
+ var bSplitWeek = isSplitWeek(sCalendarWeekNumbering, oLocale);
306
+ if (bSplitWeek) {
220
307
  iWeek = calculateWeeks(oFirstDay, oDate);
221
308
  } else {
222
309
  iLastYear = iYear - 1;
223
310
  iNextYear = iYear + 1;
224
- oLastFirstDay = getFirstDayOfFirstWeek(clDate, iLastYear);
225
- oNextFirstDay = getFirstDayOfFirstWeek(clDate, iNextYear);
311
+ oLastFirstDay = getFirstDayOfFirstWeek(clDate, iLastYear, oLocale, sCalendarWeekNumbering);
312
+ oNextFirstDay = getFirstDayOfFirstWeek(clDate, iNextYear, oLocale, sCalendarWeekNumbering);
226
313
  if (oDate >= oNextFirstDay) {
227
314
  iYear = iNextYear;
228
315
  iWeek = 0;
@@ -239,17 +326,30 @@ sap.ui.define(['sap/ui/base/Object', 'sap/ui/core/LocaleData', './_Calendars'],
239
326
  };
240
327
  };
241
328
 
242
- UniversalDate.getFirstDateOfWeek = function(sCalendarType, iYear, iWeek) {
243
- var oLocale = sap.ui.getCore().getConfiguration().getFormatSettings().getFormatLocale(),
244
- oLocaleData = LocaleData.getInstance(oLocale),
245
- clDate = this.getClass(sCalendarType),
246
- oFirstDay = getFirstDayOfFirstWeek(clDate, iYear),
247
- oDate = new clDate(oFirstDay.valueOf() + iWeek * iMillisecondsInWeek),
248
- bIsRegionUS = oLocaleData.firstDayStartsFirstWeek();
249
- //If first day of week is in last year and region is US, return the
250
- //1st of January instead for symmetric behaviour
251
-
252
- if (bIsRegionUS && iWeek === 0 && oFirstDay.getUTCFullYear() < iYear) {
329
+ /**
330
+ * Retrieves the first day's date of the given week in the given year.
331
+ *
332
+ * @param {string} sCalendarType the calendar type, e.g. <code>"Gregorian"</code>
333
+ * @param {int} iYear year, e.g. <code>2016</code>
334
+ * @param {int} iWeek the calendar week index, e.g. <code>8</code>
335
+ * @param {sap.ui.core.Locale} [oLocale] the locale used for the week calculation, if oWeekConfig is not provided (falls back to the formatLocale)
336
+ * e.g. <code>new Locale("de-DE")</code>
337
+ * @param {sap.ui.core.date.CalendarWeekNumbering} [sCalendarWeekNumbering]
338
+ * calendar week numbering,
339
+ * the default is derived from <code>oLocale</code> but this parameter has precedence over oLocale if both are provided.
340
+ * If calendar week numbering is not determined from the locale then {@link LocaleData#firstDayStartsFirstWeek} is ignored.
341
+ * @returns {{month: int, year: int, day: int}} the resulting date, e.g. <code>{year: 2016, month: 1, day: 29}</code>
342
+ * @private
343
+ * @throws {TypeError} If <code>sCalendarWeekNumbering</code> has an invalid week numbering value
344
+ */
345
+ UniversalDate.getFirstDateOfWeek = function(sCalendarType, iYear, iWeek, oLocale, sCalendarWeekNumbering) {
346
+ checkWeekConfig(sCalendarWeekNumbering);
347
+ oLocale = oLocale || sap.ui.getCore().getConfiguration().getFormatSettings().getFormatLocale();
348
+ var clDate = this.getClass(sCalendarType);
349
+ var oFirstDay = getFirstDayOfFirstWeek(clDate, iYear, oLocale, sCalendarWeekNumbering);
350
+ var oDate = new clDate(oFirstDay.valueOf() + iWeek * iMillisecondsInWeek);
351
+ var bSplitWeek = isSplitWeek(sCalendarWeekNumbering, oLocale);
352
+ if (bSplitWeek && iWeek === 0 && oFirstDay.getUTCFullYear() < iYear) {
253
353
  return {
254
354
  year: iYear,
255
355
  month: 0,
@@ -263,13 +363,60 @@ sap.ui.define(['sap/ui/base/Object', 'sap/ui/core/LocaleData', './_Calendars'],
263
363
  };
264
364
  };
265
365
 
266
- function getFirstDayOfFirstWeek(clDate, iYear) {
267
- var oLocale = sap.ui.getCore().getConfiguration().getFormatSettings().getFormatLocale(),
268
- oLocaleData = LocaleData.getInstance(oLocale),
269
- iMinDays = oLocaleData.getMinimalDaysInFirstWeek(),
270
- iFirstDayOfWeek = oLocaleData.getFirstDayOfWeek(),
271
- oFirstDay = new clDate(clDate.UTC(iYear, 0, 1)),
272
- iDayCount = 7;
366
+ /**
367
+ * Determines if the split week algorithm should be applied (the first day of the first calendar
368
+ * week of the year is January 1st).
369
+ *
370
+ * @param {sap.ui.core.date.CalendarWeekNumbering} [sCalendarWeekNumbering]
371
+ * calendar week numbering
372
+ * @param {sap.ui.core.Locale} [oLocale] the locale used for the week calculation
373
+ * @returns {boolean} if the split week should be applied
374
+ * @private
375
+ */
376
+ function isSplitWeek(sCalendarWeekNumbering, oLocale) {
377
+ oLocale = oLocale || sap.ui.getCore().getConfiguration().getFormatSettings().getFormatLocale();
378
+ var oLocaleData = LocaleData.getInstance(oLocale);
379
+ return (!sCalendarWeekNumbering ||
380
+ sCalendarWeekNumbering === CalendarWeekNumbering.Default)
381
+ && oLocaleData.firstDayStartsFirstWeek();
382
+ }
383
+
384
+ /**
385
+ * Checks the calendar week configuration
386
+ *
387
+ * @param {sap.ui.core.date.CalendarWeekNumbering} [sCalendarWeekNumbering]
388
+ * calendar week numbering
389
+ * @throws {TypeError} If <code>sCalendarWeekNumbering</code> has an invalid week numbering value
390
+ * @private
391
+ */
392
+ function checkWeekConfig(sCalendarWeekNumbering) {
393
+ if (sCalendarWeekNumbering && !Object.values(CalendarWeekNumbering).includes(sCalendarWeekNumbering)) {
394
+ throw new TypeError("Illegal format option calendarWeekNumbering: '" + sCalendarWeekNumbering + "'");
395
+ }
396
+ }
397
+
398
+ /**
399
+ * Returns the first day of the first week in the given year.
400
+ *
401
+ * @param {UniversalDate} clDate the date class
402
+ * @param {int} iYear year, e.g. <code>2016</code>
403
+ * @param {sap.ui.core.Locale} [oLocale] the locale used for the week calculation, if oWeekConfig is not provided (falls back to the formatLocale)
404
+ * e.g. <code>new Locale("de-DE")</code>
405
+ * @param {sap.ui.core.date.CalendarWeekNumbering} [sCalendarWeekNumbering]
406
+ * calendar week numbering,
407
+ * the default is derived from <code>oLocale</code> but this parameter has precedence over oLocale if both are provided.
408
+ * @returns {Date} first day of the first week in the given year, e.g. <code>Mon Jan 04 2016 01:00:00 GMT+0100</code>
409
+ * @private
410
+ */
411
+ function getFirstDayOfFirstWeek(clDate, iYear, oLocale, sCalendarWeekNumbering) {
412
+ oLocale = oLocale || sap.ui.getCore().getConfiguration().getFormatSettings().getFormatLocale();
413
+
414
+ var oWeekConfig = CalendarUtils.getWeekConfigurationValues(sCalendarWeekNumbering, oLocale);
415
+ var iMinDays = oWeekConfig.minimalDaysInFirstWeek;
416
+ var iFirstDayOfWeek = oWeekConfig.firstDayOfWeek;
417
+
418
+ var oFirstDay = new clDate(clDate.UTC(iYear, 0, 1));
419
+ var iDayCount = 7;
273
420
 
274
421
  if (isNaN(oFirstDay.getTime())) {
275
422
  throw new Error("Could not determine the first day of the week, because the date " +
@@ -81,7 +81,7 @@ sap.ui.define([
81
81
  * @param {Element[]} aItemDomRefs Array of DOM references representing the items for the navigation
82
82
  * @param {boolean} [bNotInTabChain=false] Whether the selected element should be in the tab chain or not
83
83
  *
84
- * @version 1.102.9
84
+ * @version 1.102.11
85
85
  * @alias sap.ui.core.delegate.ItemNavigation
86
86
  * @public
87
87
  */
@@ -58,7 +58,7 @@ sap.ui.define([
58
58
  *
59
59
  * @protected
60
60
  * @alias sap.ui.core.delegate.ScrollEnablement
61
- * @version 1.102.9
61
+ * @version 1.102.11
62
62
  * @author SAP SE
63
63
  */
64
64
  var ScrollEnablement = BaseObject.extend("sap.ui.core.delegate.ScrollEnablement", /** @lends sap.ui.core.delegate.ScrollEnablement.prototype */ {
@@ -37,7 +37,7 @@ sap.ui.define([
37
37
  *
38
38
  * @extends sap.ui.core.Element
39
39
  * @author SAP SE
40
- * @version 1.102.9
40
+ * @version 1.102.11
41
41
  *
42
42
  * @public
43
43
  * @since 1.52
@@ -22,7 +22,7 @@ sap.ui.define(["./DragInfo", "./DropInfo", "sap/ui/Device", "sap/base/Log"],
22
22
  * @extends sap.ui.core.dnd.DropInfo
23
23
  *
24
24
  * @author SAP SE
25
- * @version 1.102.9
25
+ * @version 1.102.11
26
26
  *
27
27
  * @public
28
28
  * @since 1.52
@@ -22,7 +22,7 @@ sap.ui.define(["./DragDropBase"],
22
22
  * @extends sap.ui.core.dnd.DragDropBase
23
23
  *
24
24
  * @author SAP SE
25
- * @version 1.102.9
25
+ * @version 1.102.11
26
26
  *
27
27
  * @public
28
28
  * @since 1.56
@@ -21,7 +21,7 @@ sap.ui.define(["./DragDropBase"],
21
21
  * @extends sap.ui.core.dnd.DragDropBase
22
22
  *
23
23
  * @author SAP SE
24
- * @version 1.102.9
24
+ * @version 1.102.11
25
25
  *
26
26
  * @public
27
27
  * @since 1.56