@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.
- package/.dtsgenrc +63 -0
- package/THIRDPARTY.txt +1 -1
- package/package.json +1 -1
- package/src/jquery.sap.global.js +1 -1
- package/src/jquery.sap.properties.js +1 -1
- package/src/jquery.sap.resources.js +1 -1
- package/src/jquery.sap.script.js +1 -1
- package/src/jquery.sap.storage.js +3 -3
- package/src/sap/base/i18n/ResourceBundle.js +10 -0
- package/src/sap/base/security/URLListValidator.js +36 -3
- package/src/sap/base/util/restricted/_CancelablePromise.js +1 -1
- package/src/sap/base/util/restricted/_castArray.js +1 -1
- package/src/sap/base/util/restricted/_compact.js +1 -1
- package/src/sap/base/util/restricted/_curry.js +1 -1
- package/src/sap/base/util/restricted/_debounce.js +1 -1
- package/src/sap/base/util/restricted/_difference.js +1 -1
- package/src/sap/base/util/restricted/_differenceBy.js +1 -1
- package/src/sap/base/util/restricted/_differenceWith.js +1 -1
- package/src/sap/base/util/restricted/_flatMap.js +1 -1
- package/src/sap/base/util/restricted/_flatMapDeep.js +1 -1
- package/src/sap/base/util/restricted/_flatMapDepth.js +1 -1
- package/src/sap/base/util/restricted/_flatten.js +1 -1
- package/src/sap/base/util/restricted/_flattenDeep.js +1 -1
- package/src/sap/base/util/restricted/_flattenDepth.js +1 -1
- package/src/sap/base/util/restricted/_intersection.js +1 -1
- package/src/sap/base/util/restricted/_intersectionBy.js +1 -1
- package/src/sap/base/util/restricted/_intersectionWith.js +1 -1
- package/src/sap/base/util/restricted/_isEqual.js +1 -1
- package/src/sap/base/util/restricted/_isEqualWith.js +1 -1
- package/src/sap/base/util/restricted/_isNil.js +1 -1
- package/src/sap/base/util/restricted/_max.js +1 -1
- package/src/sap/base/util/restricted/_merge.js +1 -1
- package/src/sap/base/util/restricted/_mergeWith.js +1 -1
- package/src/sap/base/util/restricted/_min.js +1 -1
- package/src/sap/base/util/restricted/_omit.js +1 -1
- package/src/sap/base/util/restricted/_pick.js +1 -1
- package/src/sap/base/util/restricted/_pickBy.js +1 -1
- package/src/sap/base/util/restricted/_throttle.js +1 -1
- package/src/sap/base/util/restricted/_toArray.js +1 -1
- package/src/sap/base/util/restricted/_union.js +1 -1
- package/src/sap/base/util/restricted/_unionBy.js +1 -1
- package/src/sap/base/util/restricted/_unionWith.js +1 -1
- package/src/sap/base/util/restricted/_uniq.js +1 -1
- package/src/sap/base/util/restricted/_uniqBy.js +1 -1
- package/src/sap/base/util/restricted/_uniqWith.js +1 -1
- package/src/sap/base/util/restricted/_without.js +1 -1
- package/src/sap/base/util/restricted/_xor.js +1 -1
- package/src/sap/base/util/restricted/_xorBy.js +1 -1
- package/src/sap/base/util/restricted/_xorWith.js +1 -1
- package/src/sap/base/util/restricted/_zipObject.js +1 -1
- package/src/sap/base/util/restricted/_zipObjectDeep.js +1 -1
- package/src/sap/ui/Device.js +3 -3
- package/src/sap/ui/Global.js +4 -4
- package/src/sap/ui/base/Event.js +1 -1
- package/src/sap/ui/base/EventProvider.js +1 -1
- package/src/sap/ui/base/Interface.js +1 -1
- package/src/sap/ui/base/ManagedObject.js +2 -2
- package/src/sap/ui/base/ManagedObjectMetadata.js +1 -1
- package/src/sap/ui/base/Metadata.js +1 -1
- package/src/sap/ui/base/Object.js +1 -1
- package/src/sap/ui/base/ObjectPool.js +1 -1
- package/src/sap/ui/core/.library +50 -50
- package/src/sap/ui/core/BusyIndicator.js +1 -1
- package/src/sap/ui/core/BusyIndicatorUtils.js +22 -8
- package/src/sap/ui/core/Component.js +21 -4
- package/src/sap/ui/core/ComponentContainer.js +5 -1
- package/src/sap/ui/core/ComponentMetadata.js +1 -1
- package/src/sap/ui/core/ComponentSupport.js +1 -1
- package/src/sap/ui/core/Configuration.js +2 -15
- package/src/sap/ui/core/Control.js +20 -2
- package/src/sap/ui/core/Core.js +311 -413
- package/src/sap/ui/core/CustomData.js +1 -1
- package/src/sap/ui/core/DeclarativeSupport.js +1 -1
- package/src/sap/ui/core/Element.js +1 -1
- package/src/sap/ui/core/ElementMetadata.js +1 -1
- package/src/sap/ui/core/EnabledPropagator.js +1 -1
- package/src/sap/ui/core/EventBus.js +1 -1
- package/src/sap/ui/core/FocusHandler.js +12 -14
- package/src/sap/ui/core/Fragment.js +5 -2
- package/src/sap/ui/core/HTML.js +1 -1
- package/src/sap/ui/core/History.js +1 -1
- package/src/sap/ui/core/Icon.js +1 -1
- package/src/sap/ui/core/IconPool.js +7 -1
- package/src/sap/ui/core/IndicationColorSupport.js +1 -1
- package/src/sap/ui/core/IntervalTrigger.js +1 -1
- package/src/sap/ui/core/InvisibleMessage.js +1 -1
- package/src/sap/ui/core/InvisibleRenderer.js +1 -1
- package/src/sap/ui/core/InvisibleText.js +1 -1
- package/src/sap/ui/core/Item.js +1 -1
- package/src/sap/ui/core/LabelEnablement.js +1 -1
- package/src/sap/ui/core/LayoutData.js +1 -1
- package/src/sap/ui/core/ListItem.js +1 -1
- package/src/sap/ui/core/LocalBusyIndicator.js +1 -1
- package/src/sap/ui/core/Locale.js +1 -1
- package/src/sap/ui/core/LocaleData.js +1 -1
- package/src/sap/ui/core/Manifest.js +16 -83
- package/src/sap/ui/core/Message.js +1 -1
- package/src/sap/ui/core/Popup.js +14 -4
- package/src/sap/ui/core/RenderManager.js +111 -109
- package/src/sap/ui/core/Renderer.js +1 -1
- package/src/sap/ui/core/ResizeHandler.js +1 -1
- package/src/sap/ui/core/ScrollBar.js +1 -1
- package/src/sap/ui/core/SeparatorItem.js +1 -1
- package/src/sap/ui/core/ShortcutHintsMixin.js +20 -0
- package/src/sap/ui/core/Title.js +1 -1
- package/src/sap/ui/core/TooltipBase.js +1 -1
- package/src/sap/ui/core/UIArea.js +4 -2
- package/src/sap/ui/core/UIComponent.js +1 -1
- package/src/sap/ui/core/UIComponentMetadata.js +1 -1
- package/src/sap/ui/core/ValueStateSupport.js +1 -1
- package/src/sap/ui/core/VariantLayoutData.js +1 -1
- package/src/sap/ui/core/XMLComposite.js +1 -1
- package/src/sap/ui/core/XMLCompositeMetadata.js +1 -1
- package/src/sap/ui/core/_IconRegistry.js +11 -7
- package/src/sap/ui/core/_UrlResolver.js +139 -0
- package/src/sap/ui/core/date/CalendarUtils.js +87 -0
- package/src/sap/ui/core/date/CalendarWeekNumbering.js +73 -0
- package/src/sap/ui/core/date/UniversalDate.js +198 -74
- package/src/sap/ui/core/delegate/ItemNavigation.js +1 -1
- package/src/sap/ui/core/delegate/ScrollEnablement.js +1 -1
- package/src/sap/ui/core/dnd/DragDropBase.js +1 -1
- package/src/sap/ui/core/dnd/DragDropInfo.js +1 -1
- package/src/sap/ui/core/dnd/DragInfo.js +1 -1
- package/src/sap/ui/core/dnd/DropInfo.js +1 -1
- package/src/sap/ui/core/format/DateFormat.js +187 -57
- package/src/sap/ui/core/format/NumberFormat.js +64 -23
- package/src/sap/ui/core/format/TimezoneUtil.js +3 -1
- package/src/sap/ui/core/hyphenation/Hyphenation.js +1 -1
- package/src/sap/ui/core/library.js +19 -10
- package/src/sap/ui/core/message/ControlMessageProcessor.js +1 -1
- package/src/sap/ui/core/message/Message.js +5 -3
- package/src/sap/ui/core/message/MessageManager.js +1 -1
- package/src/sap/ui/core/message/MessageParser.js +1 -1
- package/src/sap/ui/core/message/MessageProcessor.js +1 -1
- package/src/sap/ui/core/messagebundle_fr.properties +1 -1
- package/src/sap/ui/core/mvc/HTMLView.js +10 -2
- package/src/sap/ui/core/mvc/JSONView.js +1 -1
- package/src/sap/ui/core/mvc/JSView.js +1 -1
- package/src/sap/ui/core/mvc/TemplateView.js +1 -1
- package/src/sap/ui/core/mvc/View.js +1 -1
- package/src/sap/ui/core/mvc/XMLView.js +1 -1
- package/src/sap/ui/core/plugin/DeclarativeSupport.js +1 -1
- package/src/sap/ui/core/plugin/LessSupport.js +21 -20
- package/src/sap/ui/core/plugin/TemplatingSupport.js +1 -1
- package/src/sap/ui/core/postmessage/Bus.js +1 -1
- package/src/sap/ui/core/postmessage/confirmationDialog.js +1 -1
- package/src/sap/ui/core/search/OpenSearchProvider.js +1 -1
- package/src/sap/ui/core/search/SearchProvider.js +1 -1
- package/src/sap/ui/core/service/Service.js +1 -1
- package/src/sap/ui/core/service/ServiceFactory.js +1 -1
- package/src/sap/ui/core/service/ServiceFactoryRegistry.js +1 -1
- package/src/sap/ui/core/support/Plugin.js +1 -1
- package/src/sap/ui/core/support/Support.js +1 -1
- package/src/sap/ui/core/support/plugins/ControlTree.js +1 -1
- package/src/sap/ui/core/support/plugins/Interaction.js +1 -1
- package/src/sap/ui/core/support/plugins/LocalStorage.js +1 -1
- package/src/sap/ui/core/support/plugins/Performance.js +1 -1
- package/src/sap/ui/core/support/plugins/Selector.js +1 -1
- package/src/sap/ui/core/support/plugins/TechInfo.js +1 -1
- package/src/sap/ui/core/support/plugins/Trace.js +1 -1
- package/src/sap/ui/core/support/plugins/ViewInfo.js +1 -1
- package/src/sap/ui/core/themes/base/LocalBusyIndicator.less +3 -3
- package/src/sap/ui/core/themes/base/fonts/SAP-icons.woff2 +0 -0
- package/src/sap/ui/core/theming/Parameters.js +31 -12
- package/src/sap/ui/core/theming/ThemeHelper.js +56 -1
- package/src/sap/ui/core/theming/ThemeManager.js +817 -0
- package/src/sap/ui/core/tmpl/DOMAttribute.js +1 -1
- package/src/sap/ui/core/tmpl/DOMElement.js +1 -1
- package/src/sap/ui/core/tmpl/HandlebarsTemplate.js +1 -1
- package/src/sap/ui/core/tmpl/Template.js +1 -1
- package/src/sap/ui/core/tmpl/TemplateControl.js +1 -1
- package/src/sap/ui/core/util/AsyncHintsHelper.js +1 -1
- package/src/sap/ui/core/util/Export.js +1 -1
- package/src/sap/ui/core/util/ExportCell.js +1 -1
- package/src/sap/ui/core/util/ExportColumn.js +1 -1
- package/src/sap/ui/core/util/ExportRow.js +1 -1
- package/src/sap/ui/core/util/ExportType.js +1 -1
- package/src/sap/ui/core/util/ExportTypeCSV.js +1 -1
- package/src/sap/ui/core/util/File.js +1 -1
- package/src/sap/ui/core/util/LibraryInfo.js +1 -1
- package/src/sap/ui/core/util/MockServer.js +1 -1
- package/src/sap/ui/core/util/PasteHelper.js +1 -1
- package/src/sap/ui/core/util/serializer/HTMLViewSerializer.js +2 -1
- package/src/sap/ui/core/util/serializer/Serializer.js +1 -1
- package/src/sap/ui/core/util/serializer/ViewSerializer.js +1 -1
- package/src/sap/ui/core/util/serializer/XMLViewSerializer.js +1 -1
- package/src/sap/ui/core/util/serializer/delegate/Delegate.js +1 -1
- package/src/sap/ui/core/util/serializer/delegate/HTML.js +1 -1
- package/src/sap/ui/core/util/serializer/delegate/XML.js +1 -1
- package/src/sap/ui/core/ws/ReadyState.js +1 -1
- package/src/sap/ui/core/ws/SapPcpWebSocket.js +1 -1
- package/src/sap/ui/core/ws/WebSocket.js +1 -1
- package/src/sap/ui/debug/ControlTree.js +1 -1
- package/src/sap/ui/debug/DebugEnv.js +1 -1
- package/src/sap/ui/debug/PropertyList.js +1 -1
- package/src/sap/ui/dom/getFirstEditableInput.js +25 -6
- package/src/sap/ui/dom/includeStylesheet.js +2 -2
- package/src/sap/ui/model/ClientListBinding.js +11 -4
- package/src/sap/ui/model/ClientModel.js +1 -1
- package/src/sap/ui/model/ClientTreeBinding.js +60 -5
- package/src/sap/ui/model/CompositeDataState.js +1 -1
- package/src/sap/ui/model/CompositeType.js +1 -1
- package/src/sap/ui/model/DataState.js +1 -1
- package/src/sap/ui/model/Filter.js +6 -6
- package/src/sap/ui/model/MetaModel.js +1 -1
- package/src/sap/ui/model/Model.js +1 -1
- package/src/sap/ui/model/SelectionModel.js +1 -1
- package/src/sap/ui/model/SimpleType.js +1 -1
- package/src/sap/ui/model/Sorter.js +6 -4
- package/src/sap/ui/model/TreeAutoExpandMode.js +1 -1
- package/src/sap/ui/model/TreeBinding.js +18 -0
- package/src/sap/ui/model/TreeBindingCompatibilityAdapter.js +1 -1
- package/src/sap/ui/model/Type.js +1 -1
- package/src/sap/ui/model/analytics/AnalyticalTreeBindingAdapter.js +28 -34
- package/src/sap/ui/model/controlhelper/TreeBindingProxy.js +590 -0
- package/src/sap/ui/model/json/JSONModel.js +1 -1
- package/src/sap/ui/model/message/MessageModel.js +1 -1
- package/src/sap/ui/model/odata/ODataAnnotations.js +1 -1
- package/src/sap/ui/model/odata/ODataMessageParser.js +1 -1
- package/src/sap/ui/model/odata/ODataMetaModel.js +1 -1
- package/src/sap/ui/model/odata/ODataMetadata.js +1 -1
- package/src/sap/ui/model/odata/ODataModel.js +1 -1
- package/src/sap/ui/model/odata/type/Boolean.js +1 -1
- package/src/sap/ui/model/odata/type/Byte.js +1 -1
- package/src/sap/ui/model/odata/type/Currency.js +1 -1
- package/src/sap/ui/model/odata/type/Date.js +1 -1
- package/src/sap/ui/model/odata/type/DateTime.js +1 -1
- package/src/sap/ui/model/odata/type/DateTimeBase.js +1 -1
- package/src/sap/ui/model/odata/type/DateTimeOffset.js +1 -1
- package/src/sap/ui/model/odata/type/DateTimeWithTimezone.js +1 -1
- package/src/sap/ui/model/odata/type/Decimal.js +1 -1
- package/src/sap/ui/model/odata/type/Double.js +1 -1
- package/src/sap/ui/model/odata/type/Guid.js +1 -1
- package/src/sap/ui/model/odata/type/Int.js +1 -1
- package/src/sap/ui/model/odata/type/Int16.js +1 -1
- package/src/sap/ui/model/odata/type/Int32.js +1 -1
- package/src/sap/ui/model/odata/type/Int64.js +1 -1
- package/src/sap/ui/model/odata/type/ODataType.js +1 -1
- package/src/sap/ui/model/odata/type/Raw.js +1 -1
- package/src/sap/ui/model/odata/type/SByte.js +1 -1
- package/src/sap/ui/model/odata/type/Single.js +1 -1
- package/src/sap/ui/model/odata/type/Stream.js +1 -1
- package/src/sap/ui/model/odata/type/String.js +1 -1
- package/src/sap/ui/model/odata/type/Time.js +1 -1
- package/src/sap/ui/model/odata/type/TimeOfDay.js +1 -1
- package/src/sap/ui/model/odata/type/Unit.js +1 -1
- package/src/sap/ui/model/odata/v2/BatchMode.js +2 -2
- package/src/sap/ui/model/odata/v2/Context.js +169 -4
- package/src/sap/ui/model/odata/v2/ODataAnnotations.js +1 -1
- package/src/sap/ui/model/odata/v2/ODataListBinding.js +39 -17
- package/src/sap/ui/model/odata/v2/ODataModel.js +219 -82
- package/src/sap/ui/model/odata/v2/ODataTreeBinding.js +1 -1
- package/src/sap/ui/model/odata/v4/Context.js +35 -22
- package/src/sap/ui/model/odata/v4/ODataBinding.js +28 -22
- package/src/sap/ui/model/odata/v4/ODataContextBinding.js +6 -6
- package/src/sap/ui/model/odata/v4/ODataListBinding.js +111 -89
- package/src/sap/ui/model/odata/v4/ODataMetaModel.js +5 -4
- package/src/sap/ui/model/odata/v4/ODataModel.js +84 -46
- package/src/sap/ui/model/odata/v4/ODataParentBinding.js +19 -20
- package/src/sap/ui/model/odata/v4/ODataPropertyBinding.js +3 -3
- package/src/sap/ui/model/odata/v4/_AnnotationHelperExpression.js +1 -1
- package/src/sap/ui/model/odata/v4/lib/_AggregationCache.js +12 -5
- package/src/sap/ui/model/odata/v4/lib/_Cache.js +130 -64
- package/src/sap/ui/model/odata/v4/lib/_Helper.js +1 -1
- package/src/sap/ui/model/odata/v4/lib/_Requestor.js +56 -15
- package/src/sap/ui/model/resource/ResourceModel.js +1 -1
- package/src/sap/ui/model/type/Boolean.js +1 -1
- package/src/sap/ui/model/type/Currency.js +1 -1
- package/src/sap/ui/model/type/Date.js +1 -1
- package/src/sap/ui/model/type/DateInterval.js +1 -1
- package/src/sap/ui/model/type/DateTime.js +1 -1
- package/src/sap/ui/model/type/DateTimeInterval.js +1 -1
- package/src/sap/ui/model/type/FileSize.js +1 -1
- package/src/sap/ui/model/type/Float.js +1 -1
- package/src/sap/ui/model/type/Integer.js +1 -1
- package/src/sap/ui/model/type/String.js +1 -1
- package/src/sap/ui/model/type/Time.js +1 -1
- package/src/sap/ui/model/type/TimeInterval.js +1 -1
- package/src/sap/ui/model/type/Unit.js +1 -1
- package/src/sap/ui/model/xml/XMLModel.js +1 -1
- package/src/sap/ui/qunit/utils/ControlIterator.js +1 -1
- package/src/sap/ui/qunit/utils/MemoryLeakCheck.js +1 -1
- package/src/sap/ui/test/TestUtils.js +20 -0
- package/src/sap/ui/test/generic/TestBase.js +1 -1
- package/src/sap/ui/thirdparty/mobify-carousel.js +0 -4
- package/src/sap/ui/util/Storage.js +1 -1
- package/src/sap/ui/core/ThemeCheck.js +0 -389
|
@@ -10,6 +10,8 @@ sap.ui.define([
|
|
|
10
10
|
'sap/ui/core/Locale',
|
|
11
11
|
'sap/ui/core/LocaleData',
|
|
12
12
|
'sap/ui/core/date/UniversalDate',
|
|
13
|
+
'sap/ui/core/date/CalendarUtils',
|
|
14
|
+
'sap/ui/core/date/CalendarWeekNumbering',
|
|
13
15
|
'sap/ui/core/format/TimezoneUtil',
|
|
14
16
|
"sap/base/util/deepEqual",
|
|
15
17
|
"sap/base/strings/formatMessage",
|
|
@@ -22,6 +24,8 @@ sap.ui.define([
|
|
|
22
24
|
Locale,
|
|
23
25
|
LocaleData,
|
|
24
26
|
UniversalDate,
|
|
27
|
+
CalendarUtils,
|
|
28
|
+
CalendarWeekNumbering,
|
|
25
29
|
TimezoneUtil,
|
|
26
30
|
deepEqual,
|
|
27
31
|
formatMessage,
|
|
@@ -224,6 +228,8 @@ sap.ui.define([
|
|
|
224
228
|
* Get a date instance of the DateFormat, which can be used for formatting.
|
|
225
229
|
*
|
|
226
230
|
* @param {object} [oFormatOptions] Object which defines the format options
|
|
231
|
+
* @param {sap.ui.core.date.CalendarWeekNumbering} [oFormatOptions.calendarWeekNumbering] @since 1.108.0 specifies the calendar week numbering.
|
|
232
|
+
* If specified, this overwrites <code>oFormatOptions.firstDayOfWeek</code> and <code>oFormatOptions.minimalDaysInFirstWeek</code>.
|
|
227
233
|
* @param {int} [oFormatOptions.firstDayOfWeek] @since 1.105.0 specifies the first day of the week starting with <code>0</code> (which is Sunday); if not defined, the value taken from the locale is used
|
|
228
234
|
* @param {int} [oFormatOptions.minimalDaysInFirstWeek] @since 1.105.0 minimal days at the beginning of the year which define the first calendar week; if not defined, the value taken from the locale is used
|
|
229
235
|
* @param {string} [oFormatOptions.format] @since 1.34.0 contains pattern symbols (e.g. "yMMMd" or "Hms") which will be converted into the pattern in the used locale, which matches the wanted symbols best.
|
|
@@ -232,7 +238,7 @@ sap.ui.define([
|
|
|
232
238
|
* @param {string} [oFormatOptions.pattern] a data pattern in LDML format. It is not verified whether the pattern represents only a date.
|
|
233
239
|
* @param {string} [oFormatOptions.style] can be either 'short, 'medium', 'long' or 'full'. If no pattern is given, a locale dependent default date pattern of that style is used from the LocaleData class.
|
|
234
240
|
* @param {boolean} [oFormatOptions.strictParsing] if true, by parsing it is checked if the value is a valid date
|
|
235
|
-
* @param {boolean} [oFormatOptions.relative] if true, the date is formatted relatively to todays date if it is within the given day range, e.g. "today", "
|
|
241
|
+
* @param {boolean} [oFormatOptions.relative] if true, the date is formatted relatively to todays date if it is within the given day range, e.g. "today", "1 day ago", "in 5 days"
|
|
236
242
|
* @param {int[]} [oFormatOptions.relativeRange] the day range used for relative formatting. If <code>oFormatOptions.relativeScale</code> is set to default value 'day', the relativeRange is by default [-6, 6], which means only the last 6 days, today and the next 6 days are formatted relatively. Otherwise when <code>oFormatOptions.relativeScale</code> is set to 'auto', all dates are formatted relatively.
|
|
237
243
|
* @param {string} [oFormatOptions.relativeScale="day"] if 'auto' is set, new relative time format is switched on for all Date/Time Instances. The relative scale is chosen depending on the difference between the given date and now.
|
|
238
244
|
* @param {string} [oFormatOptions.relativeStyle="wide"] @since 1.32.10, 1.34.4 the style of the relative format. The valid values are "wide", "short", "narrow"
|
|
@@ -245,6 +251,11 @@ sap.ui.define([
|
|
|
245
251
|
* @return {sap.ui.core.format.DateFormat} date instance of the DateFormat
|
|
246
252
|
* @static
|
|
247
253
|
* @public
|
|
254
|
+
* @throws {TypeError} If:
|
|
255
|
+
* <ul>
|
|
256
|
+
* <li>The <code>calendarWeekNumbering</code> format option has an unsupported value, or</li>
|
|
257
|
+
* <li>only one of the <code>firstDayOfWeek</code> and <code>minimalDaysInFirstWeek</code> parameters was provided.</li>
|
|
258
|
+
* </ul>
|
|
248
259
|
*/
|
|
249
260
|
DateFormat.getDateInstance = function(oFormatOptions, oLocale) {
|
|
250
261
|
return this.createInstance(oFormatOptions, oLocale, this.oDateInfo);
|
|
@@ -254,6 +265,8 @@ sap.ui.define([
|
|
|
254
265
|
* Get a datetime instance of the DateFormat, which can be used for formatting.
|
|
255
266
|
*
|
|
256
267
|
* @param {object} [oFormatOptions] Object which defines the format options
|
|
268
|
+
* @param {sap.ui.core.date.CalendarWeekNumbering} [oFormatOptions.calendarWeekNumbering] @since 1.108.0 specifies the calendar week numbering.
|
|
269
|
+
* If specified, this overwrites <code>oFormatOptions.firstDayOfWeek</code> and <code>oFormatOptions.minimalDaysInFirstWeek</code>.
|
|
257
270
|
* @param {int} [oFormatOptions.firstDayOfWeek] @since 1.105.0 specifies the first day of the week starting with <code>0</code> (which is Sunday); if not defined, the value taken from the locale is used
|
|
258
271
|
* @param {int} [oFormatOptions.minimalDaysInFirstWeek] @since 1.105.0 minimal days at the beginning of the year which define the first calendar week; if not defined, the value taken from the locale is used
|
|
259
272
|
* @param {string} [oFormatOptions.format] @since 1.34.0 contains pattern symbols (e.g. "yMMMd" or "Hms") which will be converted into the pattern in the used locale, which matches the wanted symbols best.
|
|
@@ -262,7 +275,7 @@ sap.ui.define([
|
|
|
262
275
|
* @param {string} [oFormatOptions.pattern] a datetime pattern in LDML format. It is not verified whether the pattern represents a full datetime.
|
|
263
276
|
* @param {string} [oFormatOptions.style] can be either 'short, 'medium', 'long' or 'full'. For datetime you can also define mixed styles, separated with a slash, where the first part is the date style and the second part is the time style (e.g. "medium/short"). If no pattern is given, a locale dependent default datetime pattern of that style is used from the LocaleData class.
|
|
264
277
|
* @param {boolean} [oFormatOptions.strictParsing] if true, by parsing it is checked if the value is a valid datetime
|
|
265
|
-
* @param {boolean} [oFormatOptions.relative] if true, the date is formatted relatively to today's date if it is within the given day range, e.g. "today", "
|
|
278
|
+
* @param {boolean} [oFormatOptions.relative] if true, the date is formatted relatively to today's date if it is within the given day range, e.g. "today", "1 day ago", "in 5 days"
|
|
266
279
|
* @param {int[]} [oFormatOptions.relativeRange] the day range used for relative formatting. If <code>oFormatOptions.relativeScale</code> is set to default value 'day', the relativeRange is by default [-6, 6], which means only the last 6 days, today and the next 6 days are formatted relatively. Otherwise when <code>oFormatOptions.relativeScale</code> is set to 'auto', all dates are formatted relatively.
|
|
267
280
|
* @param {string} [oFormatOptions.relativeScale="day"] if 'auto' is set, new relative time format is switched on for all Date/Time Instances. The relative scale is chosen depending on the difference between the given date and now.
|
|
268
281
|
* @param {string} [oFormatOptions.relativeStyle="wide"] @since 1.32.10, 1.34.4 the style of the relative format. The valid values are "wide", "short", "narrow"
|
|
@@ -275,6 +288,11 @@ sap.ui.define([
|
|
|
275
288
|
* @return {sap.ui.core.format.DateFormat} datetime instance of the DateFormat
|
|
276
289
|
* @static
|
|
277
290
|
* @public
|
|
291
|
+
* @throws {TypeError} If:
|
|
292
|
+
* <ul>
|
|
293
|
+
* <li>The <code>calendarWeekNumbering</code> format option has an unsupported value, or</li>
|
|
294
|
+
* <li>only one of the <code>firstDayOfWeek</code> and <code>minimalDaysInFirstWeek</code> parameters was provided.</li>
|
|
295
|
+
* </ul>
|
|
278
296
|
*/
|
|
279
297
|
DateFormat.getDateTimeInstance = function(oFormatOptions, oLocale) {
|
|
280
298
|
return this.createInstance(oFormatOptions, oLocale, this.oDateTimeInfo);
|
|
@@ -385,6 +403,8 @@ sap.ui.define([
|
|
|
385
403
|
* Get a datetimeWithTimezone instance of the DateFormat, which can be used for formatting.
|
|
386
404
|
*
|
|
387
405
|
* @param {object} [oFormatOptions] An object which defines the format options
|
|
406
|
+
* @param {sap.ui.core.date.CalendarWeekNumbering} [oFormatOptions.calendarWeekNumbering] @since 1.108.0 specifies the calendar week numbering.
|
|
407
|
+
* If specified, this overwrites <code>oFormatOptions.firstDayOfWeek</code> and <code>oFormatOptions.minimalDaysInFirstWeek</code>.
|
|
388
408
|
* @param {int} [oFormatOptions.firstDayOfWeek] @since 1.105.0 specifies the first day of the week starting with <code>0</code> (which is Sunday); if not defined, the value taken from the locale is used
|
|
389
409
|
* @param {int} [oFormatOptions.minimalDaysInFirstWeek] @since 1.105.0 minimal days at the beginning of the year which define the first calendar week; if not defined, the value taken from the locale is used
|
|
390
410
|
* @param {string} [oFormatOptions.format] A string containing pattern symbols (e.g. "yMMMd" or "Hms") which will be converted into a pattern for the used locale that matches the wanted symbols best.
|
|
@@ -399,7 +419,7 @@ sap.ui.define([
|
|
|
399
419
|
* It is ignored for formatting when an options pattern or a format are supplied.
|
|
400
420
|
* @param {string} [oFormatOptions.style] Can be either 'short, 'medium', 'long' or 'full'. For datetime you can also define mixed styles, separated with a slash, where the first part is the date style and the second part is the time style (e.g. "medium/short"). If no pattern is given, a locale-dependent default datetime pattern of that style from the LocaleData class is used.
|
|
401
421
|
* @param {boolean} [oFormatOptions.strictParsing] Whether to check by parsing if the value is a valid datetime
|
|
402
|
-
* @param {boolean} [oFormatOptions.relative] Whether the date is formatted relatively to today's date if it is within the given day range, e.g. "today", "
|
|
422
|
+
* @param {boolean} [oFormatOptions.relative] Whether the date is formatted relatively to today's date if it is within the given day range, e.g. "today", "1 day ago", "in 5 days"
|
|
403
423
|
* @param {int[]} [oFormatOptions.relativeRange] The day range used for relative formatting. If <code>oFormatOptions.relativeScale</code> is set to the default value 'day', the <code>relativeRange<code> is by default [-6, 6], which means that only the previous 6 and the following 6 days are formatted relatively. If <code>oFormatOptions.relativeScale</code> is set to 'auto', all dates are formatted relatively.
|
|
404
424
|
* @param {string} [oFormatOptions.relativeScale] If 'auto' is set, a new relative time format is switched on for all Date/Time instances. The default value depends on <code>showDate</code> and <code>showTime</code> options.
|
|
405
425
|
* @param {string} [oFormatOptions.relativeStyle="wide"] The style of the relative format. The valid values are "wide", "short", "narrow"
|
|
@@ -412,6 +432,11 @@ sap.ui.define([
|
|
|
412
432
|
* @static
|
|
413
433
|
* @public
|
|
414
434
|
* @since 1.99.0
|
|
435
|
+
* @throws {TypeError} If:
|
|
436
|
+
* <ul>
|
|
437
|
+
* <li>The <code>calendarWeekNumbering</code> format option has an unsupported value, or</li>
|
|
438
|
+
* <li>only one of the <code>firstDayOfWeek</code> and <code>minimalDaysInFirstWeek</code> parameters was provided.</li>
|
|
439
|
+
* </ul>
|
|
415
440
|
*/
|
|
416
441
|
DateFormat.getDateTimeWithTimezoneInstance = function(oFormatOptions, oLocale) {
|
|
417
442
|
// do not modify the input format options
|
|
@@ -443,6 +468,8 @@ sap.ui.define([
|
|
|
443
468
|
* Get a time instance of the DateFormat, which can be used for formatting.
|
|
444
469
|
*
|
|
445
470
|
* @param {object} [oFormatOptions] Object which defines the format options
|
|
471
|
+
* @param {sap.ui.core.date.CalendarWeekNumbering} [oFormatOptions.calendarWeekNumbering] @since 1.108.0 specifies the calendar week numbering.
|
|
472
|
+
* If specified, this overwrites <code>oFormatOptions.firstDayOfWeek</code> and <code>oFormatOptions.minimalDaysInFirstWeek</code>.
|
|
446
473
|
* @param {int} [oFormatOptions.firstDayOfWeek] @since 1.105.0 specifies the first day of the week starting with <code>0</code> (which is Sunday); if not defined, the value taken from the locale is used
|
|
447
474
|
* @param {int} [oFormatOptions.minimalDaysInFirstWeek] @since 1.105.0 minimal days at the beginning of the year which define the first calendar week; if not defined, the value taken from the locale is used
|
|
448
475
|
* @param {string} [oFormatOptions.format] @since 1.34.0 contains pattern symbols (e.g. "yMMMd" or "Hms") which will be converted into the pattern in the used locale, which matches the wanted symbols best.
|
|
@@ -451,7 +478,7 @@ sap.ui.define([
|
|
|
451
478
|
* @param {string} [oFormatOptions.pattern] a time pattern in LDML format. It is not verified whether the pattern only represents a time.
|
|
452
479
|
* @param {string} [oFormatOptions.style] can be either 'short, 'medium', 'long' or 'full'. If no pattern is given, a locale dependent default time pattern of that style is used from the LocaleData class.
|
|
453
480
|
* @param {boolean} [oFormatOptions.strictParsing] if true, by parsing it is checked if the value is a valid time
|
|
454
|
-
* @param {boolean} [oFormatOptions.relative] if true, the date is formatted relatively to todays date if it is within the given day range, e.g. "today", "
|
|
481
|
+
* @param {boolean} [oFormatOptions.relative] if true, the date is formatted relatively to todays date if it is within the given day range, e.g. "today", "1 day ago", "in 5 days"
|
|
455
482
|
* @param {int[]} [oFormatOptions.relativeRange] the day range used for relative formatting. If <code>oFormatOptions.relativeScale</code> is set to default value 'day', the relativeRange is by default [-6, 6], which means only the last 6 days, today and the next 6 days are formatted relatively. Otherwise when <code>oFormatOptions.relativeScale</code> is set to 'auto', all dates are formatted relatively.
|
|
456
483
|
* @param {string} [oFormatOptions.relativeScale="day"] if 'auto' is set, new relative time format is switched on for all Date/Time Instances. The relative scale is chosen depending on the difference between the given date and now.
|
|
457
484
|
* @param {string} [oFormatOptions.relativeStyle="wide"] @since 1.32.10, 1.34.4 the style of the relative format. The valid values are "wide", "short", "narrow"
|
|
@@ -464,6 +491,11 @@ sap.ui.define([
|
|
|
464
491
|
* @return {sap.ui.core.format.DateFormat} time instance of the DateFormat
|
|
465
492
|
* @static
|
|
466
493
|
* @public
|
|
494
|
+
* @throws {TypeError} If:
|
|
495
|
+
* <ul>
|
|
496
|
+
* <li>The <code>calendarWeekNumbering</code> format option has an unsupported value, or</li>
|
|
497
|
+
* <li>only one of the <code>firstDayOfWeek</code> and <code>minimalDaysInFirstWeek</code> parameters was provided.</li>
|
|
498
|
+
* </ul>
|
|
467
499
|
*/
|
|
468
500
|
DateFormat.getTimeInstance = function(oFormatOptions, oLocale) {
|
|
469
501
|
return this.createInstance(oFormatOptions, oLocale, this.oTimeInfo);
|
|
@@ -487,6 +519,11 @@ sap.ui.define([
|
|
|
487
519
|
* @return {sap.ui.core.format.DateFormat} time instance of the DateFormat
|
|
488
520
|
* @static
|
|
489
521
|
* @private
|
|
522
|
+
* @throws {TypeError} If:
|
|
523
|
+
* <ul>
|
|
524
|
+
* <li>The <code>calendarWeekNumbering</code> format option has an unsupported value, or</li>
|
|
525
|
+
* <li>only one of the <code>firstDayOfWeek</code> and <code>minimalDaysInFirstWeek</code> parameters was provided.</li>
|
|
526
|
+
* </ul>
|
|
490
527
|
*/
|
|
491
528
|
DateFormat.createInstance = function(oFormatOptions, oLocale, oInfo) {
|
|
492
529
|
// Create an instance of the DateFormat
|
|
@@ -529,7 +566,11 @@ sap.ui.define([
|
|
|
529
566
|
|
|
530
567
|
if (oFormat.oFormatOptions.firstDayOfWeek === undefined && oFormat.oFormatOptions.minimalDaysInFirstWeek !== undefined
|
|
531
568
|
|| oFormat.oFormatOptions.firstDayOfWeek !== undefined && oFormat.oFormatOptions.minimalDaysInFirstWeek === undefined) {
|
|
532
|
-
throw new
|
|
569
|
+
throw new TypeError("Format options firstDayOfWeek and minimalDaysInFirstWeek need both to be set, but only one was provided.");
|
|
570
|
+
}
|
|
571
|
+
|
|
572
|
+
if (oFormat.oFormatOptions.calendarWeekNumbering && !Object.values(CalendarWeekNumbering).includes(oFormat.oFormatOptions.calendarWeekNumbering)) {
|
|
573
|
+
throw new TypeError("Illegal format option calendarWeekNumbering: '" + oFormat.oFormatOptions.calendarWeekNumbering + "'");
|
|
533
574
|
}
|
|
534
575
|
|
|
535
576
|
if (!oFormat.oFormatOptions.pattern) {
|
|
@@ -650,7 +691,9 @@ sap.ui.define([
|
|
|
650
691
|
this.aErasNarrow = this.oLocaleData.getEras("narrow", sCalendarType);
|
|
651
692
|
this.aErasAbbrev = this.oLocaleData.getEras("abbreviated", sCalendarType);
|
|
652
693
|
this.aErasWide = this.oLocaleData.getEras("wide", sCalendarType);
|
|
653
|
-
this.
|
|
694
|
+
this.aDayPeriodsAbbrev = this.oLocaleData.getDayPeriods("abbreviated", sCalendarType);
|
|
695
|
+
this.aDayPeriodsNarrow = this.oLocaleData.getDayPeriods("narrow", sCalendarType);
|
|
696
|
+
this.aDayPeriodsWide = this.oLocaleData.getDayPeriods("wide", sCalendarType);
|
|
654
697
|
this.aFormatArray = this.parseCldrDatePattern(this.oFormatOptions.pattern);
|
|
655
698
|
this.sAllowedCharacters = this.getAllowedCharacters(this.aFormatArray);
|
|
656
699
|
};
|
|
@@ -870,7 +913,8 @@ sap.ui.define([
|
|
|
870
913
|
};
|
|
871
914
|
|
|
872
915
|
/**
|
|
873
|
-
*
|
|
916
|
+
* Provides functionality to format and parse a given pattern symbol.
|
|
917
|
+
* @see https://unicode.org/reports/tr35/tr35-dates.html#table-date-field-symbol-table
|
|
874
918
|
*/
|
|
875
919
|
DateFormat.prototype.oSymbols = {
|
|
876
920
|
"": {
|
|
@@ -1034,10 +1078,7 @@ sap.ui.define([
|
|
|
1034
1078
|
"Y": {
|
|
1035
1079
|
name: "weekYear",
|
|
1036
1080
|
format: function(oField, oDate, bUTC, oFormat) {
|
|
1037
|
-
var oWeek = oDate.getUTCWeek(oFormat.oLocale,
|
|
1038
|
-
firstDayOfWeek: oFormat.oFormatOptions.firstDayOfWeek,
|
|
1039
|
-
minimalDaysInFirstWeek: oFormat.oFormatOptions.minimalDaysInFirstWeek
|
|
1040
|
-
});
|
|
1081
|
+
var oWeek = oDate.getUTCWeek(oFormat.oLocale, getCalendarWeekParameter(oFormat.oFormatOptions));
|
|
1041
1082
|
var iWeekYear = oWeek.year;
|
|
1042
1083
|
var sWeekYear = String(iWeekYear);
|
|
1043
1084
|
var sCalendarType = oFormat.oFormatOptions.calendarType;
|
|
@@ -1183,10 +1224,7 @@ sap.ui.define([
|
|
|
1183
1224
|
"w": {
|
|
1184
1225
|
name: "weekInYear",
|
|
1185
1226
|
format: function(oField, oDate, bUTC, oFormat) {
|
|
1186
|
-
var oWeek = oDate.getUTCWeek(oFormat.oLocale,
|
|
1187
|
-
firstDayOfWeek: oFormat.oFormatOptions.firstDayOfWeek,
|
|
1188
|
-
minimalDaysInFirstWeek: oFormat.oFormatOptions.minimalDaysInFirstWeek
|
|
1189
|
-
});
|
|
1227
|
+
var oWeek = oDate.getUTCWeek(oFormat.oLocale, getCalendarWeekParameter(oFormat.oFormatOptions));
|
|
1190
1228
|
var iWeek = oWeek.week;
|
|
1191
1229
|
var sWeek = String(iWeek + 1);
|
|
1192
1230
|
if (oField.digits < 3) {
|
|
@@ -1455,48 +1493,114 @@ sap.ui.define([
|
|
|
1455
1493
|
},
|
|
1456
1494
|
"a": {
|
|
1457
1495
|
name: "amPmMarker",
|
|
1458
|
-
|
|
1496
|
+
/**
|
|
1497
|
+
* Formats the day period.
|
|
1498
|
+
*
|
|
1499
|
+
* @param {Object<string, any>} oField
|
|
1500
|
+
* The date pattern field as parsed by {@link DateFormat#parseCldrDatePattern}
|
|
1501
|
+
* @param {number} oField.digits
|
|
1502
|
+
* The number of repetitions of the pattern symbol, e.g. <code>3</code> for "aaa"
|
|
1503
|
+
* @param {string} oField.symbol
|
|
1504
|
+
* The pattern symbol "a"
|
|
1505
|
+
* @param {string} oField.type
|
|
1506
|
+
* The symbol name "amPmMarker"
|
|
1507
|
+
* @param {sap.ui.core.date.UniversalDate} oDate
|
|
1508
|
+
* The date to format
|
|
1509
|
+
* @param {boolean} [bUTC]
|
|
1510
|
+
* Whether the UTC option is set; not used
|
|
1511
|
+
* @param {sap.ui.core.format.DateFormat} oFormat
|
|
1512
|
+
* The <code>DateFormat</code> instance
|
|
1513
|
+
* @returns {string}
|
|
1514
|
+
* The formatted day period, e.g. "AM" for symbol "a"
|
|
1515
|
+
*/
|
|
1516
|
+
format : function (oField, oDate, bUTC, oFormat) {
|
|
1459
1517
|
var iDayPeriod = oDate.getUTCDayPeriod();
|
|
1460
1518
|
|
|
1461
|
-
|
|
1519
|
+
if (oField.digits <= 3) {
|
|
1520
|
+
return oFormat.aDayPeriodsAbbrev[iDayPeriod];
|
|
1521
|
+
} else if (oField.digits === 4) {
|
|
1522
|
+
return oFormat.aDayPeriodsWide[iDayPeriod];
|
|
1523
|
+
} else {
|
|
1524
|
+
return oFormat.aDayPeriodsNarrow[iDayPeriod];
|
|
1525
|
+
}
|
|
1462
1526
|
},
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1527
|
+
|
|
1528
|
+
/**
|
|
1529
|
+
* Parses the day period from a given input string.
|
|
1530
|
+
*
|
|
1531
|
+
* @param {string} sValue
|
|
1532
|
+
* The given input, e.g. "am 13:37"
|
|
1533
|
+
* @param {Object<string, any>} oPart
|
|
1534
|
+
* The date pattern field as parsed by {@link DateFormat#parseCldrDatePattern}
|
|
1535
|
+
* @param {number} oPart.digits
|
|
1536
|
+
* The number of repetitions of the pattern symbol, e.g. <code>3</code> for "aaa"
|
|
1537
|
+
* @param {string} oPart.symbol
|
|
1538
|
+
* The pattern symbol "a"
|
|
1539
|
+
* @param {string} oPart.type
|
|
1540
|
+
* The symbol name "amPmMarker"
|
|
1541
|
+
* @param {sap.ui.core.format.DateFormat} oFormat
|
|
1542
|
+
* The <code>DateFormat</code> instance
|
|
1543
|
+
* @param {Object<string, any>} [oConfig]
|
|
1544
|
+
* The configuration object for parsing the value
|
|
1545
|
+
* @param {object[]} [oConfig.formatArray]
|
|
1546
|
+
* The complete format array as parsed by {@link DateFormat#parseCldrDatePattern}
|
|
1547
|
+
* @param {object} [oConfig.dateValue]
|
|
1548
|
+
* The already parsed date fields
|
|
1549
|
+
* @param {number} [oConfig.index]
|
|
1550
|
+
* The index in the format array
|
|
1551
|
+
* @param {boolean} [oConfig.strict]
|
|
1552
|
+
* Whether to use the strict option
|
|
1553
|
+
* @param {string} [sTimezone]
|
|
1554
|
+
* The IANA timezone ID
|
|
1555
|
+
* @returns {{length : number, pm : boolean}|{}}
|
|
1556
|
+
* An object with the <code>length</code> of the match and the parsed <code>pm</code>
|
|
1557
|
+
* value; or an object with property valid <code>false</code> if it could not be
|
|
1558
|
+
* parsed correctly
|
|
1559
|
+
*/
|
|
1560
|
+
parse : function (sValue, oPart, oFormat, oConfig, sTimezone) {
|
|
1561
|
+
// process longer patterns first to find the longest match
|
|
1562
|
+
// wide > abbreviated > narrow
|
|
1563
|
+
var rAMPM, bAMPMAlternativeCase, oEntry, i, aMatch, normalize, aVariants,
|
|
1564
|
+
aDayPeriodsVariants = [oFormat.aDayPeriodsWide, oFormat.aDayPeriodsAbbrev,
|
|
1565
|
+
oFormat.aDayPeriodsNarrow];
|
|
1566
|
+
|
|
1567
|
+
// Support ASCII alternative writings for AM/PM (when the locale has am/pm in its
|
|
1568
|
+
// patterns), e.g. "am", "a.m.", "am.", "a. m." (and their case alternatives)
|
|
1569
|
+
// see: https://unicode.org/reports/tr35/tr35-dates.html#Parsing_Dates_Times
|
|
1570
|
+
rAMPM = /[aApP](?:\.)?[\x20\xA0]?[mM](?:\.)?/;
|
|
1571
|
+
aMatch = sValue.match(rAMPM);
|
|
1572
|
+
bAMPMAlternativeCase = aMatch && aMatch.index === 0;
|
|
1573
|
+
function normalize (sValue) {
|
|
1574
|
+
// Remove normal and non-breaking spaces and remove dots
|
|
1575
|
+
return sValue.replace(/[\x20\xA0]/g, "").replace(/\./g, "");
|
|
1576
|
+
}
|
|
1577
|
+
if (bAMPMAlternativeCase) {
|
|
1578
|
+
sValue = normalize(sValue);
|
|
1579
|
+
}
|
|
1580
|
+
|
|
1581
|
+
for (i = 0; i < aDayPeriodsVariants.length; i += 1) {
|
|
1582
|
+
aVariants = aDayPeriodsVariants[i];
|
|
1583
|
+
|
|
1584
|
+
if (bAMPMAlternativeCase) {
|
|
1585
|
+
// check normalized match for alternative case of am/pm
|
|
1586
|
+
aVariants = aVariants.map(normalize);
|
|
1587
|
+
}
|
|
1588
|
+
// check exact and case-insensitive match
|
|
1589
|
+
oEntry = oParseHelper.findEntry(sValue, aVariants,
|
|
1590
|
+
oFormat.oLocaleData.sCLDRLocaleId);
|
|
1591
|
+
if (oEntry.index !== -1) {
|
|
1592
|
+
return {
|
|
1593
|
+
pm : oEntry.index === 1,
|
|
1594
|
+
// am/pm alternative may include an additional dot, e.g. "am."
|
|
1595
|
+
// therefore the length for the am/pm alternative is the length of the
|
|
1596
|
+
// match
|
|
1597
|
+
length : bAMPMAlternativeCase ? aMatch[0].length : oEntry.length
|
|
1598
|
+
};
|
|
1599
|
+
}
|
|
1496
1600
|
}
|
|
1601
|
+
|
|
1497
1602
|
return {
|
|
1498
|
-
|
|
1499
|
-
length: iLength
|
|
1603
|
+
valid: false
|
|
1500
1604
|
};
|
|
1501
1605
|
}
|
|
1502
1606
|
},
|
|
@@ -2248,6 +2352,28 @@ sap.ui.define([
|
|
|
2248
2352
|
return aDateValues;
|
|
2249
2353
|
};
|
|
2250
2354
|
|
|
2355
|
+
/**
|
|
2356
|
+
* Retrieves the parameter for the calendar week configuration from the DateFormat's format
|
|
2357
|
+
* options
|
|
2358
|
+
*
|
|
2359
|
+
* @param {{firstDayOfWeek: int, minimalDaysInFirstWeek: int, calendarWeekNumbering: sap.ui.core.date.CalendarWeekNumbering}} oFormatOptions
|
|
2360
|
+
* The format options with which the DateFormat instance was created
|
|
2361
|
+
* @returns {sap.ui.core.date.CalendarWeekNumbering|{firstDayOfWeek: int, minimalDaysInFirstWeek: int}|undefined}
|
|
2362
|
+
* The parameter for the calendar week configuration
|
|
2363
|
+
*/
|
|
2364
|
+
function getCalendarWeekParameter (oFormatOptions) {
|
|
2365
|
+
if (oFormatOptions.calendarWeekNumbering) {
|
|
2366
|
+
return oFormatOptions.calendarWeekNumbering;
|
|
2367
|
+
// either both are provided or none (checked in DateFormat.createInstance)
|
|
2368
|
+
} else if (oFormatOptions.firstDayOfWeek !== undefined && oFormatOptions.minimalDaysInFirstWeek !== undefined) {
|
|
2369
|
+
return {
|
|
2370
|
+
firstDayOfWeek: oFormatOptions.firstDayOfWeek,
|
|
2371
|
+
minimalDaysInFirstWeek: oFormatOptions.minimalDaysInFirstWeek
|
|
2372
|
+
};
|
|
2373
|
+
}
|
|
2374
|
+
return undefined;
|
|
2375
|
+
}
|
|
2376
|
+
|
|
2251
2377
|
/**
|
|
2252
2378
|
* Converts a given date to the given timezone if bUTC is false
|
|
2253
2379
|
*
|
|
@@ -2293,10 +2419,7 @@ sap.ui.define([
|
|
|
2293
2419
|
oDate.setUTCWeek({
|
|
2294
2420
|
year: oDateValue.weekYear || oDateValue.year,
|
|
2295
2421
|
week: oDateValue.week
|
|
2296
|
-
}, oLocale,
|
|
2297
|
-
firstDayOfWeek: oFormatOptions.firstDayOfWeek,
|
|
2298
|
-
minimalDaysInFirstWeek: oFormatOptions.minimalDaysInFirstWeek
|
|
2299
|
-
});
|
|
2422
|
+
}, oLocale, getCalendarWeekParameter(oFormatOptions));
|
|
2300
2423
|
|
|
2301
2424
|
// add the dayNumberOfWeek to the current day
|
|
2302
2425
|
if (oDateValue.dayNumberOfWeek !== undefined) {
|
|
@@ -2891,7 +3014,14 @@ sap.ui.define([
|
|
|
2891
3014
|
DateFormat.prototype._adaptDayOfWeek = function(iDayOfWeek) {
|
|
2892
3015
|
// day of week depends on the format locale
|
|
2893
3016
|
// the DateFormat's locale is independent
|
|
2894
|
-
var
|
|
3017
|
+
var vCalendarWeekParameter = getCalendarWeekParameter(this.oFormatOptions),
|
|
3018
|
+
iFirstDayOfWeek;
|
|
3019
|
+
if (typeof vCalendarWeekParameter === "object") {
|
|
3020
|
+
iFirstDayOfWeek = vCalendarWeekParameter.firstDayOfWeek;
|
|
3021
|
+
} else {
|
|
3022
|
+
iFirstDayOfWeek = CalendarUtils.getWeekConfigurationValues(vCalendarWeekParameter, this.oLocale).firstDayOfWeek;
|
|
3023
|
+
}
|
|
3024
|
+
|
|
2895
3025
|
var iDayNumberOfWeek = iDayOfWeek - (iFirstDayOfWeek - 1);
|
|
2896
3026
|
|
|
2897
3027
|
if (iDayNumberOfWeek <= 0) {
|
|
@@ -2782,25 +2782,63 @@ sap.ui.define([
|
|
|
2782
2782
|
* Identify the longest match between a sub string of <code>sValue</code>
|
|
2783
2783
|
* and one of the values of the <code>mCollection</code> map.
|
|
2784
2784
|
*
|
|
2785
|
-
* @param {string} sValue
|
|
2786
|
-
*
|
|
2787
|
-
*
|
|
2788
|
-
*
|
|
2785
|
+
* @param {string} sValue
|
|
2786
|
+
* The string value which is checked for all currency codes/symbols
|
|
2787
|
+
* @param {Object<string, string>} mCollection
|
|
2788
|
+
* An object mapping a currency code to a either a currency symbol or the currency code itself
|
|
2789
|
+
* @param {boolean} bCaseInsensitive Whether case insensitive matches are allowed
|
|
2790
|
+
* @return {{code: string, recognizedCurrency: string, symbol: string}}
|
|
2791
|
+
* An object with the code, the recognized currency and the symbol found in the given value;
|
|
2792
|
+
* an empty object in case of either conflicting case insensitive matches, or no match
|
|
2789
2793
|
*/
|
|
2790
|
-
function findLongestMatch(sValue, mCollection) {
|
|
2791
|
-
var
|
|
2792
|
-
|
|
2793
|
-
|
|
2794
|
+
function findLongestMatch(sValue, mCollection, bCaseInsensitive) {
|
|
2795
|
+
var sCode, sCurCode, sCurSymbol, sCurSymbolToUpperCase, iIndex, sLanguageTag,
|
|
2796
|
+
sRecognizedCurrency, sValueSubStr,
|
|
2797
|
+
bDuplicate = false,
|
|
2798
|
+
bExactMatch = false,
|
|
2799
|
+
sSymbol = "";
|
|
2800
|
+
|
|
2801
|
+
for (sCurCode in mCollection) {
|
|
2794
2802
|
sCurSymbol = mCollection[sCurCode];
|
|
2795
|
-
if (
|
|
2796
|
-
|
|
2803
|
+
if (!sCurSymbol) {
|
|
2804
|
+
continue;
|
|
2805
|
+
}
|
|
2806
|
+
if (sValue.indexOf(sCurSymbol) >= 0 && sSymbol.length <= sCurSymbol.length) {
|
|
2797
2807
|
sCode = sCurCode;
|
|
2808
|
+
bDuplicate = false;
|
|
2809
|
+
bExactMatch = true;
|
|
2810
|
+
sSymbol = sCurSymbol;
|
|
2811
|
+
sRecognizedCurrency = sCurSymbol;
|
|
2812
|
+
} else if (bCaseInsensitive) {
|
|
2813
|
+
sLanguageTag = Configuration.getLanguageTag();
|
|
2814
|
+
sCurSymbolToUpperCase = sCurSymbol.toLocaleUpperCase(sLanguageTag);
|
|
2815
|
+
iIndex = sValue.toLocaleUpperCase(sLanguageTag).indexOf(sCurSymbolToUpperCase);
|
|
2816
|
+
if (iIndex >= 0) {
|
|
2817
|
+
if (sSymbol.length === sCurSymbol.length && !bExactMatch) {
|
|
2818
|
+
bDuplicate = true;
|
|
2819
|
+
} else if (sSymbol.length < sCurSymbol.length) {
|
|
2820
|
+
sValueSubStr = sValue.substring(iIndex, iIndex + sCurSymbol.length);
|
|
2821
|
+
if (sValueSubStr.toLocaleUpperCase(sLanguageTag)
|
|
2822
|
+
=== sCurSymbolToUpperCase) {
|
|
2823
|
+
sCode = sCurCode;
|
|
2824
|
+
bDuplicate = false;
|
|
2825
|
+
bExactMatch = false;
|
|
2826
|
+
sSymbol = sCurSymbol;
|
|
2827
|
+
sRecognizedCurrency = sValueSubStr;
|
|
2828
|
+
}
|
|
2829
|
+
}
|
|
2830
|
+
}
|
|
2798
2831
|
}
|
|
2799
2832
|
}
|
|
2800
2833
|
|
|
2834
|
+
if (bDuplicate || !sCode) {
|
|
2835
|
+
return {};
|
|
2836
|
+
}
|
|
2837
|
+
|
|
2801
2838
|
return {
|
|
2802
|
-
|
|
2803
|
-
|
|
2839
|
+
code : sCode,
|
|
2840
|
+
recognizedCurrency : sRecognizedCurrency,
|
|
2841
|
+
symbol : sSymbol
|
|
2804
2842
|
};
|
|
2805
2843
|
}
|
|
2806
2844
|
|
|
@@ -2823,7 +2861,8 @@ sap.ui.define([
|
|
|
2823
2861
|
* @returns {object|undefined} returns object containing numberValue and currencyCode or undefined
|
|
2824
2862
|
*/
|
|
2825
2863
|
function parseNumberAndCurrency(oConfig) {
|
|
2826
|
-
var
|
|
2864
|
+
var aIsoMatches,
|
|
2865
|
+
sValue = oConfig.value;
|
|
2827
2866
|
|
|
2828
2867
|
// Search for known symbols (longest match)
|
|
2829
2868
|
// no distinction between default and custom currencies
|
|
@@ -2833,26 +2872,28 @@ sap.ui.define([
|
|
|
2833
2872
|
if (!oMatch.code) {
|
|
2834
2873
|
// before falling back to the default regex for ISO codes we check the
|
|
2835
2874
|
// codes for custom currencies (if defined)
|
|
2836
|
-
oMatch = findLongestMatch(sValue, oConfig.customCurrencyCodes);
|
|
2875
|
+
oMatch = findLongestMatch(sValue, oConfig.customCurrencyCodes, true);
|
|
2837
2876
|
|
|
2838
2877
|
if (!oMatch.code && !oConfig.customCurrenciesAvailable) {
|
|
2839
2878
|
// Match 3-letter iso code
|
|
2840
|
-
|
|
2841
|
-
oMatch.code = aIsoMatches
|
|
2879
|
+
aIsoMatches = sValue.match(/(^[A-Z]{3}|[A-Z]{3}$)/i);
|
|
2880
|
+
oMatch.code = aIsoMatches
|
|
2881
|
+
&& aIsoMatches[0].toLocaleUpperCase(Configuration.getLanguageTag());
|
|
2882
|
+
oMatch.recognizedCurrency = aIsoMatches && aIsoMatches[0];
|
|
2842
2883
|
}
|
|
2843
2884
|
}
|
|
2844
2885
|
|
|
2845
2886
|
// Remove symbol/code from value
|
|
2846
2887
|
if (oMatch.code) {
|
|
2847
|
-
var iLastCodeIndex = oMatch.
|
|
2848
|
-
var sLastCodeChar = oMatch.
|
|
2888
|
+
var iLastCodeIndex = oMatch.recognizedCurrency.length - 1;
|
|
2889
|
+
var sLastCodeChar = oMatch.recognizedCurrency.charAt(iLastCodeIndex);
|
|
2849
2890
|
var iDelimiterPos;
|
|
2850
2891
|
var rValidDelimiters = /[\-\s]+/;
|
|
2851
2892
|
|
|
2852
2893
|
// Check whether last character of matched code is a number
|
|
2853
2894
|
if (/\d$/.test(sLastCodeChar)) {
|
|
2854
2895
|
// Check whether parse string starts with the matched code
|
|
2855
|
-
if (sValue.startsWith(oMatch.
|
|
2896
|
+
if (sValue.startsWith(oMatch.recognizedCurrency)) {
|
|
2856
2897
|
iDelimiterPos = iLastCodeIndex + 1;
|
|
2857
2898
|
// \s matching any whitespace character including
|
|
2858
2899
|
// non-breaking ws and invisible non-breaking ws
|
|
@@ -2861,16 +2902,16 @@ sap.ui.define([
|
|
|
2861
2902
|
}
|
|
2862
2903
|
}
|
|
2863
2904
|
// Check whether first character of matched code is a number
|
|
2864
|
-
} else if (/^\d/.test(oMatch.
|
|
2905
|
+
} else if (/^\d/.test(oMatch.recognizedCurrency)) {
|
|
2865
2906
|
// Check whether parse string ends with the matched code
|
|
2866
|
-
if (sValue.endsWith(oMatch.
|
|
2867
|
-
iDelimiterPos = sValue.indexOf(oMatch.
|
|
2907
|
+
if (sValue.endsWith(oMatch.recognizedCurrency)) {
|
|
2908
|
+
iDelimiterPos = sValue.indexOf(oMatch.recognizedCurrency) - 1;
|
|
2868
2909
|
if (!rValidDelimiters.test(sValue.charAt(iDelimiterPos))) {
|
|
2869
2910
|
return undefined;
|
|
2870
2911
|
}
|
|
2871
2912
|
}
|
|
2872
2913
|
}
|
|
2873
|
-
sValue = sValue.replace(oMatch.
|
|
2914
|
+
sValue = sValue.replace(oMatch.recognizedCurrency, "");
|
|
2874
2915
|
}
|
|
2875
2916
|
|
|
2876
2917
|
// Set currency code to undefined, as the defined custom currencies
|
|
@@ -11,7 +11,7 @@ sap.ui.define([], function() {
|
|
|
11
11
|
* Static collection of utility functions to handle time zone related conversions
|
|
12
12
|
*
|
|
13
13
|
* @author SAP SE
|
|
14
|
-
* @version 1.
|
|
14
|
+
* @version 1.108.0
|
|
15
15
|
* @namespace
|
|
16
16
|
* @alias sap.ui.core.format.TimezoneUtil
|
|
17
17
|
* @private
|
|
@@ -129,7 +129,9 @@ sap.ui.define([], function() {
|
|
|
129
129
|
* var oDate = new Date("2021-10-13T15:22:33Z"); // UTC
|
|
130
130
|
* // time zone difference UTC-4 (DST)
|
|
131
131
|
* TimezoneUtil.convertToTimezone(oDate, "America/New_York");
|
|
132
|
+
* result is:
|
|
132
133
|
* // 2021-10-13 11:22:33 in America/New_York
|
|
134
|
+
* // same as new Date("2021-10-13T11:22:33Z"); // UTC
|
|
133
135
|
*
|
|
134
136
|
* @param {Date} oDate The date which should be converted.
|
|
135
137
|
* @param {string} sTargetTimezone The target IANA timezone ID, e.g <code>"Europe/Berlin"</code>
|
|
@@ -400,7 +400,7 @@ sap.ui.define([
|
|
|
400
400
|
* @see {@link topic:6322164936f047de941ec522b95d7b70 Hyphenation for Text Controls}
|
|
401
401
|
* @extends sap.ui.base.ManagedObject
|
|
402
402
|
* @author SAP SE
|
|
403
|
-
* @version 1.
|
|
403
|
+
* @version 1.108.0
|
|
404
404
|
* @hideconstructor
|
|
405
405
|
* @public
|
|
406
406
|
* @since 1.60
|
|
@@ -25,13 +25,13 @@ sap.ui.define([
|
|
|
25
25
|
* @namespace
|
|
26
26
|
* @alias sap.ui.core
|
|
27
27
|
* @author SAP SE
|
|
28
|
-
* @version 1.
|
|
28
|
+
* @version 1.108.0
|
|
29
29
|
* @since 0.8
|
|
30
30
|
* @public
|
|
31
31
|
*/
|
|
32
32
|
var thisLib = sap.ui.getCore().initLibrary({
|
|
33
33
|
name : "sap.ui.core",
|
|
34
|
-
version: "1.
|
|
34
|
+
version: "1.108.0",
|
|
35
35
|
designtime: "sap/ui/core/designtime/library.designtime",
|
|
36
36
|
types: [
|
|
37
37
|
|
|
@@ -813,7 +813,13 @@ sap.ui.define([
|
|
|
813
813
|
* Type: Large size
|
|
814
814
|
* @public
|
|
815
815
|
*/
|
|
816
|
-
Large : "Large"
|
|
816
|
+
Large : "Large",
|
|
817
|
+
|
|
818
|
+
/**
|
|
819
|
+
* Type: Medium size, specifically if the BusyIndicator is displayed over a page section
|
|
820
|
+
* @public
|
|
821
|
+
*/
|
|
822
|
+
Section : "Section"
|
|
817
823
|
};
|
|
818
824
|
|
|
819
825
|
// Note: the imported module sap/ui/core/CalendarType already defines the global sap.ui.core.CalendarType,
|
|
@@ -821,13 +827,16 @@ sap.ui.define([
|
|
|
821
827
|
// thisLib.CalendarType = CalendarType;
|
|
822
828
|
|
|
823
829
|
/**
|
|
824
|
-
* @classdesc A string type that represents CSS color values.
|
|
830
|
+
* @classdesc A string type that represents CSS color values (CSS Color Level 3).
|
|
825
831
|
*
|
|
826
|
-
* Allowed values are
|
|
827
|
-
*
|
|
828
|
-
*
|
|
829
|
-
*
|
|
830
|
-
*
|
|
832
|
+
* <b>Allowed values are:</b>
|
|
833
|
+
* <ul>
|
|
834
|
+
* <li>Hex colors like <code>#666666</code> or <code>#fff</code>,</li>
|
|
835
|
+
* <li>HSL/RGB values with or without transparency, like <code>hsla(90,10%,30%,0.5)</code> or <code>rgb(0,0,0)</code>,</li>
|
|
836
|
+
* <li>CSS color names like <code>darkblue</code>, or special values like <code>inherit</code> and <code>transparent</code>,</li>
|
|
837
|
+
* <li>an empty string, which has the same effect as setting no color.</li>
|
|
838
|
+
* </ul>
|
|
839
|
+
* For more information about the CSS Level 3 color specification, see {@link https://www.w3.org/TR/css-color-3/#css-system}.
|
|
831
840
|
*
|
|
832
841
|
* @final
|
|
833
842
|
* @namespace
|
|
@@ -1482,7 +1491,7 @@ sap.ui.define([
|
|
|
1482
1491
|
/**
|
|
1483
1492
|
* Sort order of a column.
|
|
1484
1493
|
*
|
|
1485
|
-
* @version 1.
|
|
1494
|
+
* @version 1.108.0
|
|
1486
1495
|
* @enum {string}
|
|
1487
1496
|
* @public
|
|
1488
1497
|
* @since 1.61.0
|