Jelajahi Sumber

Fix User/Org default timezone bug (#8748)

* dashboard: don't override timezone if default selected, issue #8503

* dashboard: hide UTC icon immediately after timezone changing
Alexander Zobnin 8 tahun lalu
induk
melakukan
1499c2bf74

+ 2 - 2
public/app/features/dashboard/model.ts

@@ -247,9 +247,9 @@ export class DashboardModel {
   formatDate(date, format?) {
     date = moment.isMoment(date) ? date : moment(date);
     format = format || 'YYYY-MM-DD HH:mm:ss';
-    this.timezone = this.getTimezone();
+    let timezone = this.getTimezone();
 
-    return this.timezone === 'browser' ?
+    return timezone === 'browser' ?
       moment(date).format(format) :
       moment.utc(date).format(format);
   }

+ 1 - 0
public/app/features/dashboard/timepicker/timepicker.ts

@@ -56,6 +56,7 @@ export class TimePickerCtrl {
       if (moment.isMoment(timeRaw.to)) {
         timeRaw.to.local();
       }
+      this.isUtc = false;
     } else {
       this.isUtc = true;
     }