跳到主要内容

github/tai

公开

Tai · Windows 软件与网站使用时长统计。上游 Planshit/Tai 的源码镜像,非灵栈原创;MIT 许可。来源:https://github.com/Planshit/Tai 。本次为手动同步,暂不提供安装包。

提交记录
修改Core/Librarys/Time.cs+7 −1看文件
@@ -16,9 +16,15 @@ namespace Core.Librarys
1616 }
1717 else
1818 {
19删除: double minutes = seconds / 60;
19新增: double minutes = (double)seconds / 60;
2020 if (minutes < 60)
2121 {
22新增: if (minutes != (int)minutes)
23新增: {
24新增: double pointNumber = minutes - (int)minutes;
25新增: return (int)minutes + "分" + (int)(pointNumber * 60) + "秒";
26新增: }
27新增:
2228 return minutes + "分钟";
2329 }
2430 else
删除UI/Librays/Timer.cs+0 −37
@@ -1,37 +0,0 @@
1删除:using System;
2删除:using System.Collections.Generic;
3删除:using System.Linq;
4删除:using System.Text;
5删除:using System.Threading.Tasks;
6删除:
7删除:namespace UI.Librays
8删除:{
9删除: public class Timer
10删除: {
11删除: public static string Fromat(int seconds)
12删除: {
13删除: if (seconds < 60)
14删除: {
15删除: return seconds + "秒";
16删除: }
17删除: else
18删除: {
19删除: double minutes = seconds / 60;
20删除: if (minutes < 60)
21删除: {
22删除: return minutes + "分钟";
23删除: }
24删除: else
25删除: {
26删除: double hours = (double)minutes / 60;
27删除: if (hours != (int)hours)
28删除: {
29删除: double pointNumber = hours - (int)hours;
30删除: return (int)hours + "小时" + (int)(pointNumber * 60) + "分";
31删除: }
32删除: return hours + "小时";
33删除: }
34删除: }
35删除: }
36删除: }
37删除:}
修改UI/UI.csproj+0 −1看文件
@@ -164,7 +164,6 @@
164164 <Compile Include="Controls\Window\ToastType.cs" />
165165 <Compile Include="Extensions\ListExtensions.cs" />
166166 <Compile Include="Librays\Image\Imager.cs" />
167删除: <Compile Include="Librays\Timer.cs" />
168167 <Compile Include="Models\CategoryAppListPageModel.cs" />
169168 <Compile Include="Models\CategoryAppList\ChooseAppModel.cs" />
170169 <Compile Include="Models\CategoryPageModel.cs" />
修改UI/ViewModels/ChartPageVM.cs+1 −2看文件
@@ -9,7 +9,6 @@ using System.Threading.Tasks;
99using UI.Controls;
1010using UI.Controls.Charts.Model;
1111using UI.Controls.Select;
12删除:using UI.Librays;
1312using UI.Models;
1413using UI.Views;
1514
@@ -385,7 +384,7 @@ namespace UI.ViewModels
385384 bindModel.Data = item;
386385 bindModel.Name = string.IsNullOrEmpty(item.AppModel?.Description) ? item.AppModel.Name : item.AppModel.Description;
387386 bindModel.Value = item.Time;
388删除: bindModel.Tag = Timer.Fromat(item.Time);
387新增: bindModel.Tag =Time.ToString(item.Time);
389388 bindModel.PopupText = item.AppModel?.File;
390389 bindModel.Icon = item.AppModel?.IconFile;
391390 resData.Add(bindModel);
修改UI/ViewModels/DataPageVM.cs+1 −2看文件
@@ -12,7 +12,6 @@ using System.Threading.Tasks;
1212using System.Windows.Media.Imaging;
1313using UI.Controls;
1414using UI.Controls.Charts.Model;
15删除:using UI.Librays;
1615using UI.Models;
1716using UI.Views;
1817
@@ -183,7 +182,7 @@ namespace UI.ViewModels
183182 bindModel.Data = item;
184183 bindModel.Name = string.IsNullOrEmpty(item.AppModel?.Description) ? item.AppModel.Name : item.AppModel.Description;
185184 bindModel.Value = item.Time;
186删除: bindModel.Tag = Timer.Fromat(item.Time);
185新增: bindModel.Tag = Time.ToString(item.Time);
187186 bindModel.PopupText = item.AppModel?.File;
188187 bindModel.Icon = item.AppModel?.IconFile;
189188 resData.Add(bindModel);
修改UI/ViewModels/DetailPageVM.cs+6 −7看文件
@@ -12,7 +12,6 @@ using System.Windows;
1212using UI.Controls;
1313using UI.Controls.Charts.Model;
1414using UI.Controls.Select;
15删除:using UI.Librays;
1615using UI.Models;
1716
1817namespace UI.ViewModels
@@ -269,7 +268,7 @@ namespace UI.ViewModels
269268
270269 //if (today != null)
271270 //{
272删除: // TodayTime = Timer.Fromat(today.Time);
271新增: // TodayTime = Time.ToString(today.Time);
273272 //}
274273 //else
275274 //{
@@ -291,12 +290,12 @@ namespace UI.ViewModels
291290 // else if (diffseconds > 0)
292291 // {
293292 // // 增加
294删除: // diffText = "增加了" + Timer.Fromat(diffseconds);
293新增: // diffText = "增加了" + Time.ToString(diffseconds);
295294 // }
296295 // else
297296 // {
298297 // // 减少
299删除: // diffText = "减少了" + Timer.Fromat(Math.Abs(diffseconds));
298新增: // diffText = "减少了" + Time.ToString(Math.Abs(diffseconds));
300299 // }
301300 // }
302301 // Yesterday = diffseconds == yesterday.Time ? "减少100%" : diffText;
@@ -319,7 +318,7 @@ namespace UI.ViewModels
319318
320319 var monthData = data.GetProcessMonthLogList(App.ID, Date);
321320 int monthTotal = monthData.Sum(m => m.Time);
322删除: Total = Timer.Fromat(monthTotal);
321新增: Total = Time.ToString(monthTotal);
323322
324323 DateTime start = new DateTime(Date.Year, Date.Month, 1);
325324 DateTime end = new DateTime(Date.Year, Date.Month, DateTime.DaysInMonth(Date.Year, Date.Month));
@@ -329,7 +328,7 @@ namespace UI.ViewModels
329328 if (monthData.Count > 0)
330329 {
331330 var longDayData = monthData.OrderByDescending(m => m.Time).FirstOrDefault();
332删除: LongDay = longDayData.Date.ToString("最长一天是在 dd 号,使用了 " + Timer.Fromat(longDayData.Time));
331新增: LongDay = longDayData.Date.ToString("最长一天是在 dd 号,使用了 " + Time.ToString(longDayData.Time));
333332
334333 }
335334
@@ -383,7 +382,7 @@ namespace UI.ViewModels
383382 bindModel.Data = item;
384383 bindModel.Name = string.IsNullOrEmpty(item.AppModel?.Description) ? item.AppModel.Name : item.AppModel.Description;
385384 bindModel.Value = item.Time;
386删除: bindModel.Tag = Timer.Fromat(item.Time);
385新增: bindModel.Tag = Time.ToString(item.Time);
387386 bindModel.PopupText = item.AppModel.File;
388387 bindModel.Icon = item.AppModel.IconFile;
389388 bindModel.DateTime = item.Date;
修改UI/ViewModels/IndexPageVM.cs+1 −2看文件
@@ -13,7 +13,6 @@ using System.Windows;
1313using System.Windows.Media.Imaging;
1414using UI.Controls;
1515using UI.Controls.Charts.Model;
16删除:using UI.Librays;
1716using UI.Models;
1817using UI.Views;
1918
@@ -158,7 +157,7 @@ namespace UI.ViewModels
158157 bindModel.Data = item;
159158 bindModel.Name = string.IsNullOrEmpty(item.AppModel?.Description) ? item.AppModel.Name : item.AppModel.Description;
160159 bindModel.Value = item.Time;
161删除: bindModel.Tag = Timer.Fromat(item.Time);
160新增: bindModel.Tag = Time.ToString(item.Time);
162161 bindModel.PopupText = item.AppModel?.File;
163162 bindModel.Icon = item.AppModel?.IconFile;
164163 bindModel.DateTime = item.Date;