[1.8.x] Refs #24980 -- Fixed incorrect timezone handling in admin calendar widget.

Backport of ea7542891a from master
This commit is contained in:
Alexander Gaevsky 2016-01-08 22:51:52 +02:00 committed by Tim Graham
parent f8c3d38c2d
commit caeacd94dd
1 changed files with 2 additions and 2 deletions

View File

@ -292,8 +292,8 @@ var DateTimeShortcuts = {
if (inp.value) {
var format = get_format('DATE_INPUT_FORMATS')[0];
var selected = inp.value.strptime(format);
var year = selected.getFullYear();
var month = selected.getMonth() + 1;
var year = selected.getUTCFullYear();
var month = selected.getUTCMonth() + 1;
var re = /\d{4}/
if (re.test(year.toString()) && month >= 1 && month <= 12) {
DateTimeShortcuts.calendars[num].drawDate(month, year, selected);