From fc8c5ca42ed3975e7abbb721ea2cbddb08014c9c Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Thu, 28 May 2015 16:59:16 +0530 Subject: [PATCH] [fixes] timezone --- frappe/auth.py | 2 +- frappe/public/js/frappe/desk.js | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/frappe/auth.py b/frappe/auth.py index 4d6923d1bb..37caeb4781 100644 --- a/frappe/auth.py +++ b/frappe/auth.py @@ -192,7 +192,7 @@ class LoginManager: return from frappe.utils import now_datetime - current_hour = int(now_datetime(user=frappe.form_dict.get('usr')).strftime('%H')) + current_hour = int(now_datetime().strftime('%H')) if login_before and current_hour > login_before: frappe.throw(_("Login not allowed at this time"), frappe.AuthenticationError) diff --git a/frappe/public/js/frappe/desk.js b/frappe/public/js/frappe/desk.js index 88710bfe7a..8e5c45559b 100644 --- a/frappe/public/js/frappe/desk.js +++ b/frappe/public/js/frappe/desk.js @@ -72,7 +72,11 @@ frappe.Application = Class.extend({ moment.locale(frappe.boot.lang); if(frappe.boot.timezone_info) { moment.tz.add(frappe.boot.timezone_info); - moment.system_utc_offset = moment().tz(sys_defaults.time_zone).utcOffset(); + if(sys_defaults.time_zone) { + moment.system_utc_offset = moment().tz(sys_defaults.time_zone).utcOffset(); + } else { + moment.system_utc_offset = moment().utcOffset(); + } moment.user_utc_offset = moment().utcOffset(); } if(frappe.boot.print_css) {