diff --git a/projects/IoTCenter/Controllers/AppController.cs b/projects/IoTCenter/Controllers/AppController.cs index f6495c5f..8c3a0689 100644 --- a/projects/IoTCenter/Controllers/AppController.cs +++ b/projects/IoTCenter/Controllers/AppController.cs @@ -13,6 +13,7 @@ using Microsoft.Extensions.Hosting; using System; using System.Collections.Generic; using System.Drawing; +using System.Globalization; using System.IO; using System.Linq; using Vibrant.InfluxDB.Client; @@ -292,7 +293,8 @@ namespace IoTCenter.Controllers } if (rows != null) { - labels = rows.Select(o => o.Timestamp.Value).Select(o => o.AddHours(hours).ToString("MM-dd HH:mm:ss")).ToList(); + var format = time.StartsWith("1") ? "H:mm" : (time.StartsWith("7") ? "ddd" : "MMM-d"); + labels = rows.Select(o => o.Timestamp.Value).Select(o => o.AddHours(hours).ToString(format, new CultureInfo("zh-CN"))).ToList(); } } var model = new diff --git a/projects/IoTCenter/Views/Home/Device.cshtml b/projects/IoTCenter/Views/Home/Device.cshtml index e1c18e2a..1d2ddc48 100644 --- a/projects/IoTCenter/Views/Home/Device.cshtml +++ b/projects/IoTCenter/Views/Home/Device.cshtml @@ -137,6 +137,24 @@ }