From 293105899e8bce132e8e300503b0c19f7dadf2d6 Mon Sep 17 00:00:00 2001 From: Mohammad Anbarestany Date: Thu, 31 Dec 2020 00:15:46 +0330 Subject: [PATCH] User timezone Auto-suggestion --- functions.php | 4 +++- page_cp_settings.php | 7 ++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/functions.php b/functions.php index f2f4d7a..b3ab041 100644 --- a/functions.php +++ b/functions.php @@ -1589,8 +1589,10 @@ function pinc_enqueue_scripts() $user_info = get_userdata($user_ID); if(!empty($user_info->pinc_user_timezone)){ $timeZoneSet = $user_info->pinc_user_timezone; - }else{ + }else if (!empty(get_option('timezone_string'))){ $timeZoneSet = get_option('timezone_string'); + }else { + $timeZoneSet = "Etc/Greenwich"; } $getUserDate = new DateTime(null, new DateTimeZone($timeZoneSet)); $currentTime = $getUserDate->format('H:i:s'); diff --git a/page_cp_settings.php b/page_cp_settings.php index 84764b9..2986708 100644 --- a/page_cp_settings.php +++ b/page_cp_settings.php @@ -356,8 +356,13 @@ function pinc_edit_user( $user_id = 0 ) {
+ pinc_user_timezone); + ?>