From ea7542891a4e3638a695c58bd6f00658b7c85985 Mon Sep 17 00:00:00 2001 From: Alexander Gaevsky Date: Fri, 8 Jan 2016 22:51:52 +0200 Subject: [PATCH] Refs #24980 -- Fixed incorrect timezone handling in admin calendar widget. --- .../contrib/admin/static/admin/js/admin/DateTimeShortcuts.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/django/contrib/admin/static/admin/js/admin/DateTimeShortcuts.js b/django/contrib/admin/static/admin/js/admin/DateTimeShortcuts.js index 43bbfcaf09..ce86593654 100644 --- a/django/contrib/admin/static/admin/js/admin/DateTimeShortcuts.js +++ b/django/contrib/admin/static/admin/js/admin/DateTimeShortcuts.js @@ -368,8 +368,8 @@ 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);