Skip to content

Commit ad780cb

Browse files
committed
MAGETWO-53299: "Go Today" button is not working for dates range component
- method _getTimezoneDate renamed to _getTimezoneDateDatepicker to be available for call from instance
1 parent de2192d commit ad780cb

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/web/mage/calendar.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
* in order to have ability to know actual store time even if page hadn't been reloaded
3636
* @returns {Date}
3737
*/
38-
_getTimezoneDate: function () {
38+
_getTimezoneDateDatepicker: function () {
3939
// local time in ms
4040
var ms = Date.now(),
4141
options = $.calendarConfig ? $.calendarConfig : {};
@@ -58,7 +58,7 @@
5858
* @param {String|Object} target - the target input field or division or span
5959
*/
6060
_setTimezoneDateDatepicker: function (target) {
61-
this._setDateDatepicker(target, this._getTimezoneDate());
61+
this._setDateDatepicker(target, this._getTimezoneDateDatepicker());
6262
}
6363
});
6464

@@ -120,7 +120,7 @@
120120
* @return {String} html template
121121
*/
122122
$.datepicker.constructor.prototype._generateHTML = function (inst) {
123-
var today = this._getTimezoneDate(),
123+
var today = this._getTimezoneDateDatepicker(),
124124
isRTL = this._get(inst, 'isRTL'),
125125
showButtonPanel = this._get(inst, 'showButtonPanel'),
126126
hideIfNoPrevNext = this._get(inst, 'hideIfNoPrevNext'),
@@ -396,7 +396,7 @@
396396
* @return {Object} date
397397
*/
398398
getTimezoneDate: function () {
399-
return this._getTimezoneDate();
399+
return this.element[this._picker()]('getTimezoneDate');
400400
}
401401
});
402402

0 commit comments

Comments
 (0)