@openui5/sap.ui.core 1.110.0 → 1.111.1

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 (279) hide show
  1. package/.eslintrc.json +1 -0
  2. package/package.json +1 -1
  3. package/src/jquery.sap.global.js +1 -1
  4. package/src/jquery.sap.properties.js +1 -1
  5. package/src/jquery.sap.resources.js +1 -1
  6. package/src/jquery.sap.script.js +1 -1
  7. package/src/jquery.sap.storage.js +3 -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 +2 -2
  60. package/src/sap/ui/core/BusyIndicator.js +1 -1
  61. package/src/sap/ui/core/Component.js +58 -50
  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/Configuration.js +4 -1
  66. package/src/sap/ui/core/Control.js +19 -7
  67. package/src/sap/ui/core/Core.js +2 -1
  68. package/src/sap/ui/core/CustomData.js +1 -1
  69. package/src/sap/ui/core/DeclarativeSupport.js +1 -1
  70. package/src/sap/ui/core/Element.js +98 -3
  71. package/src/sap/ui/core/ElementMetadata.js +1 -1
  72. package/src/sap/ui/core/EnabledPropagator.js +16 -1
  73. package/src/sap/ui/core/EventBus.js +1 -1
  74. package/src/sap/ui/core/Fragment.js +1 -1
  75. package/src/sap/ui/core/HTML.js +1 -1
  76. package/src/sap/ui/core/History.js +1 -1
  77. package/src/sap/ui/core/Icon.js +10 -6
  78. package/src/sap/ui/core/IndicationColorSupport.js +1 -1
  79. package/src/sap/ui/core/IntervalTrigger.js +1 -1
  80. package/src/sap/ui/core/InvisibleMessage.js +1 -1
  81. package/src/sap/ui/core/InvisibleRenderer.js +1 -1
  82. package/src/sap/ui/core/InvisibleText.js +1 -1
  83. package/src/sap/ui/core/Item.js +1 -1
  84. package/src/sap/ui/core/LabelEnablement.js +1 -1
  85. package/src/sap/ui/core/LayoutData.js +1 -1
  86. package/src/sap/ui/core/ListItem.js +1 -1
  87. package/src/sap/ui/core/LocalBusyIndicator.js +1 -1
  88. package/src/sap/ui/core/Locale.js +12 -11
  89. package/src/sap/ui/core/LocaleData.js +1 -1
  90. package/src/sap/ui/core/Manifest.js +1 -1
  91. package/src/sap/ui/core/Message.js +1 -1
  92. package/src/sap/ui/core/Patcher.js +35 -0
  93. package/src/sap/ui/core/Popup.js +1 -0
  94. package/src/sap/ui/core/RenderManager.js +286 -156
  95. package/src/sap/ui/core/Renderer.js +1 -1
  96. package/src/sap/ui/core/ResizeHandler.js +2 -2
  97. package/src/sap/ui/core/ScrollBar.js +1 -1
  98. package/src/sap/ui/core/SeparatorItem.js +1 -1
  99. package/src/sap/ui/core/Title.js +1 -1
  100. package/src/sap/ui/core/TooltipBase.js +1 -1
  101. package/src/sap/ui/core/UIArea.js +36 -4
  102. package/src/sap/ui/core/UIComponent.js +1 -1
  103. package/src/sap/ui/core/UIComponentMetadata.js +1 -1
  104. package/src/sap/ui/core/ValueStateSupport.js +1 -1
  105. package/src/sap/ui/core/VariantLayoutData.js +1 -1
  106. package/src/sap/ui/core/XMLComposite.js +1 -1
  107. package/src/sap/ui/core/XMLCompositeMetadata.js +1 -1
  108. package/src/sap/ui/core/_IconRegistry.js +1 -0
  109. package/src/sap/ui/core/cache/CacheManager.js +1 -1
  110. package/src/sap/ui/core/date/UI5Date.js +970 -0
  111. package/src/sap/ui/core/date/UniversalDate.js +803 -39
  112. package/src/sap/ui/core/date/UniversalDateUtils.js +170 -14
  113. package/src/sap/ui/core/delegate/ItemNavigation.js +1 -1
  114. package/src/sap/ui/core/delegate/ScrollEnablement.js +1 -1
  115. package/src/sap/ui/core/dnd/DragAndDrop.js +26 -15
  116. package/src/sap/ui/core/dnd/DragDropBase.js +1 -1
  117. package/src/sap/ui/core/dnd/DragDropInfo.js +1 -1
  118. package/src/sap/ui/core/dnd/DragInfo.js +5 -8
  119. package/src/sap/ui/core/dnd/DropInfo.js +1 -1
  120. package/src/sap/ui/core/format/DateFormat.js +39 -29
  121. package/src/sap/ui/core/format/FileSizeFormat.js +1 -0
  122. package/src/sap/ui/core/format/ListFormat.js +1 -0
  123. package/src/sap/ui/core/format/NumberFormat.js +31 -56
  124. package/src/sap/ui/core/format/TimezoneUtil.js +9 -7
  125. package/src/sap/ui/core/hyphenation/Hyphenation.js +1 -1
  126. package/src/sap/ui/core/library.js +22 -3
  127. package/src/sap/ui/core/message/ControlMessageProcessor.js +1 -1
  128. package/src/sap/ui/core/message/Message.js +1 -1
  129. package/src/sap/ui/core/message/MessageManager.js +1 -1
  130. package/src/sap/ui/core/message/MessageParser.js +1 -1
  131. package/src/sap/ui/core/message/MessageProcessor.js +1 -1
  132. package/src/sap/ui/core/mvc/HTMLView.js +1 -1
  133. package/src/sap/ui/core/mvc/JSONView.js +1 -1
  134. package/src/sap/ui/core/mvc/JSView.js +1 -1
  135. package/src/sap/ui/core/mvc/TemplateView.js +1 -1
  136. package/src/sap/ui/core/mvc/View.js +1 -1
  137. package/src/sap/ui/core/mvc/XMLView.js +1 -1
  138. package/src/sap/ui/core/plugin/DeclarativeSupport.js +1 -1
  139. package/src/sap/ui/core/plugin/LessSupport.js +1 -1
  140. package/src/sap/ui/core/plugin/TemplatingSupport.js +1 -1
  141. package/src/sap/ui/core/postmessage/Bus.js +1 -1
  142. package/src/sap/ui/core/postmessage/confirmationDialog.js +1 -1
  143. package/src/sap/ui/core/routing/Router.js +4 -3
  144. package/src/sap/ui/core/search/OpenSearchProvider.js +1 -1
  145. package/src/sap/ui/core/search/SearchProvider.js +1 -1
  146. package/src/sap/ui/core/service/Service.js +1 -1
  147. package/src/sap/ui/core/service/ServiceFactory.js +1 -1
  148. package/src/sap/ui/core/service/ServiceFactoryRegistry.js +1 -1
  149. package/src/sap/ui/core/support/Plugin.js +1 -1
  150. package/src/sap/ui/core/support/Support.js +1 -1
  151. package/src/sap/ui/core/support/plugins/ControlTree.js +14 -20
  152. package/src/sap/ui/core/support/plugins/Interaction.js +1 -1
  153. package/src/sap/ui/core/support/plugins/LocalStorage.js +1 -1
  154. package/src/sap/ui/core/support/plugins/Performance.js +1 -1
  155. package/src/sap/ui/core/support/plugins/Selector.js +1 -1
  156. package/src/sap/ui/core/support/plugins/TechInfo.js +1 -1
  157. package/src/sap/ui/core/support/plugins/Trace.js +1 -1
  158. package/src/sap/ui/core/support/plugins/ViewInfo.js +1 -1
  159. package/src/sap/ui/core/tmpl/DOMAttribute.js +1 -1
  160. package/src/sap/ui/core/tmpl/DOMElement.js +1 -1
  161. package/src/sap/ui/core/tmpl/HandlebarsTemplate.js +1 -1
  162. package/src/sap/ui/core/tmpl/Template.js +1 -1
  163. package/src/sap/ui/core/tmpl/TemplateControl.js +1 -1
  164. package/src/sap/ui/core/util/AsyncHintsHelper.js +1 -1
  165. package/src/sap/ui/core/util/Export.js +1 -1
  166. package/src/sap/ui/core/util/ExportCell.js +1 -1
  167. package/src/sap/ui/core/util/ExportColumn.js +1 -1
  168. package/src/sap/ui/core/util/ExportRow.js +1 -1
  169. package/src/sap/ui/core/util/ExportType.js +1 -1
  170. package/src/sap/ui/core/util/ExportTypeCSV.js +1 -1
  171. package/src/sap/ui/core/util/File.js +1 -1
  172. package/src/sap/ui/core/util/LibraryInfo.js +1 -1
  173. package/src/sap/ui/core/util/MockServer.js +1 -1
  174. package/src/sap/ui/core/util/PasteHelper.js +1 -1
  175. package/src/sap/ui/core/util/XMLPreprocessor.js +1 -0
  176. package/src/sap/ui/core/util/serializer/HTMLViewSerializer.js +1 -1
  177. package/src/sap/ui/core/util/serializer/Serializer.js +1 -1
  178. package/src/sap/ui/core/util/serializer/ViewSerializer.js +1 -1
  179. package/src/sap/ui/core/util/serializer/XMLViewSerializer.js +1 -1
  180. package/src/sap/ui/core/util/serializer/delegate/Delegate.js +1 -1
  181. package/src/sap/ui/core/util/serializer/delegate/HTML.js +1 -1
  182. package/src/sap/ui/core/util/serializer/delegate/XML.js +1 -1
  183. package/src/sap/ui/core/ws/ReadyState.js +1 -1
  184. package/src/sap/ui/core/ws/SapPcpWebSocket.js +1 -1
  185. package/src/sap/ui/core/ws/WebSocket.js +2 -1
  186. package/src/sap/ui/debug/ControlTree.js +1 -1
  187. package/src/sap/ui/debug/DebugEnv.js +1 -1
  188. package/src/sap/ui/debug/PropertyList.js +1 -1
  189. package/src/sap/ui/dom/isBehindOtherElement.js +11 -3
  190. package/src/sap/ui/model/ClientModel.js +1 -1
  191. package/src/sap/ui/model/CompositeDataState.js +1 -1
  192. package/src/sap/ui/model/CompositeType.js +1 -1
  193. package/src/sap/ui/model/DataState.js +1 -1
  194. package/src/sap/ui/model/MetaModel.js +1 -1
  195. package/src/sap/ui/model/Model.js +1 -11
  196. package/src/sap/ui/model/SelectionModel.js +1 -1
  197. package/src/sap/ui/model/SimpleType.js +1 -1
  198. package/src/sap/ui/model/TreeAutoExpandMode.js +1 -1
  199. package/src/sap/ui/model/Type.js +1 -1
  200. package/src/sap/ui/model/analytics/AnalyticalBinding.js +5 -1
  201. package/src/sap/ui/model/controlhelper/TreeBindingProxy.js +29 -15
  202. package/src/sap/ui/model/json/JSONModel.js +1 -1
  203. package/src/sap/ui/model/message/MessageModel.js +1 -1
  204. package/src/sap/ui/model/odata/ODataAnnotations.js +1 -1
  205. package/src/sap/ui/model/odata/ODataMessageParser.js +1 -1
  206. package/src/sap/ui/model/odata/ODataMetaModel.js +2 -2
  207. package/src/sap/ui/model/odata/ODataMetadata.js +1 -1
  208. package/src/sap/ui/model/odata/ODataModel.js +1 -1
  209. package/src/sap/ui/model/odata/type/Boolean.js +1 -1
  210. package/src/sap/ui/model/odata/type/Byte.js +1 -1
  211. package/src/sap/ui/model/odata/type/Currency.js +1 -1
  212. package/src/sap/ui/model/odata/type/Date.js +57 -21
  213. package/src/sap/ui/model/odata/type/DateTime.js +32 -3
  214. package/src/sap/ui/model/odata/type/DateTimeBase.js +62 -25
  215. package/src/sap/ui/model/odata/type/DateTimeOffset.js +35 -5
  216. package/src/sap/ui/model/odata/type/DateTimeWithTimezone.js +6 -5
  217. package/src/sap/ui/model/odata/type/Decimal.js +1 -1
  218. package/src/sap/ui/model/odata/type/Double.js +1 -1
  219. package/src/sap/ui/model/odata/type/Guid.js +1 -1
  220. package/src/sap/ui/model/odata/type/Int.js +1 -1
  221. package/src/sap/ui/model/odata/type/Int16.js +1 -1
  222. package/src/sap/ui/model/odata/type/Int32.js +1 -1
  223. package/src/sap/ui/model/odata/type/Int64.js +1 -1
  224. package/src/sap/ui/model/odata/type/ODataType.js +1 -1
  225. package/src/sap/ui/model/odata/type/Raw.js +1 -1
  226. package/src/sap/ui/model/odata/type/SByte.js +1 -1
  227. package/src/sap/ui/model/odata/type/Single.js +1 -1
  228. package/src/sap/ui/model/odata/type/Stream.js +1 -1
  229. package/src/sap/ui/model/odata/type/String.js +1 -1
  230. package/src/sap/ui/model/odata/type/Time.js +37 -2
  231. package/src/sap/ui/model/odata/type/TimeOfDay.js +39 -4
  232. package/src/sap/ui/model/odata/type/Unit.js +1 -1
  233. package/src/sap/ui/model/odata/v2/Context.js +1 -1
  234. package/src/sap/ui/model/odata/v2/ODataAnnotations.js +1 -1
  235. package/src/sap/ui/model/odata/v2/ODataContextBinding.js +1 -0
  236. package/src/sap/ui/model/odata/v2/ODataListBinding.js +11 -1
  237. package/src/sap/ui/model/odata/v2/ODataModel.js +4 -2
  238. package/src/sap/ui/model/odata/v2/ODataTreeBinding.js +1 -1
  239. package/src/sap/ui/model/odata/v4/AnnotationHelper.js +1 -1
  240. package/src/sap/ui/model/odata/v4/Context.js +98 -23
  241. package/src/sap/ui/model/odata/v4/ODataBinding.js +39 -9
  242. package/src/sap/ui/model/odata/v4/ODataContextBinding.js +4 -4
  243. package/src/sap/ui/model/odata/v4/ODataListBinding.js +57 -21
  244. package/src/sap/ui/model/odata/v4/ODataMetaModel.js +3 -4
  245. package/src/sap/ui/model/odata/v4/ODataModel.js +33 -8
  246. package/src/sap/ui/model/odata/v4/ODataParentBinding.js +15 -12
  247. package/src/sap/ui/model/odata/v4/ODataPropertyBinding.js +2 -2
  248. package/src/sap/ui/model/odata/v4/lib/_AggregationCache.js +43 -8
  249. package/src/sap/ui/model/odata/v4/lib/_AggregationHelper.js +92 -28
  250. package/src/sap/ui/model/odata/v4/lib/_Cache.js +74 -24
  251. package/src/sap/ui/model/odata/v4/lib/_Helper.js +14 -3
  252. package/src/sap/ui/model/odata/v4/lib/_MetadataConverter.js +12 -4
  253. package/src/sap/ui/model/odata/v4/lib/_MetadataRequestor.js +8 -3
  254. package/src/sap/ui/model/odata/v4/lib/_Requestor.js +22 -14
  255. package/src/sap/ui/model/odata/v4/lib/_V2MetadataConverter.js +8 -1
  256. package/src/sap/ui/model/resource/ResourceModel.js +1 -1
  257. package/src/sap/ui/model/type/Boolean.js +1 -1
  258. package/src/sap/ui/model/type/Currency.js +1 -1
  259. package/src/sap/ui/model/type/Date.js +1 -1
  260. package/src/sap/ui/model/type/DateInterval.js +190 -155
  261. package/src/sap/ui/model/type/DateTime.js +1 -1
  262. package/src/sap/ui/model/type/DateTimeInterval.js +1 -1
  263. package/src/sap/ui/model/type/FileSize.js +1 -1
  264. package/src/sap/ui/model/type/Float.js +1 -1
  265. package/src/sap/ui/model/type/Integer.js +1 -1
  266. package/src/sap/ui/model/type/String.js +1 -1
  267. package/src/sap/ui/model/type/Time.js +1 -1
  268. package/src/sap/ui/model/type/TimeInterval.js +1 -1
  269. package/src/sap/ui/model/type/Unit.js +1 -1
  270. package/src/sap/ui/model/xml/XMLModel.js +1 -1
  271. package/src/sap/ui/qunit/utils/ControlIterator.js +1 -1
  272. package/src/sap/ui/qunit/utils/MemoryLeakCheck.js +1 -1
  273. package/src/sap/ui/qunit/utils/waitForThemeApplied.js +4 -5
  274. package/src/sap/ui/test/generic/TestBase.js +3 -3
  275. package/src/sap/ui/test/generic/_EnforceSemanticRendering.js +4 -4
  276. package/src/sap/ui/thirdparty/jquery-mobile-custom.js +9 -1
  277. package/src/sap/ui/util/Storage.js +1 -1
  278. package/src/ui5loader-autoconfig.js +14 -11
  279. package/src/ui5loader.js +152 -3
@@ -8,23 +8,14 @@
8
8
  sap.ui.define([
9
9
  'sap/ui/base/Object',
10
10
  'sap/ui/core/Configuration',
11
- 'sap/ui/core/Locale',
12
11
  'sap/ui/core/LocaleData',
13
12
  './_Calendars',
14
13
  './CalendarUtils',
15
- './CalendarWeekNumbering'
16
- ], function(
17
- BaseObject,
18
- Configuration,
19
- Locale,
20
- LocaleData,
21
- _Calendars,
22
- CalendarUtils,
23
- CalendarWeekNumbering
24
- ) {
14
+ './CalendarWeekNumbering',
15
+ './UI5Date'
16
+ ], function(BaseObject, Configuration, LocaleData, _Calendars, CalendarUtils, CalendarWeekNumbering, UI5Date) {
25
17
  "use strict";
26
18
 
27
-
28
19
  /**
29
20
  * Constructor for UniversalDate.
30
21
  *
@@ -32,13 +23,16 @@ sap.ui.define([
32
23
  * The UniversalDate is the base class of calendar date instances. It contains the static methods to create calendar
33
24
  * specific instances.
34
25
  *
35
- * The member variable <code>this.oDate</code> contains the JS Date object, which is the source value of the date information.
36
- * The prototype is containing getters and setters of the JS Date and is delegating them to the internal date object.
37
- * Implementations for specific calendars may override methods needed for their specific calendar (e.g. getYear
38
- * and getEra for Japanese emperor calendar);
26
+ * The member variable <code>this.oDate</code> contains a date instance
27
+ * (either JavaScript Date or <code>module:sap/ui/core/date/UI5Date</code>) which considers the
28
+ * configured time zone wherever JavaScript Date uses the local browser time zone; see
29
+ * {@link module:sap/ui/core/date/UI5Date#getInstance}. This is the source value of the date
30
+ * information. The prototype contains getters and setters of the Date and is delegating them
31
+ * to the internal date object. Implementations for specific calendars may override methods
32
+ * needed for their specific calendar (e.g. getYear and getEra for Japanese emperor calendar).
39
33
  *
40
34
  * @private
41
- * @ui5-restricted
35
+ * @ui5-restricted SAPUI5 Distribution Layer Libraries
42
36
  * @alias sap.ui.core.date.UniversalDate
43
37
  */
44
38
  var UniversalDate = BaseObject.extend("sap.ui.core.date.UniversalDate", /** @lends sap.ui.core.date.UniversalDate.prototype */ {
@@ -48,16 +42,54 @@ sap.ui.define([
48
42
  }
49
43
  });
50
44
 
45
+ /**
46
+ * Delegates this method to the calender specific implementation.
47
+ *
48
+ * @returns {int}
49
+ * The number of milliseconds since January 1, 1970, 00:00:00 UTC based on the Gregorian
50
+ * calendar, for the given calendar specific arguments
51
+ *
52
+ * @private
53
+ * @ui5-restricted SAPUI5 Distribution Layer Libraries
54
+ */
51
55
  UniversalDate.UTC = function() {
52
56
  var clDate = UniversalDate.getClass();
53
57
  return clDate.UTC.apply(clDate, arguments);
54
58
  };
55
59
 
60
+ /**
61
+ * Returns a number representing the millisecond since January 1, 1970, 00:00:00 to the current date,
62
+ * see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/now Date.now}.
63
+ *
64
+ * @returns {int} A number representing the millisecond since January 1, 1970, 00:00:00 to the current date
65
+ *
66
+ * @private
67
+ * @ui5-restricted SAPUI5 Distribution Layer Libraries
68
+ */
56
69
  UniversalDate.now = function() {
57
70
  return Date.now();
58
71
  };
59
72
 
73
+ /**
74
+ * Creates an object of the provided date class and with the given arguments.
75
+ *
76
+ * @param {function} clDate
77
+ * The constructor function for either <code>Date</code> or an implementation of
78
+ * <code>sap.ui.core.date.UniversalDate</code>
79
+ * @param {object} aArgs
80
+ * The <code>arguments</code> object which is given to the constructor of the given date class
81
+ * to create the date object
82
+ * @returns {sap.ui.core.date.UniversalDate|module:sap/ui/core/date/UI5Date}
83
+ * The created date, either an UI5Date or UniversalDate instance
84
+ *
85
+ * @private
86
+ * @ui5-restricted SAPUI5 Distribution Layer Libraries
87
+ */
60
88
  UniversalDate.prototype.createDate = function(clDate, aArgs) {
89
+ if (clDate === Date) {
90
+ return UI5Date.getInstance.apply(null, aArgs);
91
+ }
92
+
61
93
  switch (aArgs.length) {
62
94
  case 0: return new clDate();
63
95
  // new Date(new Date()) is officially not supported
@@ -73,25 +105,30 @@ sap.ui.define([
73
105
  };
74
106
 
75
107
  /**
76
- * Returns an instance of Date, based on the calendar type from the configuration, or as explicitly
77
- * defined by parameter. The object provides all methods also known on the JavaScript Date object.
108
+ * Returns an instance of UniversalDate, based on the calendar type from the configuration, or as explicitly
109
+ * defined by parameter. The object contains getters and setters of the JavaScript Date and is delegating them
110
+ * to an internal date object.
111
+ *
112
+ * Note: Prefer this method over calling <code>new UniversalDate</code> with an instance of <code>Date</code>.
78
113
  *
79
- * Note: Prefer this method over calling <code>new UniversalDate</code> with an instance of <code>Date</code>
114
+ * @param {Date|module:sap/ui/core/date/UI5Date|sap.ui.core.date.UniversalDate} [oDate]
115
+ * The date object, defaults to <code>UI5Date.getInstance()</code>
116
+ * @param {sap.ui.core.CalendarType} [sCalendarType]
117
+ * The calendar type, defaults to <code>sap.ui.getCore().getConfiguration().getCalendarType()</code>
118
+ * @returns {sap.ui.core.date.UniversalDate}
119
+ * An instance of <code>UniversalDate</code>
80
120
  *
81
- * @param {Date|sap.ui.core.date.UniversalDate} [oDate] JavaScript date object, defaults to <code>new Date()</code>
82
- * @param {sap.ui.core.CalendarType} [sCalendarType] The calendar type, defaults to <code>sap.ui.getCore().getConfiguration().getCalendarType()</code>
83
- * @returns {sap.ui.core.date.UniversalDate} The date instance
84
- * @public
121
+ * @private
122
+ * @ui5-restricted SAPUI5 Distribution Layer Libraries
85
123
  */
86
124
  UniversalDate.getInstance = function(oDate, sCalendarType) {
87
125
  var clDate, oInstance;
126
+
88
127
  if (oDate instanceof UniversalDate) {
89
128
  oDate = oDate.getJSDate();
90
- } else if (!oDate) {
91
- oDate = new Date();
92
129
  }
93
130
 
94
- if (isNaN(oDate.getTime())) {
131
+ if (oDate && isNaN(oDate.getTime())) {
95
132
  throw new Error("The given date object is invalid");
96
133
  }
97
134
 
@@ -100,17 +137,24 @@ sap.ui.define([
100
137
  }
101
138
  clDate = UniversalDate.getClass(sCalendarType);
102
139
  oInstance = Object.create(clDate.prototype);
103
- oInstance.oDate = oDate;
140
+ oInstance.oDate = oDate ? UI5Date.getInstance(oDate) : UI5Date.getInstance();
104
141
  oInstance.sCalendarType = sCalendarType;
142
+
105
143
  return oInstance;
106
144
  };
107
145
 
108
146
  /**
109
- * Returns a specific Date class, based on the calendar type from the configuration, or as explicitly
110
- * defined by parameter. The object provides all methods also known on the JavaScript Date object.
147
+ * Returns the constructor function of a subclass of <code>UniversalDate</code> for the given calendar type.
148
+ * If no calendar type is given the globally configured calendar type is used.
111
149
  *
112
150
  * @param {sap.ui.core.CalendarType} sCalendarType the type of the used calendar
113
- * @public
151
+ *
152
+ * @returns {function}
153
+ * The class of the given <code>sCalenderType</code>. If <code>sCalenderType</code> is not
154
+ * provided, the class of the configured calendar type is returned.
155
+ *
156
+ * @private
157
+ * @ui5-restricted SAPUI5 Distribution Layer Libraries
114
158
  */
115
159
  UniversalDate.getClass = function(sCalendarType) {
116
160
  if (!sCalendarType) {
@@ -119,8 +163,543 @@ sap.ui.define([
119
163
  return _Calendars.get(sCalendarType);
120
164
  };
121
165
 
122
- /*
123
- * Loop through the Date class and create delegates of all Date API methods
166
+ /**
167
+ * Returns the day of the month of the embedded date instance according to the configured time
168
+ * zone and selected calender.
169
+ *
170
+ * @returns {int}
171
+ * A number representing the day of the month of the embedded date instance according
172
+ * to the configured time zone and selected calender
173
+ *
174
+ * @function
175
+ * @name sap.ui.core.date.UniversalDate.prototype.getDate
176
+ * @private
177
+ * @ui5-restricted SAPUI5 Distribution Layer Libraries
178
+ */
179
+
180
+ /**
181
+ * Returns the day of the week of the embedded date instance according to the configured time zone and
182
+ * selected calender.
183
+ *
184
+ * @returns {int}
185
+ * A number representing the day of the week of the embedded date instance according to the configured
186
+ * time zone and selected calender
187
+ *
188
+ * @function
189
+ * @name sap.ui.core.date.UniversalDate.prototype.getDay
190
+ * @private
191
+ * @ui5-restricted SAPUI5 Distribution Layer Libraries
192
+ */
193
+
194
+ /**
195
+ * Returns the year of the embedded date instance according to the configured time zone and selected calender.
196
+ *
197
+ * @returns {int}
198
+ * The year of the embedded date instance according to the configured time zone and selected calender
199
+ *
200
+ * @function
201
+ * @name sap.ui.core.date.UniversalDate.prototype.getFullYear
202
+ * @private
203
+ * @ui5-restricted SAPUI5 Distribution Layer Libraries
204
+ */
205
+
206
+ /**
207
+ * Returns the hours of the embedded date instance according to the configured time zone and selected
208
+ * calender.
209
+ *
210
+ * @returns {int}
211
+ * A number representing the hours of the embedded date instance according to the configured time zone
212
+ * and selected calender
213
+ *
214
+ * @function
215
+ * @name sap.ui.core.date.UniversalDate.prototype.getHours
216
+ * @private
217
+ * @ui5-restricted SAPUI5 Distribution Layer Libraries
218
+ */
219
+
220
+ /**
221
+ * Returns the milliseconds of the embedded date instance according to the configured time zone
222
+ * and selected calender.
223
+ *
224
+ * @returns {int}
225
+ * A number between 0 and 999 representing the milliseconds of the embedded date instance according to
226
+ * the configured time zone and selected calender
227
+ *
228
+ * @function
229
+ * @name sap.ui.core.date.UniversalDate.prototype.getMilliseconds
230
+ * @private
231
+ * @ui5-restricted SAPUI5 Distribution Layer Libraries
232
+ */
233
+
234
+ /**
235
+ * Returns the minutes of the embedded date instance according to the configured time zone and selected calender.
236
+ *
237
+ * @returns {int}
238
+ * A number between 0 and 59 representing the minutes of the embedded date instance according to the
239
+ * configured time zone and selected calender
240
+ *
241
+ * @function
242
+ * @name sap.ui.core.date.UniversalDate.prototype.getMinutes
243
+ * @private
244
+ * @ui5-restricted SAPUI5 Distribution Layer Libraries
245
+ */
246
+
247
+ /**
248
+ * Returns the month index of the embedded date instance according to the configured time zone
249
+ * and selected calender.
250
+ *
251
+ * @returns {int}
252
+ * The month index of the embedded date instance according to the configured time zone and selected calender
253
+ *
254
+ * @function
255
+ * @name sap.ui.core.date.UniversalDate.prototype.getMonth
256
+ * @private
257
+ * @ui5-restricted SAPUI5 Distribution Layer Libraries
258
+ */
259
+
260
+ /**
261
+ * Returns the seconds of the embedded date instance according to the configured time zone and selected calender.
262
+ *
263
+ * @returns {int}
264
+ * A number between 0 and 59 representing the seconds of the embedded date instance according to the
265
+ * configured time zone and selected calender
266
+ *
267
+ * @function
268
+ * @name sap.ui.core.date.UniversalDate.prototype.getSeconds
269
+ * @private
270
+ * @ui5-restricted SAPUI5 Distribution Layer Libraries
271
+ */
272
+
273
+ /**
274
+ * Returns the difference in minutes between the UTC and the configured time zone for the embedded date.
275
+ *
276
+ * @returns {int}
277
+ * The difference in minutes between the UTC and the configured time zone for the embedded date
278
+ *
279
+ * @function
280
+ * @name sap.ui.core.date.UniversalDate.prototype.getTimezoneOffset
281
+ * @private
282
+ * @ui5-restricted SAPUI5 Distribution Layer Libraries
283
+ */
284
+
285
+ /**
286
+ * Returns the year of the embedded date instance minus 1900 according to the configured time zone and
287
+ * selected calender. In case of the Gregorian calendar the 1900 is subtracted from the year value.
288
+ *
289
+ * @returns {int}
290
+ * The year of the embedded date instance (minus 1900 if the Gregorian calendar is selected)
291
+ * according to the configured time zone and selected calender
292
+ *
293
+ * @deprecated for the Gregorian calendar since version 1.111.0 as it is deprecated in
294
+ * JavaScript Date, it can be used with other calendars. It still is recommended to use
295
+ * {@link #getFullYear} instead, independent on the selected calender
296
+ *
297
+ * @function
298
+ * @name sap.ui.core.date.UniversalDate.prototype.getYear
299
+ * @private
300
+ * @ui5-restricted SAPUI5 Distribution Layer Libraries
301
+ */
302
+
303
+ /**
304
+ * Returns the timestamp in milliseconds of the embedded date based on the UNIX epoch.
305
+ *
306
+ * @returns {int}
307
+ * The timestamp in milliseconds of the embedded date based on the UNIX epoch, or <code>NaN</code> if
308
+ * the embedded date is an invalid date
309
+ *
310
+ * @function
311
+ * @name sap.ui.core.date.UniversalDate.prototype.getTime
312
+ * @private
313
+ * @ui5-restricted SAPUI5 Distribution Layer Libraries
314
+ */
315
+
316
+ /**
317
+ * Returns the day of the month of the embedded date instance according to universal time and
318
+ * selected calender.
319
+ *
320
+ * @returns {int}
321
+ * A number representing the day of the month of the embedded date instance according
322
+ * to universal time and selected calender
323
+ *
324
+ * @function
325
+ * @name sap.ui.core.date.UniversalDate.prototype.getUTCDate
326
+ * @private
327
+ * @ui5-restricted SAPUI5 Distribution Layer Libraries
328
+ */
329
+
330
+ /**
331
+ *
332
+ * Returns the day of the week of the embedded date instance according to universal time and
333
+ * selected calender.
334
+ *
335
+ * @returns {int}
336
+ * A number representing the day of the week of the embedded date instance according to universal
337
+ * time and selected calender
338
+ *
339
+ * @function
340
+ * @name sap.ui.core.date.UniversalDate.prototype.getUTCDay
341
+ * @private
342
+ * @ui5-restricted SAPUI5 Distribution Layer Libraries
343
+ */
344
+
345
+ /**
346
+ * Returns the year of the embedded date instance according to universal time and selected calender.
347
+ *
348
+ * @returns {int}
349
+ * The year of the embedded date instance according to universal time and selected calender
350
+ *
351
+ * @function
352
+ * @name sap.ui.core.date.UniversalDate.prototype.getUTCFullYear
353
+ * @private
354
+ * @ui5-restricted SAPUI5 Distribution Layer Libraries
355
+ */
356
+
357
+ /**
358
+ * Returns the hours of the embedded date instance according to universal time.
359
+ *
360
+ * @returns {int}
361
+ * A number representing the hours of the embedded date instance according to universal time
362
+ *
363
+ * @function
364
+ * @name sap.ui.core.date.UniversalDate.prototype.getUTCHours
365
+ * @private
366
+ * @ui5-restricted SAPUI5 Distribution Layer Libraries
367
+ */
368
+
369
+ /**
370
+ * Returns the milliseconds of the embedded date instance according to universal time.
371
+ *
372
+ * @returns {int}
373
+ * A number between 0 and 999 representing the milliseconds of the embedded date instance
374
+ * according to universal time
375
+ *
376
+ * @function
377
+ * @name sap.ui.core.date.UniversalDate.prototype.getUTCMilliseconds
378
+ * @private
379
+ * @ui5-restricted SAPUI5 Distribution Layer Libraries
380
+ */
381
+
382
+ /**
383
+ * Returns the minutes of the embedded date instance according to universal time.
384
+ *
385
+ * @returns {int}
386
+ * A number between 0 and 59 representing the minutes of the embedded date instance according
387
+ * to universal time
388
+ *
389
+ * @function
390
+ * @name sap.ui.core.date.UniversalDate.prototype.getUTCMinutes
391
+ * @private
392
+ * @ui5-restricted SAPUI5 Distribution Layer Libraries
393
+ */
394
+
395
+ /**
396
+ * Returns the month index of the embedded date instance according to universal time and
397
+ * selected calender.
398
+ *
399
+ * @returns {int}
400
+ * The month index of the embedded date instance according to universal time and selected
401
+ * calender
402
+ *
403
+ * @function
404
+ * @name sap.ui.core.date.UniversalDate.prototype.getUTCMonth
405
+ * @private
406
+ * @ui5-restricted SAPUI5 Distribution Layer Libraries
407
+ */
408
+
409
+ /**
410
+ * Returns the seconds of the embedded date instance according to universal time.
411
+ *
412
+ * @returns {int}
413
+ * A number between 0 and 59 representing the seconds of the embedded date instance according
414
+ * to universal time
415
+ *
416
+ * @function
417
+ * @name sap.ui.core.date.UniversalDate.prototype.getUTCSeconds
418
+ * @private
419
+ * @ui5-restricted SAPUI5 Distribution Layer Libraries
420
+ */
421
+
422
+ /**
423
+ * Sets the day of the month for the embedded date instance considering the configured time zone
424
+ * and selected calender.
425
+ *
426
+ * @param {int} iDay
427
+ * An integer representing the new day value
428
+ * @returns {int}
429
+ * The milliseconds of the new timestamp based on the UNIX epoch, or <code>NaN</code> if the
430
+ * timestamp could not be updated. The new timestamp is a Gregorian timestamp.
431
+ *
432
+ * @function
433
+ * @name sap.ui.core.date.UniversalDate.prototype.setDate
434
+ * @private
435
+ * @ui5-restricted SAPUI5 Distribution Layer Libraries
436
+ */
437
+
438
+ /**
439
+ * Sets the year, month and day for the embedded date instance considering the configured time
440
+ * zone and selected calender.
441
+ *
442
+ * @param {int} yearValue An integer representing the new year value
443
+ * @param {int} [monthValue] An integer representing the new month index
444
+ * @param {int} [dateValue] An integer representing the new day value
445
+ * @returns {int}
446
+ * The milliseconds of the new timestamp based on the UNIX epoch, or <code>NaN</code> if the
447
+ * timestamp could not be updated. The new timestamp is a Gregorian timestamp.
448
+ *
449
+ * @function
450
+ * @name sap.ui.core.date.UniversalDate.prototype.setFullYear
451
+ * @private
452
+ * @ui5-restricted SAPUI5 Distribution Layer Libraries
453
+ */
454
+
455
+ /**
456
+ * Sets the hours, minutes, seconds and milliseconds for the embedded date instance considering
457
+ * the configured time zone.
458
+ *
459
+ * @param {int} hoursValue An integer representing the new hours value
460
+ * @param {int} [minutesValue] An integer representing the new minutes value
461
+ * @param {int} [secondsValue] An integer representing the new seconds value
462
+ * @param {int} [msValue] An integer representing the new milliseconds value
463
+ * @returns {int}
464
+ * The milliseconds of the new timestamp based on the UNIX epoch, or <code>NaN</code> if the
465
+ * timestamp could not be updated. The new timestamp is a Gregorian timestamp.
466
+ *
467
+ * @function
468
+ * @name sap.ui.core.date.UniversalDate.prototype.setHours
469
+ * @private
470
+ * @ui5-restricted SAPUI5 Distribution Layer Libraries
471
+ */
472
+
473
+ /**
474
+ * Sets the milliseconds for the embedded date instance considering the configured time zone.
475
+ *
476
+ * @param {int} millisecondsValue An integer representing the new milliseconds value
477
+ * @returns {int}
478
+ * The milliseconds of the new timestamp based on the UNIX epoch, or <code>NaN</code> if the
479
+ * timestamp could not be updated. The new timestamp is a Gregorian timestamp.
480
+ *
481
+ * @function
482
+ * @name sap.ui.core.date.UniversalDate.prototype.setMilliseconds
483
+ * @private
484
+ * @ui5-restricted SAPUI5 Distribution Layer Libraries
485
+ */
486
+
487
+ /**
488
+ * Sets the minutes, seconds and milliseconds for the embedded date instance considering the configured
489
+ * time zone.
490
+ *
491
+ * @param {int} minutesValue An integer representing the new minutes value
492
+ * @param {int} [secondsValue] An integer representing the new seconds value
493
+ * @param {int} [msValue] An integer representing the new milliseconds value
494
+ * @returns {int}
495
+ * The milliseconds of the new timestamp based on the UNIX epoch, or <code>NaN</code> if the
496
+ * timestamp could not be updated. The new timestamp is a Gregorian timestamp.
497
+ *
498
+ * @function
499
+ * @name sap.ui.core.date.UniversalDate.prototype.setMinutes
500
+ * @private
501
+ * @ui5-restricted SAPUI5 Distribution Layer Libraries
502
+ */
503
+
504
+ /**
505
+ * Sets the month and day for the embedded date instance considering the configured time zone and
506
+ * selected calender.
507
+ *
508
+ * @param {int} monthValue An integer representing the new month index
509
+ * @param {int} [dayValue] An integer representing the new day value
510
+ * @returns {int}
511
+ * The milliseconds of the new timestamp based on the UNIX epoch, or <code>NaN</code> if the
512
+ * timestamp could not be updated. The new timestamp is a Gregorian timestamp.
513
+ *
514
+ * @function
515
+ * @name sap.ui.core.date.UniversalDate.prototype.setMonth
516
+ * @private
517
+ * @ui5-restricted SAPUI5 Distribution Layer Libraries
518
+ */
519
+
520
+ /**
521
+ * Sets the seconds and milliseconds for the embedded date instance considering the configured time zone.
522
+ *
523
+ * @param {int} secondsValue An integer representing the new seconds value
524
+ * @param {int} [msValue] An integer representing the new milliseconds value
525
+ * @returns {int}
526
+ * The milliseconds of the new timestamp based on the UNIX epoch, or <code>NaN</code> if the
527
+ * timestamp could not be updated. The new timestamp is a Gregorian timestamp.
528
+ *
529
+ * @function
530
+ * @name sap.ui.core.date.UniversalDate.prototype.setSeconds
531
+ * @private
532
+ * @ui5-restricted SAPUI5 Distribution Layer Libraries
533
+ */
534
+
535
+ /**
536
+ * Sets the day of the month for the embedded date instance according to universal time and
537
+ * selected calender.
538
+ *
539
+ * @param {int} dayValue
540
+ * An integer representing the new day value
541
+ * @returns {int}
542
+ * The milliseconds of the new timestamp based on the UNIX epoch, or <code>NaN</code> if the
543
+ * timestamp could not be updated. The new timestamp is a Gregorian timestamp.
544
+ *
545
+ * @function
546
+ * @name sap.ui.core.date.UniversalDate.prototype.setUTCDate
547
+ * @private
548
+ * @ui5-restricted SAPUI5 Distribution Layer Libraries
549
+ */
550
+
551
+ /**
552
+ * Sets the year, month and day for the embedded date instance according to universal time and
553
+ * selected calender.
554
+ *
555
+ * @param {int} yearValue An integer representing the new year value
556
+ * @param {int} [monthValue] An integer representing the new month index
557
+ * @param {int} [dateValue] An integer representing the new day value
558
+ * @returns {int}
559
+ * The milliseconds of the new timestamp based on the UNIX epoch, or <code>NaN</code> if the
560
+ * timestamp could not be updated. The new timestamp is a Gregorian timestamp.
561
+ *
562
+ * @function
563
+ * @name sap.ui.core.date.UniversalDate.prototype.setUTCFullYear
564
+ * @private
565
+ * @ui5-restricted SAPUI5 Distribution Layer Libraries
566
+ */
567
+
568
+ /**
569
+ * Sets the hours, minutes, seconds and milliseconds for the embedded date instance according to
570
+ * universal time.
571
+ *
572
+ * @param {int} hoursValue An integer representing the new hours value
573
+ * @param {int} [minutesValue] An integer representing the new minutes value
574
+ * @param {int} [secondsValue] An integer representing the new seconds value
575
+ * @param {int} [msValue] An integer representing the new milliseconds value
576
+ * @returns {int}
577
+ * The milliseconds of the new timestamp based on the UNIX epoch, or <code>NaN</code> if the
578
+ * timestamp could not be updated. The new timestamp is a Gregorian timestamp.
579
+ *
580
+ * @function
581
+ * @name sap.ui.core.date.UniversalDate.prototype.setUTCHours
582
+ * @private
583
+ * @ui5-restricted SAPUI5 Distribution Layer Libraries
584
+ */
585
+
586
+ /**
587
+ * Sets the milliseconds for the embedded date instance according to universal time.
588
+ *
589
+ * @param {int} msValue An integer representing the new milliseconds value
590
+ * @returns {int}
591
+ * The milliseconds of the new timestamp based on the UNIX epoch, or <code>NaN</code> if the
592
+ * timestamp could not be updated. The new timestamp is a Gregorian timestamp.
593
+ *
594
+ * @function
595
+ * @name sap.ui.core.date.UniversalDate.prototype.setUTCMilliseconds
596
+ * @private
597
+ * @ui5-restricted SAPUI5 Distribution Layer Libraries
598
+ */
599
+
600
+ /**
601
+ * Sets the minutes, seconds and milliseconds for the embedded date instance according to universal
602
+ * time.
603
+ *
604
+ * @param {int} minutesValue An integer representing the new minutes value
605
+ * @param {int} [secondsValue] An integer representing the new seconds value
606
+ * @param {int} [msValue] An integer representing the new milliseconds value
607
+ * @returns {int}
608
+ * The milliseconds of the new timestamp based on the UNIX epoch, or <code>NaN</code> if the
609
+ * timestamp could not be updated. The new timestamp is a Gregorian timestamp.
610
+ *
611
+ * @function
612
+ * @name sap.ui.core.date.UniversalDate.prototype.setUTCMinutes
613
+ * @private
614
+ * @ui5-restricted SAPUI5 Distribution Layer Libraries
615
+ */
616
+
617
+ /**
618
+ * Sets the month and day for the embedded date instance according to universal time and
619
+ * selected calender.
620
+ *
621
+ * @param {int} monthValue An integer representing the new month index
622
+ * @param {int} [dateValue] An integer representing the new day value
623
+ * @returns {int}
624
+ * The milliseconds of the new timestamp based on the UNIX epoch, or <code>NaN</code> if the
625
+ * timestamp could not be updated. The new timestamp is a Gregorian timestamp.
626
+ *
627
+ * @function
628
+ * @name sap.ui.core.date.UniversalDate.prototype.setUTCMonth
629
+ * @private
630
+ * @ui5-restricted SAPUI5 Distribution Layer Libraries
631
+ */
632
+
633
+ /**
634
+ * Sets the seconds and milliseconds for the embedded date instance according to universal time.
635
+ *
636
+ * @param {int} secondsValue An integer representing the new seconds value
637
+ * @param {int} [msValue] An integer representing the new milliseconds value
638
+ * @returns {int}
639
+ * The milliseconds of the new timestamp based on the UNIX epoch, or <code>NaN</code> if the
640
+ * timestamp could not be updated. The new timestamp is a Gregorian timestamp.
641
+ *
642
+ * @function
643
+ * @name sap.ui.core.date.UniversalDate.prototype.setUTCSeconds
644
+ * @private
645
+ * @ui5-restricted SAPUI5 Distribution Layer Libraries
646
+ */
647
+
648
+ /**
649
+ * Sets the year for the embedded date instance considering the configured time zone and the
650
+ * selected calender. In case of the Gregorian calendar, 1900 is added to the year value
651
+ *
652
+ * @param {int} yearValue
653
+ * An integer representing the new year value (plus 1900 for the Gregorian calendar)
654
+ * @returns {int}
655
+ * The milliseconds of the new timestamp based on the UNIX epoch, or <code>NaN</code> if the
656
+ * timestamp could not be updated. The new timestamp is a Gregorian timestamp.
657
+ *
658
+ * @deprecated for the Gregorian calendar since version 1.111.0 as it is deprecated in
659
+ * JavaScript Date, it can be used with other calendars. It still is recommended to use
660
+ * {@link #getFullYear} instead, independent on the selected calender
661
+ *
662
+ * @function
663
+ * @name sap.ui.core.date.UniversalDate.prototype.setYear
664
+ * @private
665
+ * @ui5-restricted SAPUI5 Distribution Layer Libraries
666
+ */
667
+
668
+ /**
669
+ * Returns the date portion of the embedded date object interpreted in the configured time zone,
670
+ * independent on the selected calendar.
671
+ *
672
+ * @returns {string}
673
+ * The date portion of the embedded date object interpreted in the configured time zone
674
+ *
675
+ * @function
676
+ * @name sap.ui.core.date.UniversalDate.prototype.toDateString
677
+ * @private
678
+ * @ui5-restricted SAPUI5 Distribution Layer Libraries
679
+ */
680
+
681
+ /**
682
+ * Returns a string representing the embedded date object interpreted in the configured time
683
+ * zone, independent on the selected calendar.
684
+ *
685
+ * @returns {string}
686
+ * A string representing the embedded date object interpreted in the configured time zone
687
+ *
688
+ * @function
689
+ * @name sap.ui.core.date.UniversalDate.prototype.toString
690
+ * @private
691
+ * @ui5-restricted SAPUI5 Distribution Layer Libraries
692
+ */
693
+
694
+ /**
695
+ * Returns the value of the embedded date object in milliseconds based on the UNIX epoch.
696
+ *
697
+ * @returns {int} The primitive value of the embedded date object in milliseconds based on the UNIX epoch
698
+ *
699
+ * @function
700
+ * @name sap.ui.core.date.UniversalDate.prototype.valueOf
701
+ * @private
702
+ * @ui5-restricted SAPUI5 Distribution Layer Libraries
124
703
  */
125
704
  [
126
705
  "getDate", "getMonth", "getFullYear", "getYear", "getDay", "getHours", "getMinutes", "getSeconds", "getMilliseconds",
@@ -135,10 +714,12 @@ sap.ui.define([
135
714
  });
136
715
 
137
716
  /**
138
- * Returns the JS date object representing the current calendar date value.
717
+ * Returns the date object representing the current calendar date value.
718
+ *
719
+ * @returns {Date|module:sap/ui/core/date/UI5Date} The date object representing the current calendar date value
139
720
  *
140
- * @returns {Date} The JS date object representing the current calendar date value
141
- * @public
721
+ * @private
722
+ * @ui5-restricted SAPUI5 Distribution Layer Libraries
142
723
  */
143
724
  UniversalDate.prototype.getJSDate = function() {
144
725
  return this.oDate;
@@ -148,23 +729,63 @@ sap.ui.define([
148
729
  * Returns the calendar type of the current instance of a UniversalDate.
149
730
  *
150
731
  * @returns {sap.ui.core.CalendarType} The calendar type of the date
732
+ *
733
+ * @private
734
+ * @ui5-restricted SAPUI5 Distribution Layer Libraries
151
735
  */
152
736
  UniversalDate.prototype.getCalendarType = function() {
153
737
  return this.sCalendarType;
154
738
  };
155
739
 
156
- /*
157
- * Provide additional getters/setters, not yet covered by the JS Date
740
+ /**
741
+ * Returns the era index of for the embedded date instance.
742
+ *
743
+ * @returns {int} The index of the era for the embedded date instance
744
+ *
745
+ * @private
746
+ * @ui5-restricted SAPUI5 Distribution Layer Libraries
158
747
  */
159
748
  UniversalDate.prototype.getEra = function() {
160
749
  return UniversalDate.getEraByDate(this.sCalendarType, this.oDate.getFullYear(), this.oDate.getMonth(), this.oDate.getDate());
161
750
  };
751
+
752
+ /**
753
+ * Placeholder method which is overwritten by calendar specific implementations. General usage of
754
+ * this method is to use it to set the era for the embedded date instance.
755
+ *
756
+ * @param {int} iEra
757
+ * An number representing the era index which is to be set for the embedded date instance
758
+ *
759
+ * @private
760
+ * @ui5-restricted SAPUI5 Distribution Layer Libraries
761
+ */
162
762
  UniversalDate.prototype.setEra = function(iEra) {
163
763
  // The default implementation does not support setting the era
164
764
  };
765
+
766
+ /**
767
+ * Returns the era index of for the embedded date instance in universal time.
768
+ *
769
+ * @returns {int} The index of the era for the embedded date instance in universal time
770
+ *
771
+ * @private
772
+ * @ui5-restricted SAPUI5 Distribution Layer Libraries
773
+ */
165
774
  UniversalDate.prototype.getUTCEra = function() {
166
775
  return UniversalDate.getEraByDate(this.sCalendarType, this.oDate.getUTCFullYear(), this.oDate.getUTCMonth(), this.oDate.getUTCDate());
167
776
  };
777
+
778
+ /**
779
+ * Placeholder method which is overwritten by calendar specific implementations. General usage of
780
+ * this method is to use it to set the era for the embedded date instance in universal time.
781
+ *
782
+ * @param {int} iEra
783
+ * An number representing the era index which is to be set for the embedded date instance
784
+ * in universal time
785
+ *
786
+ * @private
787
+ * @ui5-restricted SAPUI5 Distribution Layer Libraries
788
+ */
168
789
  UniversalDate.prototype.setUTCEra = function(iEra) {
169
790
  // The default implementation does not support setting the era
170
791
  };
@@ -181,6 +802,7 @@ sap.ui.define([
181
802
  * e.g. <code>{firstDayOfWeek: 1, minimalDaysInFirstWeek: 4}</code>
182
803
  * @returns {{week: int, year: int}} resulting calendar week, note: week index starts with <code>0</code>
183
804
  * @private
805
+ * @ui5-restricted SAPUI5 Distribution Layer Libraries
184
806
  * @throws {TypeError} If:
185
807
  * <ul>
186
808
  * <li>vCalendarWeekNumbering is an object and the fields <code>firstDayOfWeek</code> or <code>minimalDaysInFirstWeek</code>) are missing or have a non-numeric value</li>
@@ -205,6 +827,7 @@ sap.ui.define([
205
827
  * If calendar week numbering is not determined from the locale then {@link LocaleData#firstDayStartsFirstWeek} is ignored.
206
828
  * e.g. <code>{firstDayOfWeek: 1, minimalDaysInFirstWeek: 4}</code>
207
829
  * @private
830
+ * @ui5-restricted SAPUI5 Distribution Layer Libraries
208
831
  * @throws {TypeError} If:
209
832
  * <ul>
210
833
  * <li>vCalendarWeekNumbering is an object and the fields <code>firstDayOfWeek</code> or <code>minimalDaysInFirstWeek</code>) are missing or have a non-numeric value</li>
@@ -229,6 +852,7 @@ sap.ui.define([
229
852
  * e.g. <code>{firstDayOfWeek: 1, minimalDaysInFirstWeek: 4}</code>
230
853
  * @returns {{week: int, year: int}} resulting calendar week, note: week index starts with <code>0</code>
231
854
  * @private
855
+ * @ui5-restricted SAPUI5 Distribution Layer Libraries
232
856
  * @throws {TypeError} If:
233
857
  * <ul>
234
858
  * <li>vCalendarWeekNumbering is an object and the fields <code>firstDayOfWeek</code> or <code>minimalDaysInFirstWeek</code>) are missing or have a non-numeric value</li>
@@ -253,6 +877,7 @@ sap.ui.define([
253
877
  * If calendar week numbering is not determined from the locale then {@link LocaleData#firstDayStartsFirstWeek} is ignored.
254
878
  * e.g. <code>{firstDayOfWeek: 1, minimalDaysInFirstWeek: 4}</code>
255
879
  * @private
880
+ * @ui5-restricted SAPUI5 Distribution Layer Libraries
256
881
  * @throws {TypeError} If:
257
882
  * <ul>
258
883
  * <li>vCalendarWeekNumbering is an object and the fields <code>firstDayOfWeek</code> or <code>minimalDaysInFirstWeek</code>) are missing or have a non-numeric value</li>
@@ -264,12 +889,43 @@ sap.ui.define([
264
889
  var oDate = UniversalDate.getFirstDateOfWeek(this.sCalendarType, oWeek.year || this.getFullYear(), oWeek.week, oLocale, vCalendarWeekNumbering);
265
890
  this.setUTCFullYear(oDate.year, oDate.month, oDate.day);
266
891
  };
892
+
893
+ /**
894
+ * Returns the current quarter of the embedded date instance
895
+ *
896
+ * @returns {int} The quarter of the embedded date instance
897
+ *
898
+ * @private
899
+ * @ui5-restricted SAPUI5 Distribution Layer Libraries
900
+ */
267
901
  UniversalDate.prototype.getQuarter = function() {
268
902
  return Math.floor((this.getMonth() / 3));
269
903
  };
904
+
905
+ /**
906
+ * Returns the current quarter of the embedded date instance in universal time
907
+ *
908
+ * @returns {int} The quarter of the embedded date instance in universal time
909
+ *
910
+ * @private
911
+ * @ui5-restricted SAPUI5 Distribution Layer Libraries
912
+ */
270
913
  UniversalDate.prototype.getUTCQuarter = function() {
271
914
  return Math.floor((this.getUTCMonth() / 3));
272
915
  };
916
+
917
+ /**
918
+ * Returns an integer value depending on whether the embedded date instance time is set to the
919
+ * afternoon or morning.
920
+ *
921
+ * @returns {int}
922
+ * An integer value which indicates which day period the embedded date instance is set to. If,
923
+ * date time is set in the morning time 0 (i.e. 0:00 - 11:59) or 1 if date time is set in the
924
+ * afternoon (i.e. 12:00 - 23:59).
925
+ *
926
+ * @private
927
+ * @ui5-restricted SAPUI5 Distribution Layer Libraries
928
+ */
273
929
  UniversalDate.prototype.getDayPeriod = function() {
274
930
  if (this.getHours() < 12) {
275
931
  return 0;
@@ -277,6 +933,20 @@ sap.ui.define([
277
933
  return 1;
278
934
  }
279
935
  };
936
+
937
+
938
+ /**
939
+ * Returns an integer value depending on whether the embedded date instance time, is set to the
940
+ * afternoon or morning, in universal time.
941
+ *
942
+ * @returns {int}
943
+ * An integer value which indicates which day period the embedded date instance is set to, in
944
+ * universal time. If, universal date time is set in the morning time 0 (i.e. 0:00 - 11:59) or
945
+ * 1 if universal date time is set in the afternoon (i.e. 12:00 - 23:59).
946
+ *
947
+ * @private
948
+ * @ui5-restricted SAPUI5 Distribution Layer Libraries
949
+ */
280
950
  UniversalDate.prototype.getUTCDayPeriod = function() {
281
951
  if (this.getUTCHours() < 12) {
282
952
  return 0;
@@ -288,11 +958,28 @@ sap.ui.define([
288
958
 
289
959
  // TODO: These are currently needed for the DateFormat test, as the date used in the test
290
960
  // has been enhanced with these methods. Should be implemented using CLDR data.
961
+ /**
962
+ * Returns the short version of the time zone name of the embedded date instance.
963
+ *
964
+ * @returns {string} The short version of the name, of the time zone of the embedded date instance
965
+ *
966
+ * @private
967
+ * @ui5-restricted SAPUI5 Distribution Layer Libraries
968
+ */
291
969
  UniversalDate.prototype.getTimezoneShort = function() {
292
970
  if (this.oDate.getTimezoneShort) {
293
971
  return this.oDate.getTimezoneShort();
294
972
  }
295
973
  };
974
+
975
+ /**
976
+ * Returns the long version of the time zone name of the embedded date instance.
977
+ *
978
+ * @returns {string} The long version of the name, of the time zone of the embedded date instance
979
+ *
980
+ * @private
981
+ * @ui5-restricted SAPUI5 Distribution Layer Libraries
982
+ */
296
983
  UniversalDate.prototype.getTimezoneLong = function() {
297
984
  if (this.oDate.getTimezoneLong) {
298
985
  return this.oDate.getTimezoneLong();
@@ -321,6 +1008,7 @@ sap.ui.define([
321
1008
  * e.g. <code>{firstDayOfWeek: 1, minimalDaysInFirstWeek: 4}</code>
322
1009
  * @returns {{week: int, year: int}} resulting calendar week, note: week index starts with <code>0</code>, e.g. <code>{year: 2016, week: 8}</code>
323
1010
  * @private
1011
+ * @ui5-restricted SAPUI5 Distribution Layer Libraries
324
1012
  * @throws {TypeError} If:
325
1013
  * <ul>
326
1014
  * <li>vCalendarWeekNumbering is an object and the fields <code>firstDayOfWeek</code> or <code>minimalDaysInFirstWeek</code>) are missing or have a non-numeric value</li>
@@ -374,6 +1062,7 @@ sap.ui.define([
374
1062
  * e.g. <code>{firstDayOfWeek: 1, minimalDaysInFirstWeek: 4}</code>
375
1063
  * @returns {{month: int, year: int, day: int}} the resulting date, e.g. <code>{year: 2016, month: 1, day: 29}</code>
376
1064
  * @private
1065
+ * @ui5-restricted SAPUI5 Distribution Layer Libraries
377
1066
  * @throws {TypeError} If:
378
1067
  * <ul>
379
1068
  * <li>vCalendarWeekNumbering is an object and the fields <code>firstDayOfWeek</code> or <code>minimalDaysInFirstWeek</code>) are missing or have a non-numeric value</li>
@@ -411,6 +1100,7 @@ sap.ui.define([
411
1100
  * @param {sap.ui.core.Locale} [oLocale] the locale used for the week calculation
412
1101
  * @returns {boolean} if the split week should be applied
413
1102
  * @private
1103
+ * @ui5-restricted SAPUI5 Distribution Layer Libraries
414
1104
  */
415
1105
  function isSplitWeek(vCalendarWeekNumbering, oLocale) {
416
1106
  oLocale = oLocale || Configuration.getFormatSettings().getFormatLocale();
@@ -431,6 +1121,7 @@ sap.ui.define([
431
1121
  * <li>vCalendarWeekNumbering is a string and has an invalid week numbering value</li>
432
1122
  * </ul>
433
1123
  * @private
1124
+ * @ui5-restricted SAPUI5 Distribution Layer Libraries
434
1125
  */
435
1126
  function checkWeekConfig(vCalendarWeekNumbering) {
436
1127
  if (typeof vCalendarWeekNumbering === "object") {
@@ -451,6 +1142,7 @@ sap.ui.define([
451
1142
  * object has the required properties <code>firstDayOfWeek</code> and
452
1143
  * <code>minimalDaysInFirstWeek</code> defined with a numeric value
453
1144
  * @private
1145
+ * @ui5-restricted SAPUI5 Distribution Layer Libraries
454
1146
  */
455
1147
  function isCalendarWeekConfigurationDefined (vCalendarWeekNumbering) {
456
1148
  if (typeof vCalendarWeekNumbering === "object") {
@@ -470,6 +1162,7 @@ sap.ui.define([
470
1162
  * @param {sap.ui.core.Locale} [oLocale] locale to be used
471
1163
  * @returns {{firstDayOfWeek: int, minimalDaysInFirstWeek: int}} calendar week calculation configuration
472
1164
  * @private
1165
+ * @ui5-restricted SAPUI5 Distribution Layer Libraries
473
1166
  */
474
1167
  function resolveCalendarWeekConfiguration (vCalendarWeekNumbering, oLocale) {
475
1168
  // be backward compatible
@@ -494,6 +1187,7 @@ sap.ui.define([
494
1187
  * e.g. <code>{firstDayOfWeek: 1, minimalDaysInFirstWeek: 4}</code>
495
1188
  * @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>
496
1189
  * @private
1190
+ * @ui5-restricted SAPUI5 Distribution Layer Libraries
497
1191
  */
498
1192
  function getFirstDayOfFirstWeek(clDate, iYear, oLocale, vCalendarWeekNumbering) {
499
1193
  oLocale = oLocale || Configuration.getFormatSettings().getFormatLocale();
@@ -521,6 +1215,16 @@ sap.ui.define([
521
1215
  return oFirstDay;
522
1216
  }
523
1217
 
1218
+ /**
1219
+ * Returns the rounded amount of weeks a given time frame.
1220
+ *
1221
+ * @param {Date} oFromDate The beginning date of the time interval
1222
+ * @param {Date} oToDate The end date of the time interval
1223
+ * @returns {int} A rounded number which represents the amount of weeks in the given timer interval
1224
+ *
1225
+ * @private
1226
+ * @ui5-restricted SAPUI5 Distribution Layer Libraries
1227
+ */
524
1228
  function calculateWeeks(oFromDate, oToDate) {
525
1229
  return Math.floor((oToDate.valueOf() - oFromDate.valueOf()) / iMillisecondsInWeek);
526
1230
  }
@@ -530,6 +1234,21 @@ sap.ui.define([
530
1234
  */
531
1235
  var mEras = {};
532
1236
 
1237
+ /**
1238
+ * Returns an index of the era for the given date values in the given calender. For
1239
+ * an index to be returned the date value has to be within the era time period, i.e. the
1240
+ * timestamp value of the date has to be bigger or equal than the start timestamp of the era
1241
+ * or smaller than the end of the end period.
1242
+ *
1243
+ * @param {string} sCalendarType The given calender type which the eras available for selection
1244
+ * @param {int} iYear The year value for which the era is looked for
1245
+ * @param {int} iMonth The month value for which the era is looked for
1246
+ * @param {int} iDay The date value for which the era is looked for
1247
+ * @returns {int} The index of the found era for the given date values in the given calender
1248
+ *
1249
+ * @private
1250
+ * @ui5-restricted SAPUI5 Distribution Layer Libraries
1251
+ */
533
1252
  UniversalDate.getEraByDate = function(sCalendarType, iYear, iMonth, iDay) {
534
1253
  var aEras = getEras(sCalendarType),
535
1254
  iTimestamp = new Date(0).setUTCFullYear(iYear, iMonth, iDay),
@@ -548,11 +1267,33 @@ sap.ui.define([
548
1267
  }
549
1268
  };
550
1269
 
1270
+ /**
1271
+ * Returns an index of the current era for the embedded date instance.
1272
+ *
1273
+ * @param {string} sCalendarType The calender type which defines the available eras to select from
1274
+ * @returns {int} The index of the current era of the embedded date instance
1275
+ *
1276
+ * @private
1277
+ * @ui5-restricted SAPUI5 Distribution Layer Libraries
1278
+ */
551
1279
  UniversalDate.getCurrentEra = function(sCalendarType) {
552
- var oNow = new Date();
1280
+ var oNow = UI5Date.getInstance();
553
1281
  return this.getEraByDate(sCalendarType, oNow.getFullYear(), oNow.getMonth(), oNow.getDate());
554
1282
  };
555
1283
 
1284
+ /**
1285
+ * Returns the start date of the selected era from the given era index, in the given calender type.
1286
+ *
1287
+ * @param {string} sCalendarType The calender type from which the era is to be picked
1288
+ * @param {int} iEra The given era index of the to be selected era
1289
+ * @returns {object|null}
1290
+ * The start date object of the selected era. If no era can be found for the given index the first
1291
+ * era of the selected calender is chosen. If the chosen era does not have a start date defined
1292
+ * <code>null</code>
1293
+ *
1294
+ * @private
1295
+ * @ui5-restricted SAPUI5 Distribution Layer Libraries
1296
+ */
556
1297
  UniversalDate.getEraStartDate = function(sCalendarType, iEra) {
557
1298
  var aEras = getEras(sCalendarType),
558
1299
  oEra = aEras[iEra] || aEras[0];
@@ -561,6 +1302,17 @@ sap.ui.define([
561
1302
  }
562
1303
  };
563
1304
 
1305
+ /**
1306
+ * Returns an array of era for the given calender.
1307
+ *
1308
+ * @param {string} sCalendarType
1309
+ * The calender type from which the the locale era data is taken from and the era array is
1310
+ * generated
1311
+ * @returns {array} An array of all available era in the given calender
1312
+ *
1313
+ * @private
1314
+ * @ui5-restricted SAPUI5 Distribution Layer Libraries
1315
+ */
564
1316
  function getEras(sCalendarType) {
565
1317
  var oLocale = Configuration.getFormatSettings().getFormatLocale(),
566
1318
  oLocaleData = LocaleData.getInstance(oLocale),
@@ -588,6 +1340,18 @@ sap.ui.define([
588
1340
  return aEras;
589
1341
  }
590
1342
 
1343
+ /**
1344
+ * Returns an object containing the date parts year, month, day of month and the date timestamp value
1345
+ * of the given date string.
1346
+ *
1347
+ * @param {string} sDateString The date string which is to be parsed
1348
+ * @returns {object}
1349
+ * An object containing the year, month, day of month and date timestamp values of the given
1350
+ * date string
1351
+ *
1352
+ * @private
1353
+ * @ui5-restricted SAPUI5 Distribution Layer Libraries
1354
+ */
591
1355
  function parseDateString(sDateString) {
592
1356
  var aParts = sDateString.split("-"),
593
1357
  iYear, iMonth, iDay;