@openui5/sap.ui.core 1.107.1 → 1.108.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 (287) hide show
  1. package/.dtsgenrc +63 -0
  2. package/THIRDPARTY.txt +1 -1
  3. package/package.json +1 -1
  4. package/src/jquery.sap.global.js +1 -1
  5. package/src/jquery.sap.properties.js +1 -1
  6. package/src/jquery.sap.resources.js +1 -1
  7. package/src/jquery.sap.script.js +1 -1
  8. package/src/jquery.sap.storage.js +3 -3
  9. package/src/sap/base/i18n/ResourceBundle.js +10 -0
  10. package/src/sap/base/security/URLListValidator.js +36 -3
  11. package/src/sap/base/util/restricted/_CancelablePromise.js +1 -1
  12. package/src/sap/base/util/restricted/_castArray.js +1 -1
  13. package/src/sap/base/util/restricted/_compact.js +1 -1
  14. package/src/sap/base/util/restricted/_curry.js +1 -1
  15. package/src/sap/base/util/restricted/_debounce.js +1 -1
  16. package/src/sap/base/util/restricted/_difference.js +1 -1
  17. package/src/sap/base/util/restricted/_differenceBy.js +1 -1
  18. package/src/sap/base/util/restricted/_differenceWith.js +1 -1
  19. package/src/sap/base/util/restricted/_flatMap.js +1 -1
  20. package/src/sap/base/util/restricted/_flatMapDeep.js +1 -1
  21. package/src/sap/base/util/restricted/_flatMapDepth.js +1 -1
  22. package/src/sap/base/util/restricted/_flatten.js +1 -1
  23. package/src/sap/base/util/restricted/_flattenDeep.js +1 -1
  24. package/src/sap/base/util/restricted/_flattenDepth.js +1 -1
  25. package/src/sap/base/util/restricted/_intersection.js +1 -1
  26. package/src/sap/base/util/restricted/_intersectionBy.js +1 -1
  27. package/src/sap/base/util/restricted/_intersectionWith.js +1 -1
  28. package/src/sap/base/util/restricted/_isEqual.js +1 -1
  29. package/src/sap/base/util/restricted/_isEqualWith.js +1 -1
  30. package/src/sap/base/util/restricted/_isNil.js +1 -1
  31. package/src/sap/base/util/restricted/_max.js +1 -1
  32. package/src/sap/base/util/restricted/_merge.js +1 -1
  33. package/src/sap/base/util/restricted/_mergeWith.js +1 -1
  34. package/src/sap/base/util/restricted/_min.js +1 -1
  35. package/src/sap/base/util/restricted/_omit.js +1 -1
  36. package/src/sap/base/util/restricted/_pick.js +1 -1
  37. package/src/sap/base/util/restricted/_pickBy.js +1 -1
  38. package/src/sap/base/util/restricted/_throttle.js +1 -1
  39. package/src/sap/base/util/restricted/_toArray.js +1 -1
  40. package/src/sap/base/util/restricted/_union.js +1 -1
  41. package/src/sap/base/util/restricted/_unionBy.js +1 -1
  42. package/src/sap/base/util/restricted/_unionWith.js +1 -1
  43. package/src/sap/base/util/restricted/_uniq.js +1 -1
  44. package/src/sap/base/util/restricted/_uniqBy.js +1 -1
  45. package/src/sap/base/util/restricted/_uniqWith.js +1 -1
  46. package/src/sap/base/util/restricted/_without.js +1 -1
  47. package/src/sap/base/util/restricted/_xor.js +1 -1
  48. package/src/sap/base/util/restricted/_xorBy.js +1 -1
  49. package/src/sap/base/util/restricted/_xorWith.js +1 -1
  50. package/src/sap/base/util/restricted/_zipObject.js +1 -1
  51. package/src/sap/base/util/restricted/_zipObjectDeep.js +1 -1
  52. package/src/sap/ui/Device.js +3 -3
  53. package/src/sap/ui/Global.js +4 -4
  54. package/src/sap/ui/base/Event.js +1 -1
  55. package/src/sap/ui/base/EventProvider.js +1 -1
  56. package/src/sap/ui/base/Interface.js +1 -1
  57. package/src/sap/ui/base/ManagedObject.js +2 -2
  58. package/src/sap/ui/base/ManagedObjectMetadata.js +1 -1
  59. package/src/sap/ui/base/Metadata.js +1 -1
  60. package/src/sap/ui/base/Object.js +1 -1
  61. package/src/sap/ui/base/ObjectPool.js +1 -1
  62. package/src/sap/ui/core/.library +50 -50
  63. package/src/sap/ui/core/BusyIndicator.js +1 -1
  64. package/src/sap/ui/core/BusyIndicatorUtils.js +22 -8
  65. package/src/sap/ui/core/Component.js +21 -4
  66. package/src/sap/ui/core/ComponentContainer.js +5 -1
  67. package/src/sap/ui/core/ComponentMetadata.js +1 -1
  68. package/src/sap/ui/core/ComponentSupport.js +1 -1
  69. package/src/sap/ui/core/Configuration.js +2 -15
  70. package/src/sap/ui/core/Control.js +20 -2
  71. package/src/sap/ui/core/Core.js +311 -413
  72. package/src/sap/ui/core/CustomData.js +1 -1
  73. package/src/sap/ui/core/DeclarativeSupport.js +1 -1
  74. package/src/sap/ui/core/Element.js +1 -1
  75. package/src/sap/ui/core/ElementMetadata.js +1 -1
  76. package/src/sap/ui/core/EnabledPropagator.js +1 -1
  77. package/src/sap/ui/core/EventBus.js +1 -1
  78. package/src/sap/ui/core/FocusHandler.js +12 -14
  79. package/src/sap/ui/core/Fragment.js +5 -2
  80. package/src/sap/ui/core/HTML.js +1 -1
  81. package/src/sap/ui/core/History.js +1 -1
  82. package/src/sap/ui/core/Icon.js +1 -1
  83. package/src/sap/ui/core/IconPool.js +7 -1
  84. package/src/sap/ui/core/IndicationColorSupport.js +1 -1
  85. package/src/sap/ui/core/IntervalTrigger.js +1 -1
  86. package/src/sap/ui/core/InvisibleMessage.js +1 -1
  87. package/src/sap/ui/core/InvisibleRenderer.js +1 -1
  88. package/src/sap/ui/core/InvisibleText.js +1 -1
  89. package/src/sap/ui/core/Item.js +1 -1
  90. package/src/sap/ui/core/LabelEnablement.js +1 -1
  91. package/src/sap/ui/core/LayoutData.js +1 -1
  92. package/src/sap/ui/core/ListItem.js +1 -1
  93. package/src/sap/ui/core/LocalBusyIndicator.js +1 -1
  94. package/src/sap/ui/core/Locale.js +1 -1
  95. package/src/sap/ui/core/LocaleData.js +1 -1
  96. package/src/sap/ui/core/Manifest.js +16 -83
  97. package/src/sap/ui/core/Message.js +1 -1
  98. package/src/sap/ui/core/Popup.js +14 -4
  99. package/src/sap/ui/core/RenderManager.js +111 -109
  100. package/src/sap/ui/core/Renderer.js +1 -1
  101. package/src/sap/ui/core/ResizeHandler.js +1 -1
  102. package/src/sap/ui/core/ScrollBar.js +1 -1
  103. package/src/sap/ui/core/SeparatorItem.js +1 -1
  104. package/src/sap/ui/core/ShortcutHintsMixin.js +20 -0
  105. package/src/sap/ui/core/Title.js +1 -1
  106. package/src/sap/ui/core/TooltipBase.js +1 -1
  107. package/src/sap/ui/core/UIArea.js +4 -2
  108. package/src/sap/ui/core/UIComponent.js +1 -1
  109. package/src/sap/ui/core/UIComponentMetadata.js +1 -1
  110. package/src/sap/ui/core/ValueStateSupport.js +1 -1
  111. package/src/sap/ui/core/VariantLayoutData.js +1 -1
  112. package/src/sap/ui/core/XMLComposite.js +1 -1
  113. package/src/sap/ui/core/XMLCompositeMetadata.js +1 -1
  114. package/src/sap/ui/core/_IconRegistry.js +11 -7
  115. package/src/sap/ui/core/_UrlResolver.js +139 -0
  116. package/src/sap/ui/core/date/CalendarUtils.js +87 -0
  117. package/src/sap/ui/core/date/CalendarWeekNumbering.js +73 -0
  118. package/src/sap/ui/core/date/UniversalDate.js +198 -74
  119. package/src/sap/ui/core/delegate/ItemNavigation.js +1 -1
  120. package/src/sap/ui/core/delegate/ScrollEnablement.js +1 -1
  121. package/src/sap/ui/core/dnd/DragDropBase.js +1 -1
  122. package/src/sap/ui/core/dnd/DragDropInfo.js +1 -1
  123. package/src/sap/ui/core/dnd/DragInfo.js +1 -1
  124. package/src/sap/ui/core/dnd/DropInfo.js +1 -1
  125. package/src/sap/ui/core/format/DateFormat.js +187 -57
  126. package/src/sap/ui/core/format/NumberFormat.js +64 -23
  127. package/src/sap/ui/core/format/TimezoneUtil.js +3 -1
  128. package/src/sap/ui/core/hyphenation/Hyphenation.js +1 -1
  129. package/src/sap/ui/core/library.js +19 -10
  130. package/src/sap/ui/core/message/ControlMessageProcessor.js +1 -1
  131. package/src/sap/ui/core/message/Message.js +5 -3
  132. package/src/sap/ui/core/message/MessageManager.js +1 -1
  133. package/src/sap/ui/core/message/MessageParser.js +1 -1
  134. package/src/sap/ui/core/message/MessageProcessor.js +1 -1
  135. package/src/sap/ui/core/messagebundle_fr.properties +1 -1
  136. package/src/sap/ui/core/mvc/HTMLView.js +10 -2
  137. package/src/sap/ui/core/mvc/JSONView.js +1 -1
  138. package/src/sap/ui/core/mvc/JSView.js +1 -1
  139. package/src/sap/ui/core/mvc/TemplateView.js +1 -1
  140. package/src/sap/ui/core/mvc/View.js +1 -1
  141. package/src/sap/ui/core/mvc/XMLView.js +1 -1
  142. package/src/sap/ui/core/plugin/DeclarativeSupport.js +1 -1
  143. package/src/sap/ui/core/plugin/LessSupport.js +21 -20
  144. package/src/sap/ui/core/plugin/TemplatingSupport.js +1 -1
  145. package/src/sap/ui/core/postmessage/Bus.js +1 -1
  146. package/src/sap/ui/core/postmessage/confirmationDialog.js +1 -1
  147. package/src/sap/ui/core/search/OpenSearchProvider.js +1 -1
  148. package/src/sap/ui/core/search/SearchProvider.js +1 -1
  149. package/src/sap/ui/core/service/Service.js +1 -1
  150. package/src/sap/ui/core/service/ServiceFactory.js +1 -1
  151. package/src/sap/ui/core/service/ServiceFactoryRegistry.js +1 -1
  152. package/src/sap/ui/core/support/Plugin.js +1 -1
  153. package/src/sap/ui/core/support/Support.js +1 -1
  154. package/src/sap/ui/core/support/plugins/ControlTree.js +1 -1
  155. package/src/sap/ui/core/support/plugins/Interaction.js +1 -1
  156. package/src/sap/ui/core/support/plugins/LocalStorage.js +1 -1
  157. package/src/sap/ui/core/support/plugins/Performance.js +1 -1
  158. package/src/sap/ui/core/support/plugins/Selector.js +1 -1
  159. package/src/sap/ui/core/support/plugins/TechInfo.js +1 -1
  160. package/src/sap/ui/core/support/plugins/Trace.js +1 -1
  161. package/src/sap/ui/core/support/plugins/ViewInfo.js +1 -1
  162. package/src/sap/ui/core/themes/base/LocalBusyIndicator.less +3 -3
  163. package/src/sap/ui/core/themes/base/fonts/SAP-icons.woff2 +0 -0
  164. package/src/sap/ui/core/theming/Parameters.js +31 -12
  165. package/src/sap/ui/core/theming/ThemeHelper.js +56 -1
  166. package/src/sap/ui/core/theming/ThemeManager.js +817 -0
  167. package/src/sap/ui/core/tmpl/DOMAttribute.js +1 -1
  168. package/src/sap/ui/core/tmpl/DOMElement.js +1 -1
  169. package/src/sap/ui/core/tmpl/HandlebarsTemplate.js +1 -1
  170. package/src/sap/ui/core/tmpl/Template.js +1 -1
  171. package/src/sap/ui/core/tmpl/TemplateControl.js +1 -1
  172. package/src/sap/ui/core/util/AsyncHintsHelper.js +1 -1
  173. package/src/sap/ui/core/util/Export.js +1 -1
  174. package/src/sap/ui/core/util/ExportCell.js +1 -1
  175. package/src/sap/ui/core/util/ExportColumn.js +1 -1
  176. package/src/sap/ui/core/util/ExportRow.js +1 -1
  177. package/src/sap/ui/core/util/ExportType.js +1 -1
  178. package/src/sap/ui/core/util/ExportTypeCSV.js +1 -1
  179. package/src/sap/ui/core/util/File.js +1 -1
  180. package/src/sap/ui/core/util/LibraryInfo.js +1 -1
  181. package/src/sap/ui/core/util/MockServer.js +1 -1
  182. package/src/sap/ui/core/util/PasteHelper.js +1 -1
  183. package/src/sap/ui/core/util/serializer/HTMLViewSerializer.js +2 -1
  184. package/src/sap/ui/core/util/serializer/Serializer.js +1 -1
  185. package/src/sap/ui/core/util/serializer/ViewSerializer.js +1 -1
  186. package/src/sap/ui/core/util/serializer/XMLViewSerializer.js +1 -1
  187. package/src/sap/ui/core/util/serializer/delegate/Delegate.js +1 -1
  188. package/src/sap/ui/core/util/serializer/delegate/HTML.js +1 -1
  189. package/src/sap/ui/core/util/serializer/delegate/XML.js +1 -1
  190. package/src/sap/ui/core/ws/ReadyState.js +1 -1
  191. package/src/sap/ui/core/ws/SapPcpWebSocket.js +1 -1
  192. package/src/sap/ui/core/ws/WebSocket.js +1 -1
  193. package/src/sap/ui/debug/ControlTree.js +1 -1
  194. package/src/sap/ui/debug/DebugEnv.js +1 -1
  195. package/src/sap/ui/debug/PropertyList.js +1 -1
  196. package/src/sap/ui/dom/getFirstEditableInput.js +25 -6
  197. package/src/sap/ui/dom/includeStylesheet.js +2 -2
  198. package/src/sap/ui/model/ClientListBinding.js +11 -4
  199. package/src/sap/ui/model/ClientModel.js +1 -1
  200. package/src/sap/ui/model/ClientTreeBinding.js +60 -5
  201. package/src/sap/ui/model/CompositeDataState.js +1 -1
  202. package/src/sap/ui/model/CompositeType.js +1 -1
  203. package/src/sap/ui/model/DataState.js +1 -1
  204. package/src/sap/ui/model/Filter.js +6 -6
  205. package/src/sap/ui/model/MetaModel.js +1 -1
  206. package/src/sap/ui/model/Model.js +1 -1
  207. package/src/sap/ui/model/SelectionModel.js +1 -1
  208. package/src/sap/ui/model/SimpleType.js +1 -1
  209. package/src/sap/ui/model/Sorter.js +6 -4
  210. package/src/sap/ui/model/TreeAutoExpandMode.js +1 -1
  211. package/src/sap/ui/model/TreeBinding.js +18 -0
  212. package/src/sap/ui/model/TreeBindingCompatibilityAdapter.js +1 -1
  213. package/src/sap/ui/model/Type.js +1 -1
  214. package/src/sap/ui/model/analytics/AnalyticalTreeBindingAdapter.js +28 -34
  215. package/src/sap/ui/model/controlhelper/TreeBindingProxy.js +590 -0
  216. package/src/sap/ui/model/json/JSONModel.js +1 -1
  217. package/src/sap/ui/model/message/MessageModel.js +1 -1
  218. package/src/sap/ui/model/odata/ODataAnnotations.js +1 -1
  219. package/src/sap/ui/model/odata/ODataMessageParser.js +1 -1
  220. package/src/sap/ui/model/odata/ODataMetaModel.js +1 -1
  221. package/src/sap/ui/model/odata/ODataMetadata.js +1 -1
  222. package/src/sap/ui/model/odata/ODataModel.js +1 -1
  223. package/src/sap/ui/model/odata/type/Boolean.js +1 -1
  224. package/src/sap/ui/model/odata/type/Byte.js +1 -1
  225. package/src/sap/ui/model/odata/type/Currency.js +1 -1
  226. package/src/sap/ui/model/odata/type/Date.js +1 -1
  227. package/src/sap/ui/model/odata/type/DateTime.js +1 -1
  228. package/src/sap/ui/model/odata/type/DateTimeBase.js +1 -1
  229. package/src/sap/ui/model/odata/type/DateTimeOffset.js +1 -1
  230. package/src/sap/ui/model/odata/type/DateTimeWithTimezone.js +1 -1
  231. package/src/sap/ui/model/odata/type/Decimal.js +1 -1
  232. package/src/sap/ui/model/odata/type/Double.js +1 -1
  233. package/src/sap/ui/model/odata/type/Guid.js +1 -1
  234. package/src/sap/ui/model/odata/type/Int.js +1 -1
  235. package/src/sap/ui/model/odata/type/Int16.js +1 -1
  236. package/src/sap/ui/model/odata/type/Int32.js +1 -1
  237. package/src/sap/ui/model/odata/type/Int64.js +1 -1
  238. package/src/sap/ui/model/odata/type/ODataType.js +1 -1
  239. package/src/sap/ui/model/odata/type/Raw.js +1 -1
  240. package/src/sap/ui/model/odata/type/SByte.js +1 -1
  241. package/src/sap/ui/model/odata/type/Single.js +1 -1
  242. package/src/sap/ui/model/odata/type/Stream.js +1 -1
  243. package/src/sap/ui/model/odata/type/String.js +1 -1
  244. package/src/sap/ui/model/odata/type/Time.js +1 -1
  245. package/src/sap/ui/model/odata/type/TimeOfDay.js +1 -1
  246. package/src/sap/ui/model/odata/type/Unit.js +1 -1
  247. package/src/sap/ui/model/odata/v2/BatchMode.js +2 -2
  248. package/src/sap/ui/model/odata/v2/Context.js +169 -4
  249. package/src/sap/ui/model/odata/v2/ODataAnnotations.js +1 -1
  250. package/src/sap/ui/model/odata/v2/ODataListBinding.js +39 -17
  251. package/src/sap/ui/model/odata/v2/ODataModel.js +219 -82
  252. package/src/sap/ui/model/odata/v2/ODataTreeBinding.js +1 -1
  253. package/src/sap/ui/model/odata/v4/Context.js +35 -22
  254. package/src/sap/ui/model/odata/v4/ODataBinding.js +28 -22
  255. package/src/sap/ui/model/odata/v4/ODataContextBinding.js +6 -6
  256. package/src/sap/ui/model/odata/v4/ODataListBinding.js +111 -89
  257. package/src/sap/ui/model/odata/v4/ODataMetaModel.js +5 -4
  258. package/src/sap/ui/model/odata/v4/ODataModel.js +84 -46
  259. package/src/sap/ui/model/odata/v4/ODataParentBinding.js +19 -20
  260. package/src/sap/ui/model/odata/v4/ODataPropertyBinding.js +3 -3
  261. package/src/sap/ui/model/odata/v4/_AnnotationHelperExpression.js +1 -1
  262. package/src/sap/ui/model/odata/v4/lib/_AggregationCache.js +12 -5
  263. package/src/sap/ui/model/odata/v4/lib/_Cache.js +130 -64
  264. package/src/sap/ui/model/odata/v4/lib/_Helper.js +1 -1
  265. package/src/sap/ui/model/odata/v4/lib/_Requestor.js +56 -15
  266. package/src/sap/ui/model/resource/ResourceModel.js +1 -1
  267. package/src/sap/ui/model/type/Boolean.js +1 -1
  268. package/src/sap/ui/model/type/Currency.js +1 -1
  269. package/src/sap/ui/model/type/Date.js +1 -1
  270. package/src/sap/ui/model/type/DateInterval.js +1 -1
  271. package/src/sap/ui/model/type/DateTime.js +1 -1
  272. package/src/sap/ui/model/type/DateTimeInterval.js +1 -1
  273. package/src/sap/ui/model/type/FileSize.js +1 -1
  274. package/src/sap/ui/model/type/Float.js +1 -1
  275. package/src/sap/ui/model/type/Integer.js +1 -1
  276. package/src/sap/ui/model/type/String.js +1 -1
  277. package/src/sap/ui/model/type/Time.js +1 -1
  278. package/src/sap/ui/model/type/TimeInterval.js +1 -1
  279. package/src/sap/ui/model/type/Unit.js +1 -1
  280. package/src/sap/ui/model/xml/XMLModel.js +1 -1
  281. package/src/sap/ui/qunit/utils/ControlIterator.js +1 -1
  282. package/src/sap/ui/qunit/utils/MemoryLeakCheck.js +1 -1
  283. package/src/sap/ui/test/TestUtils.js +20 -0
  284. package/src/sap/ui/test/generic/TestBase.js +1 -1
  285. package/src/sap/ui/thirdparty/mobify-carousel.js +0 -4
  286. package/src/sap/ui/util/Storage.js +1 -1
  287. package/src/sap/ui/core/ThemeCheck.js +0 -389
@@ -5,8 +5,23 @@
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', 'sap/ui/core/Configuration'],
9
- function(BaseObject, LocaleData, _Calendars, Configuration) {
8
+ sap.ui.define([
9
+ 'sap/ui/base/Object',
10
+ 'sap/ui/core/Configuration',
11
+ 'sap/ui/core/Locale',
12
+ 'sap/ui/core/LocaleData',
13
+ './_Calendars',
14
+ './CalendarUtils',
15
+ './CalendarWeekNumbering'
16
+ ], function(
17
+ BaseObject,
18
+ Configuration,
19
+ Locale,
20
+ LocaleData,
21
+ _Calendars,
22
+ CalendarUtils,
23
+ CalendarWeekNumbering
24
+ ) {
10
25
  "use strict";
11
26
 
12
27
 
@@ -157,60 +172,96 @@ sap.ui.define(['sap/ui/base/Object', 'sap/ui/core/LocaleData', './_Calendars', '
157
172
  /**
158
173
  * Retrieves the calendar week
159
174
  *
160
- * @param {sap.ui.core.Locale} oLocale the locale used to get the calendar week calculation properties, defaults to the formatLocale
161
- * @param {{firstDayOfWeek: int, minimalDaysInFirstWeek: int}} oWeekConfig calendar week calculation parameters,
162
- * defaults to oLocale but has precedence over oLocale if both are provided.
163
- * @returns {{week: number, year: number}} resulting calendar week, note: week index starts with <code>0</code>
175
+ * @param {sap.ui.core.Locale} [oLocale] the locale used to get the calendar week calculation properties, defaults to the formatLocale
176
+ * @param {sap.ui.core.date.CalendarWeekNumbering|{firstDayOfWeek: int, minimalDaysInFirstWeek: int}} [vCalendarWeekNumbering]
177
+ * calendar week numbering or object with fields <code>firstDayOfWeek</code> and <code>minimalDaysInFirstWeek</code>,
178
+ * the default is derived from <code>oLocale</code> but this parameter has precedence over oLocale if both are provided.
179
+ * In case an object is provided, both properties <code>firstDayOfWeek</code> and <code>minimalDaysInFirstWeek</code> must be set, otherwise an error is thrown.
180
+ * If calendar week numbering is not determined from the locale then {@link LocaleData#firstDayStartsFirstWeek} is ignored.
181
+ * e.g. <code>{firstDayOfWeek: 1, minimalDaysInFirstWeek: 4}</code>
182
+ * @returns {{week: int, year: int}} resulting calendar week, note: week index starts with <code>0</code>
164
183
  * @private
184
+ * @throws {TypeError} If:
185
+ * <ul>
186
+ * <li>vCalendarWeekNumbering is an object and the fields <code>firstDayOfWeek</code> or <code>minimalDaysInFirstWeek</code>) are missing or have a non-numeric value</li>
187
+ * <li>vCalendarWeekNumbering is a string and has an invalid week numbering value</li>
188
+ * </ul>
165
189
  */
166
- UniversalDate.prototype.getWeek = function(oLocale, oWeekConfig) {
167
- checkWeekConfig(oWeekConfig);
168
- return UniversalDate.getWeekByDate(this.sCalendarType, this.getFullYear(), this.getMonth(), this.getDate(), oLocale, oWeekConfig);
190
+ UniversalDate.prototype.getWeek = function(oLocale, vCalendarWeekNumbering) {
191
+ checkWeekConfig(vCalendarWeekNumbering);
192
+ return UniversalDate.getWeekByDate(this.sCalendarType, this.getFullYear(), this.getMonth(), this.getDate(), oLocale, vCalendarWeekNumbering);
169
193
  };
170
194
 
171
195
  /**
172
196
  * Sets the calendar week
173
197
  *
174
- * @param {{week: number, year: number}} oWeek the calendar week, note: week index starts with <code>0</code>,
198
+ * @param {{week: int, year: int}} oWeek the calendar week, note: week index starts with <code>0</code>,
175
199
  * <code>oWeek.year</code> is optional and defaults to {@link sap.ui.core.date.UniversalDate#getFullYear}
176
- * @param {sap.ui.core.Locale} oLocale the locale used to get the calendar week calculation properties, defaults to the formatLocale
177
- * @param {{firstDayOfWeek: int, minimalDaysInFirstWeek: int}} oWeekConfig calendar week calculation parameters,
178
- * defaults to oLocale but has precedence over oLocale if both are provided.
200
+ * @param {sap.ui.core.Locale} [oLocale] the locale used to get the calendar week calculation properties, defaults to the formatLocale
201
+ * @param {sap.ui.core.date.CalendarWeekNumbering|{firstDayOfWeek: int, minimalDaysInFirstWeek: int}} [vCalendarWeekNumbering]
202
+ * calendar week numbering or object with fields <code>firstDayOfWeek</code> and <code>minimalDaysInFirstWeek</code>,
203
+ * the default is derived from <code>oLocale</code> but this parameter has precedence over oLocale if both are provided.
204
+ * In case an object is provided, both properties <code>firstDayOfWeek</code> and <code>minimalDaysInFirstWeek</code> must be set, otherwise an error is thrown.
205
+ * If calendar week numbering is not determined from the locale then {@link LocaleData#firstDayStartsFirstWeek} is ignored.
206
+ * e.g. <code>{firstDayOfWeek: 1, minimalDaysInFirstWeek: 4}</code>
179
207
  * @private
208
+ * @throws {TypeError} If:
209
+ * <ul>
210
+ * <li>vCalendarWeekNumbering is an object and the fields <code>firstDayOfWeek</code> or <code>minimalDaysInFirstWeek</code>) are missing or have a non-numeric value</li>
211
+ * <li>vCalendarWeekNumbering is a string and has an invalid week numbering value</li>
212
+ * </ul>
180
213
  */
181
- UniversalDate.prototype.setWeek = function(oWeek, oLocale, oWeekConfig) {
182
- checkWeekConfig(oWeekConfig);
183
- var oDate = UniversalDate.getFirstDateOfWeek(this.sCalendarType, oWeek.year || this.getFullYear(), oWeek.week, oLocale, oWeekConfig);
214
+ UniversalDate.prototype.setWeek = function(oWeek, oLocale, vCalendarWeekNumbering) {
215
+ checkWeekConfig(vCalendarWeekNumbering);
216
+ var oDate = UniversalDate.getFirstDateOfWeek(this.sCalendarType, oWeek.year || this.getFullYear(), oWeek.week, oLocale, vCalendarWeekNumbering);
184
217
  this.setFullYear(oDate.year, oDate.month, oDate.day);
185
218
  };
186
219
 
187
220
  /**
188
221
  * Retrieves the UTC calendar week
189
222
  *
190
- * @param {sap.ui.core.Locale} oLocale the locale used to get the calendar week calculation properties, defaults to the formatLocale
191
- * @param {{firstDayOfWeek: int, minimalDaysInFirstWeek: int}} oWeekConfig calendar week calculation parameters,
192
- * defaults to oLocale but has precedence over oLocale if both are provided.
193
- * @returns {{week: number, year: number}} resulting calendar week, note: week index starts with <code>0</code>
223
+ * @param {sap.ui.core.Locale} [oLocale] the locale used to get the calendar week calculation properties, defaults to the formatLocale
224
+ * @param {sap.ui.core.date.CalendarWeekNumbering|{firstDayOfWeek: int, minimalDaysInFirstWeek: int}} [vCalendarWeekNumbering]
225
+ * calendar week numbering or object with fields <code>firstDayOfWeek</code> and <code>minimalDaysInFirstWeek</code>,
226
+ * the default is derived from <code>oLocale</code> but this parameter has precedence over oLocale if both are provided.
227
+ * In case an object is provided, both properties <code>firstDayOfWeek</code> and <code>minimalDaysInFirstWeek</code> must be set, otherwise an error is thrown.
228
+ * If calendar week numbering is not determined from the locale then {@link LocaleData#firstDayStartsFirstWeek} is ignored.
229
+ * e.g. <code>{firstDayOfWeek: 1, minimalDaysInFirstWeek: 4}</code>
230
+ * @returns {{week: int, year: int}} resulting calendar week, note: week index starts with <code>0</code>
194
231
  * @private
232
+ * @throws {TypeError} If:
233
+ * <ul>
234
+ * <li>vCalendarWeekNumbering is an object and the fields <code>firstDayOfWeek</code> or <code>minimalDaysInFirstWeek</code>) are missing or have a non-numeric value</li>
235
+ * <li>vCalendarWeekNumbering is a string and has an invalid week numbering value</li>
236
+ * </ul>
195
237
  */
196
- UniversalDate.prototype.getUTCWeek = function(oLocale, oWeekConfig) {
197
- checkWeekConfig(oWeekConfig);
198
- return UniversalDate.getWeekByDate(this.sCalendarType, this.getUTCFullYear(), this.getUTCMonth(), this.getUTCDate(), oLocale, oWeekConfig);
238
+ UniversalDate.prototype.getUTCWeek = function(oLocale, vCalendarWeekNumbering) {
239
+ checkWeekConfig(vCalendarWeekNumbering);
240
+ return UniversalDate.getWeekByDate(this.sCalendarType, this.getUTCFullYear(), this.getUTCMonth(), this.getUTCDate(), oLocale, vCalendarWeekNumbering);
199
241
  };
200
242
 
201
243
  /**
202
244
  * Sets the UTC calendar week
203
245
  *
204
- * @param {{week: number, year: number}} oWeek the calendar week, note: week index starts with <code>0</code>,
246
+ * @param {{week: int, year: int}} oWeek the calendar week, note: week index starts with <code>0</code>,
205
247
  * <code>oWeek.year</code> is optional and defaults to {@link sap.ui.core.date.UniversalDate#getFullYear}
206
- * @param {sap.ui.core.Locale} oLocale the locale used to get the calendar week calculation properties, defaults to the formatLocale
207
- * @param {{firstDayOfWeek: int, minimalDaysInFirstWeek: int}} oWeekConfig calendar week calculation parameters,
208
- * defaults to oLocale but has precedence over oLocale if both are provided.
248
+ * @param {sap.ui.core.Locale} [oLocale] the locale used to get the calendar week calculation properties, defaults to the formatLocale
249
+ * @param {sap.ui.core.date.CalendarWeekNumbering|{firstDayOfWeek: int, minimalDaysInFirstWeek: int}} [vCalendarWeekNumbering]
250
+ * calendar week numbering or object with fields <code>firstDayOfWeek</code> and <code>minimalDaysInFirstWeek</code>,
251
+ * the default is derived from <code>oLocale</code> but this parameter has precedence over oLocale if both are provided.
252
+ * In case an object is provided, both properties <code>firstDayOfWeek</code> and <code>minimalDaysInFirstWeek</code> must be set, otherwise an error is thrown.
253
+ * If calendar week numbering is not determined from the locale then {@link LocaleData#firstDayStartsFirstWeek} is ignored.
254
+ * e.g. <code>{firstDayOfWeek: 1, minimalDaysInFirstWeek: 4}</code>
209
255
  * @private
256
+ * @throws {TypeError} If:
257
+ * <ul>
258
+ * <li>vCalendarWeekNumbering is an object and the fields <code>firstDayOfWeek</code> or <code>minimalDaysInFirstWeek</code>) are missing or have a non-numeric value</li>
259
+ * <li>vCalendarWeekNumbering is a string and has an invalid week numbering value</li>
260
+ * </ul>
210
261
  */
211
- UniversalDate.prototype.setUTCWeek = function(oWeek, oLocale, oWeekConfig) {
212
- checkWeekConfig(oWeekConfig);
213
- var oDate = UniversalDate.getFirstDateOfWeek(this.sCalendarType, oWeek.year || this.getFullYear(), oWeek.week, oLocale, oWeekConfig);
262
+ UniversalDate.prototype.setUTCWeek = function(oWeek, oLocale, vCalendarWeekNumbering) {
263
+ checkWeekConfig(vCalendarWeekNumbering);
264
+ var oDate = UniversalDate.getFirstDateOfWeek(this.sCalendarType, oWeek.year || this.getFullYear(), oWeek.week, oLocale, vCalendarWeekNumbering);
214
265
  this.setUTCFullYear(oDate.year, oDate.month, oDate.day);
215
266
  };
216
267
  UniversalDate.prototype.getQuarter = function() {
@@ -262,31 +313,35 @@ sap.ui.define(['sap/ui/base/Object', 'sap/ui/core/LocaleData', './_Calendars', '
262
313
  * @param {int} iDay the date, e.g. <code>3</code>
263
314
  * @param {sap.ui.core.Locale} [oLocale] the locale used for the week calculation, if oWeekConfig is not provided (falls back to the formatLocale)
264
315
  * e.g. <code>new Locale("de-DE")</code>
265
- * @param {{firstDayOfWeek: int, minimalDaysInFirstWeek: int}} [oWeekConfig] calendar week calculation parameters,
266
- * defaults to oLocale but has precedence over oLocale if both are provided.
267
- * Both properties firstDayOfWeek and minimalDaysInFirstWeek must be provided, otherwise it will be ignored.
268
- * If provided US split week is ignored.
316
+ * @param {sap.ui.core.date.CalendarWeekNumbering|{firstDayOfWeek: int, minimalDaysInFirstWeek: int}} [vCalendarWeekNumbering]
317
+ * calendar week numbering or object with fields <code>firstDayOfWeek</code> and <code>minimalDaysInFirstWeek</code>,
318
+ * the default is derived from <code>oLocale</code> but this parameter has precedence over oLocale if both are provided.
319
+ * In case an object is provided, both properties <code>firstDayOfWeek</code> and <code>minimalDaysInFirstWeek</code> must be set, otherwise an error is thrown.
320
+ * If calendar week numbering is not determined from the locale then {@link LocaleData#firstDayStartsFirstWeek} is ignored.
269
321
  * e.g. <code>{firstDayOfWeek: 1, minimalDaysInFirstWeek: 4}</code>
270
- * @returns {{week: number, year: number}} resulting calendar week, note: week index starts with <code>0</code>, e.g. <code>{year: 2016, week: 8}</code>
322
+ * @returns {{week: int, year: int}} resulting calendar week, note: week index starts with <code>0</code>, e.g. <code>{year: 2016, week: 8}</code>
271
323
  * @private
324
+ * @throws {TypeError} If:
325
+ * <ul>
326
+ * <li>vCalendarWeekNumbering is an object and the fields <code>firstDayOfWeek</code> or <code>minimalDaysInFirstWeek</code>) are missing or have a non-numeric value</li>
327
+ * <li>vCalendarWeekNumbering is a string and has an invalid week numbering value</li>
328
+ * </ul>
272
329
  */
273
- UniversalDate.getWeekByDate = function(sCalendarType, iYear, iMonth, iDay, oLocale, oWeekConfig) {
330
+ UniversalDate.getWeekByDate = function(sCalendarType, iYear, iMonth, iDay, oLocale, vCalendarWeekNumbering) {
331
+ checkWeekConfig(vCalendarWeekNumbering);
274
332
  oLocale = oLocale || Configuration.getFormatSettings().getFormatLocale();
275
- var oLocaleData = LocaleData.getInstance(oLocale);
276
333
  var clDate = this.getClass(sCalendarType);
277
- var oFirstDay = getFirstDayOfFirstWeek(clDate, iYear, oLocale, oWeekConfig);
334
+ var oFirstDay = getFirstDayOfFirstWeek(clDate, iYear, oLocale, vCalendarWeekNumbering);
278
335
  var oDate = new clDate(clDate.UTC(iYear, iMonth, iDay));
279
336
  var iWeek, iLastYear, iNextYear, oLastFirstDay, oNextFirstDay;
280
- // If region is US, always calculate the week for the current year, otherwise
281
- // the week might be the last week of the previous year or first week of next year
282
- var bSplitWeek = (!oWeekConfig || oWeekConfig.minimalDaysInFirstWeek === undefined || oWeekConfig.firstDayOfWeek === undefined) && oLocaleData.firstDayStartsFirstWeek();
337
+ var bSplitWeek = isSplitWeek(vCalendarWeekNumbering, oLocale);
283
338
  if (bSplitWeek) {
284
339
  iWeek = calculateWeeks(oFirstDay, oDate);
285
340
  } else {
286
341
  iLastYear = iYear - 1;
287
342
  iNextYear = iYear + 1;
288
- oLastFirstDay = getFirstDayOfFirstWeek(clDate, iLastYear, oLocale, oWeekConfig);
289
- oNextFirstDay = getFirstDayOfFirstWeek(clDate, iNextYear, oLocale, oWeekConfig);
343
+ oLastFirstDay = getFirstDayOfFirstWeek(clDate, iLastYear, oLocale, vCalendarWeekNumbering);
344
+ oNextFirstDay = getFirstDayOfFirstWeek(clDate, iNextYear, oLocale, vCalendarWeekNumbering);
290
345
  if (oDate >= oNextFirstDay) {
291
346
  iYear = iNextYear;
292
347
  iWeek = 0;
@@ -311,23 +366,27 @@ sap.ui.define(['sap/ui/base/Object', 'sap/ui/core/LocaleData', './_Calendars', '
311
366
  * @param {int} iWeek the calendar week index, e.g. <code>8</code>
312
367
  * @param {sap.ui.core.Locale} [oLocale] the locale used for the week calculation, if oWeekConfig is not provided (falls back to the formatLocale)
313
368
  * e.g. <code>new Locale("de-DE")</code>
314
- * @param {{firstDayOfWeek: int, minimalDaysInFirstWeek: int}} [oWeekConfig] calendar week calculation parameters,
315
- * defaults to oLocale but has precedence over oLocale if both are provided.
316
- * Both properties firstDayOfWeek and minimalDaysInFirstWeek must be provided, otherwise it will be ignored.
317
- * If provided US split week is ignored.
369
+ * @param {sap.ui.core.date.CalendarWeekNumbering|{firstDayOfWeek: int, minimalDaysInFirstWeek: int}} [vCalendarWeekNumbering]
370
+ * calendar week numbering or object with fields <code>firstDayOfWeek</code> and <code>minimalDaysInFirstWeek</code>,
371
+ * the default is derived from <code>oLocale</code> but this parameter has precedence over oLocale if both are provided.
372
+ * In case an object is provided, both properties <code>firstDayOfWeek</code> and <code>minimalDaysInFirstWeek</code> must be set, otherwise an error is thrown.
373
+ * If calendar week numbering is not determined from the locale then {@link LocaleData#firstDayStartsFirstWeek} is ignored.
318
374
  * e.g. <code>{firstDayOfWeek: 1, minimalDaysInFirstWeek: 4}</code>
319
- * @returns {{month: number, year: number, day: number}} the resulting date, e.g. <code>{year: 2016, month: 1, day: 29}</code>
375
+ * @returns {{month: int, year: int, day: int}} the resulting date, e.g. <code>{year: 2016, month: 1, day: 29}</code>
320
376
  * @private
377
+ * @throws {TypeError} If:
378
+ * <ul>
379
+ * <li>vCalendarWeekNumbering is an object and the fields <code>firstDayOfWeek</code> or <code>minimalDaysInFirstWeek</code>) are missing or have a non-numeric value</li>
380
+ * <li>vCalendarWeekNumbering is a string and has an invalid week numbering value</li>
381
+ * </ul>
321
382
  */
322
- UniversalDate.getFirstDateOfWeek = function(sCalendarType, iYear, iWeek, oLocale, oWeekConfig) {
383
+ UniversalDate.getFirstDateOfWeek = function(sCalendarType, iYear, iWeek, oLocale, vCalendarWeekNumbering) {
384
+ checkWeekConfig(vCalendarWeekNumbering);
323
385
  oLocale = oLocale || Configuration.getFormatSettings().getFormatLocale();
324
- var oLocaleData = LocaleData.getInstance(oLocale);
325
386
  var clDate = this.getClass(sCalendarType);
326
- var oFirstDay = getFirstDayOfFirstWeek(clDate, iYear, oLocale, oWeekConfig);
387
+ var oFirstDay = getFirstDayOfFirstWeek(clDate, iYear, oLocale, vCalendarWeekNumbering);
327
388
  var oDate = new clDate(oFirstDay.valueOf() + iWeek * iMillisecondsInWeek);
328
- //If first day of week is in last year and region is US, return the
329
- //1st of January instead for symmetric behaviour
330
- var bSplitWeek = (!oWeekConfig || oWeekConfig.minimalDaysInFirstWeek === undefined || oWeekConfig.firstDayOfWeek === undefined) && oLocaleData.firstDayStartsFirstWeek();
389
+ var bSplitWeek = isSplitWeek(vCalendarWeekNumbering, oLocale);
331
390
  if (bSplitWeek && iWeek === 0 && oFirstDay.getUTCFullYear() < iYear) {
332
391
  return {
333
392
  year: iYear,
@@ -342,15 +401,86 @@ sap.ui.define(['sap/ui/base/Object', 'sap/ui/core/LocaleData', './_Calendars', '
342
401
  };
343
402
  };
344
403
 
345
- function checkWeekConfig(oWeekConfig) {
346
- if (oWeekConfig) {
347
- if (oWeekConfig.firstDayOfWeek === undefined && oWeekConfig.minimalDaysInFirstWeek !== undefined
348
- || oWeekConfig.firstDayOfWeek !== undefined && oWeekConfig.minimalDaysInFirstWeek === undefined) {
349
- throw new Error("Week config requires both firstDayOfWeek and minimalDaysInFirstWeek to be set");
404
+ /**
405
+ * Determines if the split week algorithm should be applied (the first day of the first calendar
406
+ * week of the year is January 1st).
407
+ *
408
+ * @param {sap.ui.core.date.CalendarWeekNumbering|{firstDayOfWeek: int, minimalDaysInFirstWeek: int}} [vCalendarWeekNumbering]
409
+ * calendar week numbering or object with fields <code>firstDayOfWeek</code> and
410
+ * <code>minimalDaysInFirstWeek</code>
411
+ * @param {sap.ui.core.Locale} [oLocale] the locale used for the week calculation
412
+ * @returns {boolean} if the split week should be applied
413
+ * @private
414
+ */
415
+ function isSplitWeek(vCalendarWeekNumbering, oLocale) {
416
+ oLocale = oLocale || Configuration.getFormatSettings().getFormatLocale();
417
+ var oLocaleData = LocaleData.getInstance(oLocale);
418
+ return (!isCalendarWeekConfigurationDefined(vCalendarWeekNumbering) ||
419
+ vCalendarWeekNumbering === CalendarWeekNumbering.Default)
420
+ && oLocaleData.firstDayStartsFirstWeek();
421
+ }
422
+
423
+ /**
424
+ * Checks the calendar week configuration
425
+ *
426
+ * @param {sap.ui.core.date.CalendarWeekNumbering|{firstDayOfWeek: int, minimalDaysInFirstWeek: int}} [vCalendarWeekNumbering]
427
+ * calendar week numbering or object with fields <code>firstDayOfWeek</code> and <code>minimalDaysInFirstWeek</code>
428
+ * @throws {TypeError} If:
429
+ * <ul>
430
+ * <li>vCalendarWeekNumbering is an object and the fields <code>firstDayOfWeek</code> or <code>minimalDaysInFirstWeek</code>) are missing or have a non-numeric value</li>
431
+ * <li>vCalendarWeekNumbering is a string and has an invalid week numbering value</li>
432
+ * </ul>
433
+ * @private
434
+ */
435
+ function checkWeekConfig(vCalendarWeekNumbering) {
436
+ if (typeof vCalendarWeekNumbering === "object") {
437
+ if (!isCalendarWeekConfigurationDefined(vCalendarWeekNumbering)) {
438
+ throw new TypeError("Week config requires firstDayOfWeek and minimalDaysInFirstWeek to be set");
350
439
  }
440
+ } else if (vCalendarWeekNumbering && !Object.values(CalendarWeekNumbering).includes(vCalendarWeekNumbering)) {
441
+ throw new TypeError("Illegal format option calendarWeekNumbering: '" + vCalendarWeekNumbering + "'");
351
442
  }
352
443
  }
353
444
 
445
+ /**
446
+ * Checks if the calendar week configuration is defined
447
+ *
448
+ * @param {sap.ui.core.date.CalendarWeekNumbering|{firstDayOfWeek: int, minimalDaysInFirstWeek: int}} [vCalendarWeekNumbering]
449
+ * the parameter which is checked
450
+ * @returns {boolean} if the parameter vCalendarWeekNumbering is defined and in case of an
451
+ * object has the required properties <code>firstDayOfWeek</code> and
452
+ * <code>minimalDaysInFirstWeek</code> defined with a numeric value
453
+ * @private
454
+ */
455
+ function isCalendarWeekConfigurationDefined (vCalendarWeekNumbering) {
456
+ if (typeof vCalendarWeekNumbering === "object") {
457
+ return typeof vCalendarWeekNumbering.firstDayOfWeek === "number"
458
+ && typeof vCalendarWeekNumbering.minimalDaysInFirstWeek === "number";
459
+ } else if (vCalendarWeekNumbering) {
460
+ return true;
461
+ }
462
+ return false;
463
+ }
464
+
465
+ /**
466
+ * Resolves the calendar week configuration
467
+ *
468
+ * @param {sap.ui.core.date.CalendarWeekNumbering|{firstDayOfWeek: int, minimalDaysInFirstWeek: int}} [vCalendarWeekNumbering]
469
+ * calendar week numbering or object with fields <code>firstDayOfWeek</code> and <code>minimalDaysInFirstWeek</code>
470
+ * @param {sap.ui.core.Locale} [oLocale] locale to be used
471
+ * @returns {{firstDayOfWeek: int, minimalDaysInFirstWeek: int}} calendar week calculation configuration
472
+ * @private
473
+ */
474
+ function resolveCalendarWeekConfiguration (vCalendarWeekNumbering, oLocale) {
475
+ // be backward compatible
476
+ if (typeof vCalendarWeekNumbering === "object"
477
+ && typeof vCalendarWeekNumbering.firstDayOfWeek === "number"
478
+ && typeof vCalendarWeekNumbering.minimalDaysInFirstWeek === "number") {
479
+ return vCalendarWeekNumbering;
480
+ }
481
+ return CalendarUtils.getWeekConfigurationValues(vCalendarWeekNumbering, oLocale);
482
+ }
483
+
354
484
  /**
355
485
  * Returns the first day of the first week in the given year.
356
486
  *
@@ -358,26 +488,20 @@ sap.ui.define(['sap/ui/base/Object', 'sap/ui/core/LocaleData', './_Calendars', '
358
488
  * @param {int} iYear year, e.g. <code>2016</code>
359
489
  * @param {sap.ui.core.Locale} [oLocale] the locale used for the week calculation, if oWeekConfig is not provided (falls back to the formatLocale)
360
490
  * e.g. <code>new Locale("de-DE")</code>
361
- * @param {{firstDayOfWeek: int, minimalDaysInFirstWeek: int}} [oWeekConfig] calendar week calculation parameters,
362
- * defaults to oLocale but has precedence over oLocale if both are provided.
363
- * Both properties firstDayOfWeek and minimalDaysInFirstWeek must be provided, otherwise it will be ignored.
364
- * If provided US split week is ignored.
491
+ * @param {sap.ui.core.date.CalendarWeekNumbering|{firstDayOfWeek: int, minimalDaysInFirstWeek: int}} [vCalendarWeekNumbering]
492
+ * calendar week numbering or object with fields <code>firstDayOfWeek</code> and <code>minimalDaysInFirstWeek</code>,
493
+ * the default is derived from <code>oLocale</code> but this parameter has precedence over oLocale if both are provided.
365
494
  * e.g. <code>{firstDayOfWeek: 1, minimalDaysInFirstWeek: 4}</code>
366
495
  * @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>
367
496
  * @private
368
497
  */
369
- function getFirstDayOfFirstWeek(clDate, iYear, oLocale, oWeekConfig) {
498
+ function getFirstDayOfFirstWeek(clDate, iYear, oLocale, vCalendarWeekNumbering) {
370
499
  oLocale = oLocale || Configuration.getFormatSettings().getFormatLocale();
371
- var oLocaleData = LocaleData.getInstance(oLocale);
372
- var iMinDays;
373
- var iFirstDayOfWeek;
374
- if (oWeekConfig && oWeekConfig.minimalDaysInFirstWeek !== undefined && oWeekConfig.firstDayOfWeek !== undefined) {
375
- iMinDays = oWeekConfig.minimalDaysInFirstWeek;
376
- iFirstDayOfWeek = oWeekConfig.firstDayOfWeek;
377
- } else {
378
- iMinDays = oLocaleData.getMinimalDaysInFirstWeek();
379
- iFirstDayOfWeek = oLocaleData.getFirstDayOfWeek();
380
- }
500
+
501
+ var oWeekConfig = resolveCalendarWeekConfiguration(vCalendarWeekNumbering, oLocale);
502
+ var iMinDays = oWeekConfig.minimalDaysInFirstWeek;
503
+ var iFirstDayOfWeek = oWeekConfig.firstDayOfWeek;
504
+
381
505
  var oFirstDay = new clDate(clDate.UTC(iYear, 0, 1));
382
506
  var iDayCount = 7;
383
507
 
@@ -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.107.1
84
+ * @version 1.108.0
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.107.1
61
+ * @version 1.108.0
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.107.1
40
+ * @version 1.108.0
41
41
  *
42
42
  * @public
43
43
  * @since 1.52
@@ -22,7 +22,7 @@ sap.ui.define(["./DragInfo", "./DropInfo", "sap/base/Log"],
22
22
  * @extends sap.ui.core.dnd.DropInfo
23
23
  *
24
24
  * @author SAP SE
25
- * @version 1.107.1
25
+ * @version 1.108.0
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.107.1
25
+ * @version 1.108.0
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.107.1
24
+ * @version 1.108.0
25
25
  *
26
26
  * @public
27
27
  * @since 1.56