@openui5/sap.ui.unified 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/THIRDPARTY.txt +1 -1
- package/package.json +2 -2
- package/src/sap/ui/unified/.library +1 -1
- package/src/sap/ui/unified/Calendar.js +34 -7
- package/src/sap/ui/unified/CalendarAppointment.js +1 -1
- package/src/sap/ui/unified/CalendarDateInterval.js +1 -1
- package/src/sap/ui/unified/CalendarLegend.js +1 -1
- package/src/sap/ui/unified/CalendarLegendItem.js +1 -1
- package/src/sap/ui/unified/CalendarMonthInterval.js +1 -1
- package/src/sap/ui/unified/CalendarOneMonthInterval.js +4 -4
- package/src/sap/ui/unified/CalendarRow.js +1 -1
- package/src/sap/ui/unified/CalendarTimeInterval.js +1 -1
- package/src/sap/ui/unified/CalendarWeekInterval.js +1 -1
- package/src/sap/ui/unified/ColorPicker.js +1 -1
- package/src/sap/ui/unified/ColorPickerPopover.js +1 -1
- package/src/sap/ui/unified/ContentSwitcher.js +1 -1
- package/src/sap/ui/unified/Currency.js +1 -1
- package/src/sap/ui/unified/CurrencyRenderer.js +1 -1
- package/src/sap/ui/unified/DateRange.js +1 -1
- package/src/sap/ui/unified/DateTypeRange.js +1 -1
- package/src/sap/ui/unified/FileUploader.js +4 -4
- package/src/sap/ui/unified/FileUploaderParameter.js +1 -1
- package/src/sap/ui/unified/FileUploaderXHRSettings.js +1 -1
- package/src/sap/ui/unified/Menu.js +1 -1
- package/src/sap/ui/unified/MenuItem.js +1 -1
- package/src/sap/ui/unified/MenuItemBase.js +1 -1
- package/src/sap/ui/unified/MenuRenderer.js +1 -1
- package/src/sap/ui/unified/MenuTextFieldItem.js +1 -1
- package/src/sap/ui/unified/Shell.js +1 -1
- package/src/sap/ui/unified/ShellHeadItem.js +1 -1
- package/src/sap/ui/unified/ShellHeadUserItem.js +1 -1
- package/src/sap/ui/unified/ShellLayout.js +1 -1
- package/src/sap/ui/unified/ShellOverlay.js +1 -1
- package/src/sap/ui/unified/SplitContainer.js +1 -1
- package/src/sap/ui/unified/calendar/CalendarUtils.js +4 -3
- package/src/sap/ui/unified/calendar/DatesRow.js +1 -1
- package/src/sap/ui/unified/calendar/DatesRowRenderer.js +6 -6
- package/src/sap/ui/unified/calendar/Header.js +1 -1
- package/src/sap/ui/unified/calendar/IndexPicker.js +1 -1
- package/src/sap/ui/unified/calendar/Month.js +42 -13
- package/src/sap/ui/unified/calendar/MonthPicker.js +1 -1
- package/src/sap/ui/unified/calendar/MonthRenderer.js +1 -1
- package/src/sap/ui/unified/calendar/MonthsRow.js +38 -30
- package/src/sap/ui/unified/calendar/MonthsRowRenderer.js +5 -4
- package/src/sap/ui/unified/calendar/OneMonthDatesRow.js +2 -2
- package/src/sap/ui/unified/calendar/TimesRow.js +18 -15
- package/src/sap/ui/unified/calendar/YearPicker.js +1 -1
- package/src/sap/ui/unified/calendar/YearRangePicker.js +1 -1
- package/src/sap/ui/unified/library.js +2 -2
package/THIRDPARTY.txt
CHANGED
|
@@ -382,7 +382,7 @@ Contained in: src/sap.ui.documentation/src/sap/ui/documentation/sdk/thirdparty/D
|
|
|
382
382
|
|
|
383
383
|
Library: sap.ui.integration:
|
|
384
384
|
|
|
385
|
-
Component: UI5 Web Components, version: 1.0
|
|
385
|
+
Component: UI5 Web Components, version: 1.7.0
|
|
386
386
|
Copyright: SAP
|
|
387
387
|
License: Apache-2.0
|
|
388
388
|
License Text: https://github.com/SAP/openui5/blob/master/LICENSES/Apache-2.0.txt
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openui5/sap.ui.unified",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.108.0",
|
|
4
4
|
"description": "OpenUI5 UI Library sap.ui.unified",
|
|
5
5
|
"author": "SAP SE (https://www.sap.com)",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -14,6 +14,6 @@
|
|
|
14
14
|
"url": "https://github.com/SAP/openui5.git"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@openui5/sap.ui.core": "1.
|
|
17
|
+
"@openui5/sap.ui.core": "1.108.0"
|
|
18
18
|
}
|
|
19
19
|
}
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
<copyright>OpenUI5
|
|
7
7
|
* (c) Copyright 2009-2022 SAP SE or an SAP affiliate company.
|
|
8
8
|
* Licensed under the Apache License, Version 2.0 - see LICENSE.txt.</copyright>
|
|
9
|
-
<version>1.
|
|
9
|
+
<version>1.108.0</version>
|
|
10
10
|
|
|
11
11
|
<documentation>Unified controls intended for both, mobile and desktop scenarios</documentation>
|
|
12
12
|
|
|
@@ -28,7 +28,8 @@ sap.ui.define([
|
|
|
28
28
|
"sap/ui/dom/containsOrEquals",
|
|
29
29
|
"sap/base/util/deepEqual",
|
|
30
30
|
"sap/base/Log",
|
|
31
|
-
"sap/ui/core/Configuration"
|
|
31
|
+
"sap/ui/core/Configuration",
|
|
32
|
+
"sap/ui/core/date/CalendarWeekNumbering"
|
|
32
33
|
], function(
|
|
33
34
|
CalendarType,
|
|
34
35
|
Control,
|
|
@@ -53,7 +54,8 @@ sap.ui.define([
|
|
|
53
54
|
containsOrEquals,
|
|
54
55
|
deepEqual,
|
|
55
56
|
Log,
|
|
56
|
-
Configuration
|
|
57
|
+
Configuration,
|
|
58
|
+
CalendarWeekNumbering
|
|
57
59
|
) {
|
|
58
60
|
"use strict";
|
|
59
61
|
|
|
@@ -72,7 +74,7 @@ sap.ui.define([
|
|
|
72
74
|
* Basic Calendar.
|
|
73
75
|
* This calendar is used for DatePickers
|
|
74
76
|
* @extends sap.ui.core.Control
|
|
75
|
-
* @version 1.
|
|
77
|
+
* @version 1.108.0
|
|
76
78
|
*
|
|
77
79
|
* @constructor
|
|
78
80
|
* @public
|
|
@@ -107,8 +109,9 @@ sap.ui.define([
|
|
|
107
109
|
months : {type : "int", group : "Appearance", defaultValue : 1},
|
|
108
110
|
|
|
109
111
|
/**
|
|
110
|
-
* If set, the
|
|
111
|
-
* If
|
|
112
|
+
* If the property is set, this day marks the start of the displayed week. Valid values are 0 to 6.
|
|
113
|
+
* If no valid property is set, the current locale's default is applied.
|
|
114
|
+
* Note: This property should not be used with the calendarWeekNumbering property.
|
|
112
115
|
* @since 1.28.9
|
|
113
116
|
*/
|
|
114
117
|
firstDayOfWeek : {type : "int", group : "Appearance", defaultValue : -1},
|
|
@@ -196,7 +199,15 @@ sap.ui.define([
|
|
|
196
199
|
*
|
|
197
200
|
* @since 1.84.0
|
|
198
201
|
*/
|
|
199
|
-
_currentPicker : {type : "string", group : "Appearance", visibility: "hidden"}
|
|
202
|
+
_currentPicker : {type : "string", group : "Appearance", visibility: "hidden"},
|
|
203
|
+
|
|
204
|
+
/**
|
|
205
|
+
* If set, the calendar week numbering is used for display.
|
|
206
|
+
* If not set, the calendar week numbering of the global configuration is used.
|
|
207
|
+
* Note: This property should not be used with firstDayOfWeek property.
|
|
208
|
+
* @since 1.108.0
|
|
209
|
+
*/
|
|
210
|
+
calendarWeekNumbering : { type : "sap.ui.core.date.CalendarWeekNumbering", group : "Appearance", defaultValue: null}
|
|
200
211
|
|
|
201
212
|
},
|
|
202
213
|
aggregations : {
|
|
@@ -474,7 +485,7 @@ sap.ui.define([
|
|
|
474
485
|
};
|
|
475
486
|
|
|
476
487
|
Calendar.prototype._createMonth = function(sId){
|
|
477
|
-
var oMonth = new Month(sId, {width: "100%"});
|
|
488
|
+
var oMonth = new Month(sId, {width: "100%", calendarWeekNumbering: this.getCalendarWeekNumbering()});
|
|
478
489
|
oMonth._bCalendar = true;
|
|
479
490
|
oMonth.attachEvent("datehovered", this._handleDateHovered, this);
|
|
480
491
|
oMonth.attachEvent("weekNumberSelect", this._handleWeekNumberSelect, this);
|
|
@@ -516,6 +527,10 @@ sap.ui.define([
|
|
|
516
527
|
oMonthDate = aMonths[0].getDate(),
|
|
517
528
|
oFocusedDate = this._getFocusedDate();
|
|
518
529
|
|
|
530
|
+
if (this.getFirstDayOfWeek() !== -1 && this.getCalendarWeekNumbering() !== "Default") {
|
|
531
|
+
Log.warning("Both properties firstDayOfWeek and calendarWeekNumbering should not be used at the same time!");
|
|
532
|
+
}
|
|
533
|
+
|
|
519
534
|
if (aMonths.length > 1 && oMonthDate) {
|
|
520
535
|
// for more than one month - re-render same months (if already rendered once)
|
|
521
536
|
oCalDate = CalendarDate.fromLocalJSDate(oMonthDate, this.getPrimaryCalendarType());
|
|
@@ -769,6 +784,17 @@ sap.ui.define([
|
|
|
769
784
|
|
|
770
785
|
};
|
|
771
786
|
|
|
787
|
+
Calendar.prototype.setCalendarWeekNumbering = function(sCalendarWeekNumbering) {
|
|
788
|
+
var aMonths = this.getAggregation("month");
|
|
789
|
+
|
|
790
|
+
this.setProperty("calendarWeekNumbering", sCalendarWeekNumbering);
|
|
791
|
+
|
|
792
|
+
for (var i = 0; i < aMonths.length; i++) {
|
|
793
|
+
aMonths[i].setProperty("calendarWeekNumbering", sCalendarWeekNumbering);
|
|
794
|
+
}
|
|
795
|
+
|
|
796
|
+
return this;
|
|
797
|
+
};
|
|
772
798
|
Calendar.prototype.setMonths = function(iMonths){
|
|
773
799
|
|
|
774
800
|
this._bDateRangeChanged = undefined; // to force rerendering
|
|
@@ -789,6 +815,7 @@ sap.ui.define([
|
|
|
789
815
|
oMonth.attachEvent("_unbindMousemove", _handleUnbindMousemove, this);
|
|
790
816
|
oMonth._bNoThemeChange = true;
|
|
791
817
|
oMonth._bNotInTabChain = true;
|
|
818
|
+
oMonth.setCalendarWeekNumbering(this.getCalendarWeekNumbering());
|
|
792
819
|
oMonth.setSecondaryCalendarType(this._getSecondaryCalendarType());
|
|
793
820
|
this.addAggregation("month",oMonth);
|
|
794
821
|
}
|
|
@@ -21,7 +21,7 @@ sap.ui.define(['./DateTypeRange', 'sap/ui/core/format/DateFormat', 'sap/ui/core/
|
|
|
21
21
|
*
|
|
22
22
|
* Applications could inherit from this element to add own fields.
|
|
23
23
|
* @extends sap.ui.unified.DateTypeRange
|
|
24
|
-
* @version 1.
|
|
24
|
+
* @version 1.108.0
|
|
25
25
|
*
|
|
26
26
|
* @constructor
|
|
27
27
|
* @public
|
|
@@ -56,7 +56,7 @@ sap.ui.define([
|
|
|
56
56
|
* @class
|
|
57
57
|
* <code>CalendarDateInterval</code> only visualizes the dates in a one-line interval and allows the selection of a single day.
|
|
58
58
|
* @extends sap.ui.unified.Calendar
|
|
59
|
-
* @version 1.
|
|
59
|
+
* @version 1.108.0
|
|
60
60
|
*
|
|
61
61
|
* @constructor
|
|
62
62
|
* @public
|
|
@@ -65,7 +65,7 @@ sap.ui.define([
|
|
|
65
65
|
* <b>Note:</b> JavaScript Date objects are used to set and return the months, mark them as selected or as a special type.
|
|
66
66
|
* But the date part of the Date object is not used. If a Date object is returned the date will be set to the 1st of the corresponding month.
|
|
67
67
|
* @extends sap.ui.core.Control
|
|
68
|
-
* @version 1.
|
|
68
|
+
* @version 1.108.0
|
|
69
69
|
*
|
|
70
70
|
* @constructor
|
|
71
71
|
* @public
|
|
@@ -57,7 +57,7 @@ sap.ui.define([
|
|
|
57
57
|
* Navigation via year picker switches to the corresponding year and the same month as before the navigation.
|
|
58
58
|
*
|
|
59
59
|
* @extends sap.ui.unified.CalendarDateInterval
|
|
60
|
-
* @version 1.
|
|
60
|
+
* @version 1.108.0
|
|
61
61
|
*
|
|
62
62
|
* @constructor
|
|
63
63
|
* @private
|
|
@@ -82,7 +82,7 @@ sap.ui.define([
|
|
|
82
82
|
oCalendar.attachEvent("select", function () {
|
|
83
83
|
var oCalPicker = this._getCalendar(),
|
|
84
84
|
oCalPickerFocusedDate = oCalPicker._getFocusedDate(),
|
|
85
|
-
oNewStartDate = CalendarUtils._getFirstDateOfMonth(oCalPickerFocusedDate);
|
|
85
|
+
oNewStartDate = CalendarUtils._getFirstDateOfMonth(new CalendarDate(oCalPickerFocusedDate, this.getPrimaryCalendarType()));
|
|
86
86
|
var oOneMonthDateRow = this.getAggregation("month")[0];
|
|
87
87
|
|
|
88
88
|
this._setStartDate(oNewStartDate);
|
|
@@ -133,7 +133,7 @@ sap.ui.define([
|
|
|
133
133
|
CalendarOneMonthInterval.prototype._handleFocus = function (oEvent) {
|
|
134
134
|
var bOutsideVisibleArea = !!oEvent.getParameter("_outsideBorder"),
|
|
135
135
|
oDateTime = oEvent.getParameter("date"),
|
|
136
|
-
oCalDate = CalendarDate.fromLocalJSDate(oDateTime),
|
|
136
|
+
oCalDate = CalendarDate.fromLocalJSDate(oDateTime, this.getPrimaryCalendarType()),
|
|
137
137
|
oCalStartDate = CalendarDate.fromLocalJSDate(this.getStartDate()),
|
|
138
138
|
bIsOtherMonth = !CalendarUtils._isSameMonthAndYear(oCalDate, oCalStartDate),
|
|
139
139
|
iDays,
|
|
@@ -302,7 +302,7 @@ sap.ui.define([
|
|
|
302
302
|
var iYearMin = this._oMinDate.getYear();
|
|
303
303
|
var iMonthMax = this._oMaxDate.getMonth();
|
|
304
304
|
var iMonthMin = this._oMinDate.getMonth();
|
|
305
|
-
var oFirstOfMonth = CalendarUtils._getFirstDateOfMonth(oDate);
|
|
305
|
+
var oFirstOfMonth = CalendarUtils._getFirstDateOfMonth(new CalendarDate(oDate, this.getPrimaryCalendarType()));
|
|
306
306
|
var oFirstOfNextMonth = new CalendarDate(oFirstOfMonth),
|
|
307
307
|
iYear, iMonth;
|
|
308
308
|
oFirstOfNextMonth.setMonth(oFirstOfNextMonth.getMonth() + 1);
|
|
@@ -39,7 +39,7 @@ sap.ui.define(['sap/ui/unified/calendar/CalendarUtils', 'sap/ui/unified/calendar
|
|
|
39
39
|
* its start date to the first date of the same week as the date the user chose.
|
|
40
40
|
*
|
|
41
41
|
* @extends sap.ui.unified.CalendarDateInterval
|
|
42
|
-
* @version 1.
|
|
42
|
+
* @version 1.108.0
|
|
43
43
|
*
|
|
44
44
|
* @constructor
|
|
45
45
|
* @private
|
|
@@ -25,7 +25,7 @@ sap.ui.define(['./DateRange', './library'],
|
|
|
25
25
|
* @class
|
|
26
26
|
* Date range with calendar day type information. Used to visualize special days in the Calendar.
|
|
27
27
|
* @extends sap.ui.unified.DateRange
|
|
28
|
-
* @version 1.
|
|
28
|
+
* @version 1.108.0
|
|
29
29
|
*
|
|
30
30
|
* @constructor
|
|
31
31
|
* @public
|
|
@@ -65,7 +65,7 @@ sap.ui.define([
|
|
|
65
65
|
* @implements sap.ui.core.IFormContent, sap.ui.unified.IProcessableBlobs
|
|
66
66
|
*
|
|
67
67
|
* @author SAP SE
|
|
68
|
-
* @version 1.
|
|
68
|
+
* @version 1.108.0
|
|
69
69
|
*
|
|
70
70
|
* @constructor
|
|
71
71
|
* @public
|
|
@@ -1046,7 +1046,7 @@ sap.ui.define([
|
|
|
1046
1046
|
FileUploader.prototype.setEnabled = function(bEnabled){
|
|
1047
1047
|
var $oFileUpload = jQuery(this.oFileUpload);
|
|
1048
1048
|
|
|
1049
|
-
this.setProperty("enabled", bEnabled);
|
|
1049
|
+
this.setProperty("enabled", bEnabled, false);
|
|
1050
1050
|
this.oFilePath.setEnabled(bEnabled);
|
|
1051
1051
|
this.oBrowse.setEnabled(bEnabled);
|
|
1052
1052
|
|
|
@@ -1061,7 +1061,7 @@ sap.ui.define([
|
|
|
1061
1061
|
|
|
1062
1062
|
FileUploader.prototype.setValueState = function(sValueState) {
|
|
1063
1063
|
|
|
1064
|
-
this.setProperty("valueState", sValueState,
|
|
1064
|
+
this.setProperty("valueState", sValueState, false);
|
|
1065
1065
|
//as of 1.23.1 oFilePath can be an sap.ui.commons.TextField or an sap.m.Input, which both have a valueState
|
|
1066
1066
|
if (this.oFilePath.setValueState) {
|
|
1067
1067
|
this.oFilePath.setValueState(sValueState);
|
|
@@ -1098,7 +1098,7 @@ sap.ui.define([
|
|
|
1098
1098
|
Log.warning("Setting the valueStateText property with the combination of libraries used is not supported.", this);
|
|
1099
1099
|
}
|
|
1100
1100
|
|
|
1101
|
-
return this.setProperty("valueStateText", sValueStateText,
|
|
1101
|
+
return this.setProperty("valueStateText", sValueStateText, false);
|
|
1102
1102
|
};
|
|
1103
1103
|
|
|
1104
1104
|
FileUploader.prototype.setStyle = function(sStyle) {
|
|
@@ -583,10 +583,11 @@ sap.ui.define([
|
|
|
583
583
|
CalendarUtils._getFirstDateOfMonth = function(oCalendarDate) {
|
|
584
584
|
this._checkCalendarDate(oCalendarDate);
|
|
585
585
|
|
|
586
|
-
var
|
|
587
|
-
oJSDate.setFullYear(oJSDate.getUTCFullYear(), oJSDate.getUTCMonth(), oJSDate.getUTCDate());
|
|
586
|
+
var oCalendarDateFirstDay = new CalendarDate(oCalendarDate, oCalendarDate.getCalendarType());
|
|
588
587
|
|
|
589
|
-
|
|
588
|
+
oCalendarDateFirstDay.setDate(1);
|
|
589
|
+
|
|
590
|
+
return oCalendarDateFirstDay;
|
|
590
591
|
};
|
|
591
592
|
|
|
592
593
|
/**
|
|
@@ -32,7 +32,7 @@ sap.ui.define([
|
|
|
32
32
|
* If used inside the calendar the properties and aggregation are directly taken from the parent
|
|
33
33
|
* (To not duplicate and sync DateRanges and so on...)
|
|
34
34
|
* @extends sap.ui.unified.calendar.Month
|
|
35
|
-
* @version 1.
|
|
35
|
+
* @version 1.108.0
|
|
36
36
|
*
|
|
37
37
|
* @constructor
|
|
38
38
|
* @public
|
|
@@ -187,7 +187,7 @@ sap.ui.define(['sap/ui/core/Renderer', 'sap/ui/unified/calendar/CalendarDate', '
|
|
|
187
187
|
oDay.setDate(oDay.getDate() + 1);
|
|
188
188
|
}
|
|
189
189
|
|
|
190
|
-
var aMonthNames = oLocaleData.getMonthsStandAlone("wide");
|
|
190
|
+
var aMonthNames = oLocaleData.getMonthsStandAlone("wide", oDatesRow.getPrimaryCalendarType());
|
|
191
191
|
for (i = 0; i < aMonthDays.length; i++) {
|
|
192
192
|
var oMonthDays = aMonthDays[i];
|
|
193
193
|
sWidth = ( 100 / iDays * oMonthDays.iDays) + "%";
|
|
@@ -210,6 +210,7 @@ sap.ui.define(['sap/ui/core/Renderer', 'sap/ui/unified/calendar/CalendarDate', '
|
|
|
210
210
|
var iDays = oDatesRow.getDays();
|
|
211
211
|
var sWidth = ( 100 / iDays ) + "%";
|
|
212
212
|
var bShowDayNamesLine = oDatesRow.getShowDayNamesLine();
|
|
213
|
+
var sCalendarType = oDatesRow.getPrimaryCalendarType();
|
|
213
214
|
|
|
214
215
|
if (!oDate) {
|
|
215
216
|
oDate = oDatesRow._getFocusedDate();
|
|
@@ -219,14 +220,13 @@ sap.ui.define(['sap/ui/core/Renderer', 'sap/ui/unified/calendar/CalendarDate', '
|
|
|
219
220
|
|
|
220
221
|
if (!bShowDayNamesLine) {
|
|
221
222
|
if (oDatesRow._bLongWeekDays || !oDatesRow._bNamesLengthChecked) {
|
|
222
|
-
oHelper.aWeekDays = oHelper.oLocaleData.getDaysStandAlone("abbreviated");
|
|
223
|
+
oHelper.aWeekDays = oHelper.oLocaleData.getDaysStandAlone("abbreviated", sCalendarType);
|
|
223
224
|
} else {
|
|
224
|
-
oHelper.aWeekDays = oHelper.oLocaleData.getDaysStandAlone("narrow");
|
|
225
|
+
oHelper.aWeekDays = oHelper.oLocaleData.getDaysStandAlone("narrow", sCalendarType);
|
|
225
226
|
}
|
|
226
|
-
oHelper.aWeekDaysWide = oHelper.oLocaleData.getDaysStandAlone("wide");
|
|
227
|
+
oHelper.aWeekDaysWide = oHelper.oLocaleData.getDaysStandAlone("wide", sCalendarType);
|
|
227
228
|
}
|
|
228
|
-
|
|
229
|
-
var oDay = new CalendarDate(oDate, oDatesRow.getPrimaryCalendarType());
|
|
229
|
+
var oDay = new CalendarDate(oDate, sCalendarType);
|
|
230
230
|
|
|
231
231
|
for (var i = 0; i < iDays; i++) {
|
|
232
232
|
this.renderDay(oRm, oDatesRow, oDay, oHelper, false, false, i, sWidth, !bShowDayNamesLine);
|
|
@@ -32,7 +32,7 @@ sap.ui.define([
|
|
|
32
32
|
* This control serves for picking an item from a grid with items which are relative periods in Plannig Calendar.
|
|
33
33
|
* This is used inside the sap.m.PlanningCalendar relative views. Not for stand alone usage.
|
|
34
34
|
* @extends sap.ui.core.Control
|
|
35
|
-
* @version 1.
|
|
35
|
+
* @version 1.108.0
|
|
36
36
|
*
|
|
37
37
|
* @constructor
|
|
38
38
|
* @private
|
|
@@ -23,7 +23,10 @@ sap.ui.define([
|
|
|
23
23
|
"sap/ui/events/KeyCodes",
|
|
24
24
|
"sap/ui/thirdparty/jquery",
|
|
25
25
|
'sap/ui/core/InvisibleMessage',
|
|
26
|
-
"sap/ui/core/Configuration"
|
|
26
|
+
"sap/ui/core/Configuration",
|
|
27
|
+
"sap/ui/core/date/CalendarWeekNumbering",
|
|
28
|
+
"sap/ui/core/date/CalendarUtils",
|
|
29
|
+
"sap/base/Log"
|
|
27
30
|
], function(
|
|
28
31
|
Control,
|
|
29
32
|
Device,
|
|
@@ -42,7 +45,10 @@ sap.ui.define([
|
|
|
42
45
|
KeyCodes,
|
|
43
46
|
jQuery,
|
|
44
47
|
InvisibleMessage,
|
|
45
|
-
Configuration
|
|
48
|
+
Configuration,
|
|
49
|
+
CalendarWeekNumbering,
|
|
50
|
+
CalendarDateUtils,
|
|
51
|
+
Log
|
|
46
52
|
) {
|
|
47
53
|
"use strict";
|
|
48
54
|
|
|
@@ -71,7 +77,7 @@ sap.ui.define([
|
|
|
71
77
|
* If used inside the calendar the properties and aggregation are directly taken from the parent
|
|
72
78
|
* (To not duplicate and sync DateRanges and so on...)
|
|
73
79
|
* @extends sap.ui.core.Control
|
|
74
|
-
* @version 1.
|
|
80
|
+
* @version 1.108.0
|
|
75
81
|
*
|
|
76
82
|
* @constructor
|
|
77
83
|
* @public
|
|
@@ -104,8 +110,9 @@ sap.ui.define([
|
|
|
104
110
|
showHeader : {type : "boolean", group : "Appearance", defaultValue : false},
|
|
105
111
|
|
|
106
112
|
/**
|
|
107
|
-
* If set, the
|
|
108
|
-
* If
|
|
113
|
+
* If the property is set, this day marks the start of the displayed week. Valid values are 0 to 6.
|
|
114
|
+
* If no valid property is set, the current locale's default is applied.
|
|
115
|
+
* Note: This property should not be used with the calendarWeekNumbering property.
|
|
109
116
|
* @since 1.28.9
|
|
110
117
|
*/
|
|
111
118
|
firstDayOfWeek : {type : "int", group : "Appearance", defaultValue : -1},
|
|
@@ -154,7 +161,15 @@ sap.ui.define([
|
|
|
154
161
|
*
|
|
155
162
|
* @since 1.90
|
|
156
163
|
*/
|
|
157
|
-
_focusedDate : {type : "object", group : "Data", visibility: "hidden", defaultValue: null}
|
|
164
|
+
_focusedDate : {type : "object", group : "Data", visibility: "hidden", defaultValue: null},
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* If set, the calendar week numbering is used for display.
|
|
168
|
+
* If not set, the calendar week numbering of the global configuration is used.
|
|
169
|
+
* Note: This property should not be used with firstDayOfWeek property.
|
|
170
|
+
* @since 1.108.0
|
|
171
|
+
*/
|
|
172
|
+
calendarWeekNumbering : { type : "sap.ui.core.date.CalendarWeekNumbering", group : "Appearance", defaultValue: null}
|
|
158
173
|
|
|
159
174
|
},
|
|
160
175
|
aggregations : {
|
|
@@ -304,6 +319,12 @@ sap.ui.define([
|
|
|
304
319
|
return this.getDomRef() && this._oItemNavigation.getItemDomRefs()[this._oItemNavigation.getFocusedIndex()];
|
|
305
320
|
};
|
|
306
321
|
|
|
322
|
+
Month.prototype.onBeforeRendering = function() {
|
|
323
|
+
if (this.getFirstDayOfWeek() !== -1 && this.getCalendarWeekNumbering() !== "Default") {
|
|
324
|
+
Log.warning("Both properties firstDayOfWeek and calendarWeekNumbering should not be used at the same time!");
|
|
325
|
+
}
|
|
326
|
+
};
|
|
327
|
+
|
|
307
328
|
Month.prototype.onAfterRendering = function(){
|
|
308
329
|
this.bSpaceButtonPressed = false;
|
|
309
330
|
_initItemNavigation.call(this);
|
|
@@ -754,8 +775,14 @@ sap.ui.define([
|
|
|
754
775
|
}
|
|
755
776
|
|
|
756
777
|
if (iFirstDayOfWeek < 0 || iFirstDayOfWeek > 6) {
|
|
757
|
-
var
|
|
758
|
-
|
|
778
|
+
var oWeekConfigurationValues = CalendarDateUtils.getWeekConfigurationValues(this.getCalendarWeekNumbering(), new Locale(this._getLocale()));
|
|
779
|
+
|
|
780
|
+
if (oWeekConfigurationValues) {
|
|
781
|
+
iFirstDayOfWeek = oWeekConfigurationValues.firstDayOfWeek;
|
|
782
|
+
} else {
|
|
783
|
+
var oLocaleData = this._getLocaleData();
|
|
784
|
+
iFirstDayOfWeek = oLocaleData.getFirstDayOfWeek();
|
|
785
|
+
}
|
|
759
786
|
}
|
|
760
787
|
|
|
761
788
|
return iFirstDayOfWeek;
|
|
@@ -1577,17 +1604,19 @@ sap.ui.define([
|
|
|
1577
1604
|
* @private
|
|
1578
1605
|
*/
|
|
1579
1606
|
Month.prototype._calculateWeekNumber = function (oDate) {
|
|
1580
|
-
var oEndDate = this._getLastWeekDate(oDate);
|
|
1581
1607
|
var oLocale = new Locale(this._getLocale());
|
|
1608
|
+
var oEndDate = this._getLastWeekDate(oDate);
|
|
1582
1609
|
var oLocaleData = this._getLocaleData();
|
|
1583
|
-
var oDateFormat
|
|
1610
|
+
var oDateFormat;
|
|
1584
1611
|
var iWeekNumber;
|
|
1585
1612
|
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
// US calendar weeks overlap Jan 1st is always week 1 while Dec 31st is always last week number
|
|
1613
|
+
oDateFormat = DateFormat.getInstance({pattern: "w", calendarType: this.getPrimaryCalendarType(), calendarWeekNumbering: this.getCalendarWeekNumbering()}, oLocale);
|
|
1614
|
+
|
|
1589
1615
|
var bIsRegionUS = oLocaleData.firstDayStartsFirstWeek();
|
|
1590
1616
|
|
|
1617
|
+
// Because the date we use to calculate the week number may be in one year and in the same time
|
|
1618
|
+
// includes days in a new month into a new year, we explicitly changed the week number
|
|
1619
|
+
// US calendar weeks overlap, Jan 1st is always week 1, while Dec 31st is always last week.
|
|
1591
1620
|
if (oEndDate.getMonth() === 0 && this._oDate.getMonth() === 0 && bIsRegionUS) {
|
|
1592
1621
|
iWeekNumber = oDateFormat.format(oEndDate.toUTCJSDate(), true);
|
|
1593
1622
|
} else {
|
|
@@ -473,7 +473,7 @@ sap.ui.define(['sap/ui/unified/calendar/CalendarUtils', 'sap/ui/unified/calendar
|
|
|
473
473
|
//oMonth.getDate() is a public date object, so it is always considered local timezones.
|
|
474
474
|
if (((oMonth.getParent() && oMonth.getParent().getMetadata().getName() === "sap.ui.unified.CalendarOneMonthInterval")
|
|
475
475
|
|| (oMonth.getMetadata().getName() === "sap.ui.unified.calendar.OneMonthDatesRow"))
|
|
476
|
-
&& oMonth.getStartDate() &&
|
|
476
|
+
&& oMonth.getStartDate() && oHelper.iMonth !== oDay.getMonth()) {
|
|
477
477
|
oRm.class("sapUiCalItemOtherMonth");
|
|
478
478
|
}
|
|
479
479
|
|
|
@@ -38,9 +38,6 @@ sap.ui.define([
|
|
|
38
38
|
) {
|
|
39
39
|
"use strict";
|
|
40
40
|
|
|
41
|
-
// shortcut for sap.ui.core.CalendarType
|
|
42
|
-
var CalendarType = coreLibrary.CalendarType;
|
|
43
|
-
|
|
44
41
|
/*
|
|
45
42
|
* <code>CalendarDate</code> objects are used inside the <code>MonthsRow</code>, whereas JavaScript dates are used in the API.
|
|
46
43
|
* This means that a conversion must be performed for the API functions.
|
|
@@ -63,7 +60,7 @@ sap.ui.define([
|
|
|
63
60
|
* The MontsRow works with JavaScript Date objects, but only the month and the year are used to display and interact.
|
|
64
61
|
* As representation for a month, the 1st of the month will always be returned in the API.
|
|
65
62
|
* @extends sap.ui.core.Control
|
|
66
|
-
* @version 1.
|
|
63
|
+
* @version 1.108.0
|
|
67
64
|
*
|
|
68
65
|
* @constructor
|
|
69
66
|
* @public
|
|
@@ -107,7 +104,15 @@ sap.ui.define([
|
|
|
107
104
|
/**
|
|
108
105
|
* If set, a header with the years is shown to visualize what month belongs to what year.
|
|
109
106
|
*/
|
|
110
|
-
showHeader : {type : "boolean", group : "Appearance", defaultValue : false}
|
|
107
|
+
showHeader : {type : "boolean", group : "Appearance", defaultValue : false},
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* If set, the calendar type is used for display.
|
|
111
|
+
* If not set, the calendar type of the global configuration is used.
|
|
112
|
+
* @private
|
|
113
|
+
* @since 1.108.0
|
|
114
|
+
*/
|
|
115
|
+
primaryCalendarType : {type : "sap.ui.core.CalendarType", group : "Appearance", defaultValue : null}
|
|
111
116
|
},
|
|
112
117
|
aggregations : {
|
|
113
118
|
|
|
@@ -169,10 +174,11 @@ sap.ui.define([
|
|
|
169
174
|
}, renderer: MonthsRowRenderer});
|
|
170
175
|
|
|
171
176
|
MonthsRow.prototype.init = function(){
|
|
177
|
+
var sCalendarType = this.getProperty("primaryCalendarType");
|
|
172
178
|
|
|
173
179
|
//need day in pattern because in islamic calendar 2 Month can start in one gregorianic calendar
|
|
174
|
-
this._oFormatYyyymm = DateFormat.getInstance({pattern: "yyyyMMdd", calendarType:
|
|
175
|
-
this._oFormatLong = DateFormat.getInstance({pattern: "MMMM y"});
|
|
180
|
+
this._oFormatYyyymm = DateFormat.getInstance({pattern: "yyyyMMdd", calendarType: sCalendarType});
|
|
181
|
+
this._oFormatLong = DateFormat.getInstance({pattern: "MMMM y", calendarType: sCalendarType});
|
|
176
182
|
|
|
177
183
|
this._mouseMoveProxy = jQuery.proxy(this._handleMouseMove, this);
|
|
178
184
|
|
|
@@ -264,7 +270,7 @@ sap.ui.define([
|
|
|
264
270
|
*/
|
|
265
271
|
MonthsRow.prototype.setDate = function(oDate){
|
|
266
272
|
if (oDate) {
|
|
267
|
-
var oCalDate = CalendarDate.fromLocalJSDate(oDate);
|
|
273
|
+
var oCalDate = CalendarDate.fromLocalJSDate(oDate, this.getProperty("primaryCalendarType"));
|
|
268
274
|
this._oDate = oCalDate;
|
|
269
275
|
_changeDate.call(this, oCalDate, false);
|
|
270
276
|
}
|
|
@@ -279,11 +285,11 @@ sap.ui.define([
|
|
|
279
285
|
*/
|
|
280
286
|
MonthsRow.prototype._getDate = function(){
|
|
281
287
|
|
|
282
|
-
if (!this._oDate
|
|
283
|
-
this._oDate = new
|
|
288
|
+
if (!this._oDate) {
|
|
289
|
+
this._oDate = CalendarDate.fromLocalJSDate(new Date(), this.getProperty("primaryCalendarType"));
|
|
284
290
|
}
|
|
285
291
|
|
|
286
|
-
return this._oDate
|
|
292
|
+
return this._oDate;
|
|
287
293
|
|
|
288
294
|
};
|
|
289
295
|
|
|
@@ -300,7 +306,7 @@ sap.ui.define([
|
|
|
300
306
|
iYear = oStartDate.getFullYear();
|
|
301
307
|
CalendarUtils._checkYearInValidRange(iYear);
|
|
302
308
|
|
|
303
|
-
oCalDate = CalendarDate.fromLocalJSDate(oStartDate);
|
|
309
|
+
oCalDate = CalendarDate.fromLocalJSDate(oStartDate, this.getProperty("primaryCalendarType"));
|
|
304
310
|
this.setProperty("startDate", oStartDate, true);
|
|
305
311
|
this._oStartDate = oCalDate;
|
|
306
312
|
this._oStartDate.setDate(1); // always use begin of month as start date
|
|
@@ -323,7 +329,7 @@ sap.ui.define([
|
|
|
323
329
|
MonthsRow.prototype._getStartDate = function(){
|
|
324
330
|
|
|
325
331
|
if (!this._oStartDate) {
|
|
326
|
-
this._oStartDate = new
|
|
332
|
+
this._oStartDate = CalendarDate.fromLocalJSDate(new Date(), this.getProperty("primaryCalendarType"));
|
|
327
333
|
this._oStartDate.setDate(1); // always use begin of month as start date
|
|
328
334
|
}
|
|
329
335
|
|
|
@@ -339,7 +345,7 @@ sap.ui.define([
|
|
|
339
345
|
*/
|
|
340
346
|
MonthsRow.prototype.displayDate = function(oDate){
|
|
341
347
|
|
|
342
|
-
_changeDate.call(this, CalendarDate.fromLocalJSDate(oDate), true);
|
|
348
|
+
_changeDate.call(this, CalendarDate.fromLocalJSDate(oDate, this.getProperty("primaryCalendarType")), true);
|
|
343
349
|
|
|
344
350
|
return this;
|
|
345
351
|
|
|
@@ -393,7 +399,7 @@ sap.ui.define([
|
|
|
393
399
|
|
|
394
400
|
if (this._oFormatLong.oLocale.toString() != sLocale) {
|
|
395
401
|
var oLocale = new Locale(sLocale);
|
|
396
|
-
this._oFormatLong = DateFormat.getInstance({style: "long"} , oLocale);
|
|
402
|
+
this._oFormatLong = DateFormat.getInstance({style: "long", calendarType: this.getProperty("primaryCalendarType")} , oLocale);
|
|
397
403
|
}
|
|
398
404
|
|
|
399
405
|
return this._oFormatLong;
|
|
@@ -550,6 +556,7 @@ sap.ui.define([
|
|
|
550
556
|
oTimeStamp,
|
|
551
557
|
oStartTimeStamp = 0, oEndTimeStamp = 0,
|
|
552
558
|
iSelected = 0,
|
|
559
|
+
sCalendarType = this.getProperty("primaryCalendarType"),
|
|
553
560
|
i,
|
|
554
561
|
aSelectedDates,
|
|
555
562
|
oMyDate;
|
|
@@ -567,14 +574,14 @@ sap.ui.define([
|
|
|
567
574
|
oStartDate = oRange.getStartDate();
|
|
568
575
|
oStartTimeStamp = 0;
|
|
569
576
|
if (oStartDate) {
|
|
570
|
-
oStartDate = CalendarDate.fromLocalJSDate(oStartDate);
|
|
577
|
+
oStartDate = CalendarDate.fromLocalJSDate(oStartDate, sCalendarType);
|
|
571
578
|
oStartDate.setDate(1); // begin of month
|
|
572
579
|
oStartTimeStamp = oStartDate.toUTCJSDate().getTime();
|
|
573
580
|
}
|
|
574
581
|
oEndDate = oRange.getEndDate();
|
|
575
582
|
oEndTimeStamp = 0;
|
|
576
583
|
if (oEndDate) {
|
|
577
|
-
oEndDate = CalendarDate.fromLocalJSDate(oEndDate);
|
|
584
|
+
oEndDate = CalendarDate.fromLocalJSDate(oEndDate, sCalendarType);
|
|
578
585
|
oEndDate.setDate(1); // begin of month
|
|
579
586
|
oEndTimeStamp = oEndDate.toUTCJSDate().getTime();
|
|
580
587
|
}
|
|
@@ -621,7 +628,8 @@ sap.ui.define([
|
|
|
621
628
|
oEndDate, oEndTimeStamp = 0,
|
|
622
629
|
oTimeStamp,
|
|
623
630
|
aSpecialDates = this.getSpecialDates(),
|
|
624
|
-
oMyDate = new CalendarDate(oDate)
|
|
631
|
+
oMyDate = new CalendarDate(oDate),
|
|
632
|
+
sCalendarType = this.getProperty("primaryCalendarType");
|
|
625
633
|
|
|
626
634
|
oMyDate.setDate(1); //always use begin of month for test
|
|
627
635
|
oTimeStamp = oMyDate.toUTCJSDate().getTime();
|
|
@@ -632,14 +640,14 @@ sap.ui.define([
|
|
|
632
640
|
oStartDate = oRange.getStartDate();
|
|
633
641
|
oStartTimeStamp = 0;
|
|
634
642
|
if (oStartDate) {
|
|
635
|
-
oStartDate = CalendarDate.fromLocalJSDate(oStartDate);
|
|
643
|
+
oStartDate = CalendarDate.fromLocalJSDate(oStartDate, sCalendarType);
|
|
636
644
|
oStartDate.setDate(1); // begin of month
|
|
637
645
|
oStartTimeStamp = oStartDate.toUTCJSDate().getTime();
|
|
638
646
|
}
|
|
639
647
|
oEndDate = oRange.getEndDate();
|
|
640
648
|
oEndTimeStamp = 0;
|
|
641
649
|
if (oEndDate) {
|
|
642
|
-
oEndDate = CalendarDate.fromLocalJSDate(oEndDate);
|
|
650
|
+
oEndDate = CalendarDate.fromLocalJSDate(oEndDate, sCalendarType);
|
|
643
651
|
oEndDate.setDate(CalendarUtils._daysInMonth(oEndDate));// end of the Month
|
|
644
652
|
oEndTimeStamp = oEndDate.toUTCJSDate().getTime();
|
|
645
653
|
}
|
|
@@ -692,7 +700,7 @@ sap.ui.define([
|
|
|
692
700
|
|
|
693
701
|
if ($Target.hasClass("sapUiCalItem")) {
|
|
694
702
|
var oOldFocusedDate = this._getDate();
|
|
695
|
-
var oFocusedDate = CalendarDate.fromLocalJSDate(this._oFormatYyyymm.parse($Target.attr("data-sap-month")));
|
|
703
|
+
var oFocusedDate = CalendarDate.fromLocalJSDate(this._oFormatYyyymm.parse($Target.attr("data-sap-month"), this.getProperty("primaryCalendarType")));
|
|
696
704
|
oFocusedDate.setDate(1);
|
|
697
705
|
|
|
698
706
|
if (!oFocusedDate.isSame(oOldFocusedDate)) {
|
|
@@ -730,7 +738,7 @@ sap.ui.define([
|
|
|
730
738
|
}
|
|
731
739
|
|
|
732
740
|
if ($Target.hasClass("sapUiCalItem")) {
|
|
733
|
-
oFocusedDate = CalendarDate.fromLocalJSDate(this._oFormatYyyymm.parse($Target.attr("data-sap-month")));
|
|
741
|
+
oFocusedDate = CalendarDate.fromLocalJSDate(this._oFormatYyyymm.parse($Target.attr("data-sap-month"), this.getProperty("primaryCalendarType")));
|
|
734
742
|
oFocusedDate.setDate(1);
|
|
735
743
|
}
|
|
736
744
|
|
|
@@ -828,7 +836,7 @@ sap.ui.define([
|
|
|
828
836
|
this._bNamesLengthChecked = undefined;
|
|
829
837
|
this._bLongWeekDays = undefined;
|
|
830
838
|
var oLocaleData = this._getLocaleData();
|
|
831
|
-
var aMonthNamesWide = oLocaleData.getMonthsStandAlone("wide");
|
|
839
|
+
var aMonthNamesWide = oLocaleData.getMonthsStandAlone("wide", this.getProperty("primaryCalendarType"));
|
|
832
840
|
var aMonths = this.$("months").children();
|
|
833
841
|
var iMonth = this._getStartDate().getMonth();
|
|
834
842
|
for (var i = 0; i < aMonths.length; i++) {
|
|
@@ -863,7 +871,7 @@ sap.ui.define([
|
|
|
863
871
|
var oEndDate = new CalendarDate(oStartDate);
|
|
864
872
|
oEndDate.setDate(1);
|
|
865
873
|
oEndDate.setMonth(oEndDate.getMonth() + this.getMonths());
|
|
866
|
-
var oCalDate = CalendarDate.fromLocalJSDate(oDateTime);
|
|
874
|
+
var oCalDate = CalendarDate.fromLocalJSDate(oDateTime, this.getProperty("primaryCalendarType"));
|
|
867
875
|
|
|
868
876
|
return oCalDate.isSameOrAfter(oStartDate) && oCalDate.isBefore(oEndDate);
|
|
869
877
|
};
|
|
@@ -936,7 +944,7 @@ sap.ui.define([
|
|
|
936
944
|
// find out what day was focused
|
|
937
945
|
var $DomRef = jQuery(aDomRefs[iIndex]);
|
|
938
946
|
|
|
939
|
-
oFocusedDate = CalendarDate.fromLocalJSDate(this._oFormatYyyymm.parse($DomRef.attr("data-sap-month")));
|
|
947
|
+
oFocusedDate = CalendarDate.fromLocalJSDate(this._oFormatYyyymm.parse($DomRef.attr("data-sap-month"), this.getProperty("primaryCalendarType")));
|
|
940
948
|
oFocusedDate.setDate(1);
|
|
941
949
|
this.setDate(oFocusedDate.toLocalJSDate());
|
|
942
950
|
|
|
@@ -1052,7 +1060,7 @@ sap.ui.define([
|
|
|
1052
1060
|
CalendarUtils._checkYearInValidRange(iYear);
|
|
1053
1061
|
|
|
1054
1062
|
var bFocusable = true; // if date not changed it is still focusable
|
|
1055
|
-
if (!this.getDate() || !oDate.isSame(CalendarDate.fromLocalJSDate(this.getDate()))) {
|
|
1063
|
+
if (!this.getDate() || !oDate.isSame(CalendarDate.fromLocalJSDate(this.getDate(), this.getProperty("primaryCalendarType")))) {
|
|
1056
1064
|
var oCalDate = new CalendarDate(oDate);
|
|
1057
1065
|
oCalDate.setDate(1); // always use begin of month
|
|
1058
1066
|
bFocusable = this.checkDateFocusable(oDate.toLocalJSDate());
|
|
@@ -1132,7 +1140,7 @@ sap.ui.define([
|
|
|
1132
1140
|
oDateRange = aSelectedDates[0];
|
|
1133
1141
|
oStartDate = oDateRange.getStartDate();
|
|
1134
1142
|
if (oStartDate) {
|
|
1135
|
-
oStartDate = CalendarDate.fromLocalJSDate(oStartDate);
|
|
1143
|
+
oStartDate = CalendarDate.fromLocalJSDate(oStartDate, this.getProperty("primaryCalendarType"));
|
|
1136
1144
|
oStartDate.setDate(1); // begin of month
|
|
1137
1145
|
}
|
|
1138
1146
|
} else {
|
|
@@ -1174,7 +1182,7 @@ sap.ui.define([
|
|
|
1174
1182
|
for ( i = 0; i < aSelectedDates.length; i++) {
|
|
1175
1183
|
oStartDate = aSelectedDates[i].getStartDate();
|
|
1176
1184
|
if (oStartDate) {
|
|
1177
|
-
oStartDate = CalendarDate.fromLocalJSDate(oStartDate);
|
|
1185
|
+
oStartDate = CalendarDate.fromLocalJSDate(oStartDate, this.getProperty("primaryCalendarType"));
|
|
1178
1186
|
oStartDate.setDate(1); // begin of month
|
|
1179
1187
|
if (oDate.isSame(oStartDate)) {
|
|
1180
1188
|
oAggOwner.removeAggregation("selectedDates", i);
|
|
@@ -1216,7 +1224,7 @@ sap.ui.define([
|
|
|
1216
1224
|
var iBlocks = Math.ceil(12 / iMonths);
|
|
1217
1225
|
var iMonth = 0;
|
|
1218
1226
|
var oLocaleData = this._getLocaleData();
|
|
1219
|
-
var aMonthNamesWide = oLocaleData.getMonthsStandAlone("wide");
|
|
1227
|
+
var aMonthNamesWide = oLocaleData.getMonthsStandAlone("wide", this.getProperty("primaryCalendarType"));
|
|
1220
1228
|
var $Month;
|
|
1221
1229
|
|
|
1222
1230
|
for (var b = 0; b < iBlocks; b++) {
|
|
@@ -1256,7 +1264,7 @@ sap.ui.define([
|
|
|
1256
1264
|
if (bTooLong) {
|
|
1257
1265
|
this._bLongMonth = false;
|
|
1258
1266
|
// change month name on button but not change month picker, because it is hided again
|
|
1259
|
-
var aMonthNames = oLocaleData.getMonthsStandAlone("abbreviated");
|
|
1267
|
+
var aMonthNames = oLocaleData.getMonthsStandAlone("abbreviated", this.getProperty("primaryCalendarType"));
|
|
1260
1268
|
iMonth = this._getStartDate().getMonth();
|
|
1261
1269
|
for (i = 0; i < aMonths.length; i++) {
|
|
1262
1270
|
$Month = jQuery(jQuery(aMonths[i]).children(".sapUiCalItemText"));
|
|
@@ -188,18 +188,19 @@ sap.ui.define(['sap/ui/unified/calendar/CalendarUtils', 'sap/ui/unified/calendar
|
|
|
188
188
|
CalendarUtils._checkCalendarDate(oDate);
|
|
189
189
|
|
|
190
190
|
var oHelper = {};
|
|
191
|
+
var sPrimaryCalendarType = oMonthsRow.getProperty("primaryCalendarType");
|
|
191
192
|
|
|
192
193
|
oHelper.sLocale = oMonthsRow._getLocale();
|
|
193
194
|
oHelper.oLocaleData = oMonthsRow._getLocaleData();
|
|
194
|
-
oHelper.oToday = new
|
|
195
|
+
oHelper.oToday = CalendarDate.fromLocalJSDate(new Date(), sPrimaryCalendarType);
|
|
195
196
|
oHelper.sCurrentMonth = oMonthsRow._rb.getText("CALENDAR_CURRENT_MONTH");
|
|
196
197
|
oHelper.sId = oMonthsRow.getId();
|
|
197
198
|
oHelper.oFormatLong = oMonthsRow._getFormatLong();
|
|
198
199
|
if (oMonthsRow._bLongMonth || !oMonthsRow._bNamesLengthChecked) {
|
|
199
|
-
oHelper.aMonthNames = oHelper.oLocaleData.getMonthsStandAlone("wide");
|
|
200
|
+
oHelper.aMonthNames = oHelper.oLocaleData.getMonthsStandAlone("wide", sPrimaryCalendarType);
|
|
200
201
|
} else {
|
|
201
|
-
oHelper.aMonthNames = oHelper.oLocaleData.getMonthsStandAlone("abbreviated");
|
|
202
|
-
oHelper.aMonthNamesWide = oHelper.oLocaleData.getMonthsStandAlone("wide");
|
|
202
|
+
oHelper.aMonthNames = oHelper.oLocaleData.getMonthsStandAlone("abbreviated", sPrimaryCalendarType);
|
|
203
|
+
oHelper.aMonthNamesWide = oHelper.oLocaleData.getMonthsStandAlone("wide", sPrimaryCalendarType);
|
|
203
204
|
}
|
|
204
205
|
|
|
205
206
|
|
|
@@ -34,7 +34,7 @@ sap.ui.define([
|
|
|
34
34
|
* Other usages are not supported.
|
|
35
35
|
*
|
|
36
36
|
* @extends sap.ui.unified.calendar.DatesRow
|
|
37
|
-
* @version 1.
|
|
37
|
+
* @version 1.108.0
|
|
38
38
|
*
|
|
39
39
|
* @constructor
|
|
40
40
|
* @private
|
|
@@ -115,7 +115,7 @@ sap.ui.define([
|
|
|
115
115
|
if (this.iMode === 2) {
|
|
116
116
|
return 31;
|
|
117
117
|
} else {
|
|
118
|
-
return CalendarUtils._daysInMonth(CalendarDate.fromLocalJSDate(this.getStartDate()));
|
|
118
|
+
return CalendarUtils._daysInMonth(CalendarDate.fromLocalJSDate(this.getStartDate(), this.getPrimaryCalendarType()));
|
|
119
119
|
}
|
|
120
120
|
};
|
|
121
121
|
|
|
@@ -13,7 +13,6 @@ sap.ui.define([
|
|
|
13
13
|
'sap/ui/core/date/UniversalDate',
|
|
14
14
|
'sap/ui/unified/library',
|
|
15
15
|
'sap/ui/core/format/DateFormat',
|
|
16
|
-
'sap/ui/core/library',
|
|
17
16
|
'sap/ui/core/Locale',
|
|
18
17
|
"./TimesRowRenderer",
|
|
19
18
|
"sap/ui/dom/containsOrEquals",
|
|
@@ -29,7 +28,6 @@ sap.ui.define([
|
|
|
29
28
|
UniversalDate,
|
|
30
29
|
library,
|
|
31
30
|
DateFormat,
|
|
32
|
-
coreLibrary,
|
|
33
31
|
Locale,
|
|
34
32
|
TimesRowRenderer,
|
|
35
33
|
containsOrEquals,
|
|
@@ -40,9 +38,6 @@ sap.ui.define([
|
|
|
40
38
|
) {
|
|
41
39
|
"use strict";
|
|
42
40
|
|
|
43
|
-
// shortcut for sap.ui.core.CalendarType
|
|
44
|
-
var CalendarType = coreLibrary.CalendarType;
|
|
45
|
-
|
|
46
41
|
/*
|
|
47
42
|
* <code>UniversalDate</code> objects are used inside the <code>TimesRow</code>, whereas JavaScript dates are used in the API.
|
|
48
43
|
* This means that a conversion must be performed for the API functions.
|
|
@@ -64,7 +59,7 @@ sap.ui.define([
|
|
|
64
59
|
*
|
|
65
60
|
* The TimesRow works with JavaScript Date objects.
|
|
66
61
|
* @extends sap.ui.core.Control
|
|
67
|
-
* @version 1.
|
|
62
|
+
* @version 1.108.0
|
|
68
63
|
*
|
|
69
64
|
* @constructor
|
|
70
65
|
* @public
|
|
@@ -119,7 +114,15 @@ sap.ui.define([
|
|
|
119
114
|
/**
|
|
120
115
|
* If set, a header with the years is shown to visualize what month belongs to what year.
|
|
121
116
|
*/
|
|
122
|
-
showHeader : {type : "boolean", group : "Appearance", defaultValue : false}
|
|
117
|
+
showHeader : {type : "boolean", group : "Appearance", defaultValue : false},
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* If set, the calendar type is used for display.
|
|
121
|
+
* If not set, the calendar type of the global configuration is used.
|
|
122
|
+
* @private
|
|
123
|
+
* @since 1.108.0
|
|
124
|
+
*/
|
|
125
|
+
primaryCalendarType : {type : "sap.ui.core.CalendarType", group : "Appearance", defaultValue : null}
|
|
123
126
|
},
|
|
124
127
|
aggregations : {
|
|
125
128
|
|
|
@@ -177,9 +180,9 @@ sap.ui.define([
|
|
|
177
180
|
|
|
178
181
|
TimesRow.prototype.init = function(){
|
|
179
182
|
|
|
180
|
-
this._oFormatYyyyMMddHHmm = DateFormat.getInstance({pattern: "yyyyMMddHHmm", calendarType:
|
|
181
|
-
this._oFormatLong = DateFormat.getDateTimeInstance({style: "long/short"});
|
|
182
|
-
this._oFormatDate = DateFormat.getDateInstance({style: "medium"});
|
|
183
|
+
this._oFormatYyyyMMddHHmm = DateFormat.getInstance({pattern: "yyyyMMddHHmm", calendarType: this.getProperty("primaryCalendarType")});
|
|
184
|
+
this._oFormatLong = DateFormat.getDateTimeInstance({style: "long/short", calendarType: this.getProperty("primaryCalendarType")});
|
|
185
|
+
this._oFormatDate = DateFormat.getDateInstance({style: "medium", calendarType: this.getProperty("primaryCalendarType")});
|
|
183
186
|
|
|
184
187
|
this._mouseMoveProxy = jQuery.proxy(this._handleMouseMove, this);
|
|
185
188
|
|
|
@@ -390,7 +393,7 @@ sap.ui.define([
|
|
|
390
393
|
|
|
391
394
|
if (this._oFormatLong.oLocale.toString() != sLocale) {
|
|
392
395
|
var oLocale = new Locale(sLocale);
|
|
393
|
-
this._oFormatLong = DateFormat.getInstance({style: "long/short"}, oLocale);
|
|
396
|
+
this._oFormatLong = DateFormat.getInstance({style: "long/short", calendarType: this.getProperty("primaryCalendarType")}, oLocale);
|
|
394
397
|
}
|
|
395
398
|
|
|
396
399
|
return this._oFormatLong;
|
|
@@ -419,7 +422,7 @@ sap.ui.define([
|
|
|
419
422
|
|
|
420
423
|
if (sTimeFormatShort.search("a") >= 0) {
|
|
421
424
|
// AP/PM indicator used
|
|
422
|
-
this._oFormatTimeAmPm = DateFormat.getTimeInstance({pattern: "a"}, oLocale);
|
|
425
|
+
this._oFormatTimeAmPm = DateFormat.getTimeInstance({pattern: "a", calendarType: this.getProperty("primaryCalendarType")}, oLocale);
|
|
423
426
|
}
|
|
424
427
|
} else {
|
|
425
428
|
sPattern = sTimeFormatShort;
|
|
@@ -428,11 +431,11 @@ sap.ui.define([
|
|
|
428
431
|
sPattern = sPattern.replace("hh", "h");
|
|
429
432
|
if (sPattern.search("a") >= 0) {
|
|
430
433
|
// AP/PM indicator used
|
|
431
|
-
this._oFormatTimeAmPm = DateFormat.getTimeInstance({pattern: "a"}, oLocale);
|
|
434
|
+
this._oFormatTimeAmPm = DateFormat.getTimeInstance({pattern: "a", calendarType: this.getProperty("primaryCalendarType")}, oLocale);
|
|
432
435
|
sPattern = sPattern.replace("a", "").trim();
|
|
433
436
|
}
|
|
434
437
|
}
|
|
435
|
-
this._oFormatTime = DateFormat.getTimeInstance({pattern: sPattern}, oLocale);
|
|
438
|
+
this._oFormatTime = DateFormat.getTimeInstance({pattern: sPattern, calendarType: this.getProperty("primaryCalendarType")}, oLocale);
|
|
436
439
|
}
|
|
437
440
|
|
|
438
441
|
return this._oFormatTime;
|
|
@@ -448,7 +451,7 @@ sap.ui.define([
|
|
|
448
451
|
|
|
449
452
|
if (this._oFormatDate.oLocale.toString() != sLocale) {
|
|
450
453
|
var oLocale = new Locale(sLocale);
|
|
451
|
-
this._oFormatDate = DateFormat.getDateInstance({style: "medium"}, oLocale);
|
|
454
|
+
this._oFormatDate = DateFormat.getDateInstance({style: "medium", calendarType: this.getProperty("primaryCalendarType")}, oLocale);
|
|
452
455
|
}
|
|
453
456
|
|
|
454
457
|
return this._oFormatDate;
|
|
@@ -60,7 +60,7 @@ sap.ui.define([
|
|
|
60
60
|
* As in all date-time controls, all pubic JS Date objects that are given (e.g. <code>setDate()</code>) or read
|
|
61
61
|
* (e.g. <code>getFirstRenderedDate</code>) with values which are considered as date objects in browser(local) timezone.
|
|
62
62
|
* @extends sap.ui.core.Control
|
|
63
|
-
* @version 1.
|
|
63
|
+
* @version 1.108.0
|
|
64
64
|
*
|
|
65
65
|
* @constructor
|
|
66
66
|
* @public
|
|
@@ -28,13 +28,13 @@ sap.ui.define([
|
|
|
28
28
|
* @namespace
|
|
29
29
|
* @alias sap.ui.unified
|
|
30
30
|
* @author SAP SE
|
|
31
|
-
* @version 1.
|
|
31
|
+
* @version 1.108.0
|
|
32
32
|
* @since 1.28
|
|
33
33
|
* @public
|
|
34
34
|
*/
|
|
35
35
|
var thisLib = sap.ui.getCore().initLibrary({
|
|
36
36
|
name : "sap.ui.unified",
|
|
37
|
-
version: "1.
|
|
37
|
+
version: "1.108.0",
|
|
38
38
|
dependencies : ["sap.ui.core"],
|
|
39
39
|
designtime: "sap/ui/unified/designtime/library.designtime",
|
|
40
40
|
types: [
|