[fixes] timezone
This commit is contained in:
parent
0b93f99613
commit
fc8c5ca42e
2 changed files with 6 additions and 2 deletions
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue