mirror of
https://github.com/MaaAssistantArknights/MaaAssistantArknights.git
synced 2026-07-15 17:30:27 +08:00
perf: 优化日期显示格式
This commit is contained in:
@@ -3638,7 +3638,9 @@ namespace MaaWpfGui.ViewModels.UI
|
||||
|
||||
private static readonly DateTime _buildDateTime = Assembly.GetExecutingAssembly().GetCustomAttribute<BuildDateTimeAttribute>()?.BuildDateTime ?? DateTime.MinValue;
|
||||
|
||||
public DateTime BuildDateTime { get; } = _buildDateTime;
|
||||
public static DateTime BuildDateTime => _buildDateTime.ToLocalTime();
|
||||
|
||||
public static string BuildDateTimeLong => BuildDateTime.ToString("yyyy-MM-dd HH:mm");
|
||||
|
||||
private static (DateTime DateTime, string VersionName) _resourceInfo = GetResourceVersionByClientType(ConfigurationHelper.GetValue(ConfigurationKeys.ClientType, string.Empty));
|
||||
|
||||
@@ -3661,6 +3663,8 @@ namespace MaaWpfGui.ViewModels.UI
|
||||
set => SetAndNotify(ref _resourceDateTime, value);
|
||||
}
|
||||
|
||||
public string ResourceDateTimeLong => ResourceDateTime.ToString("yyyy-MM-dd HH:mm");
|
||||
|
||||
private static (DateTime DateTime, string VersionName) GetResourceVersionByClientType(string clientType)
|
||||
{
|
||||
const string OfficialClientType = "Official";
|
||||
@@ -4629,7 +4633,7 @@ namespace MaaWpfGui.ViewModels.UI
|
||||
? LocalizationHelper.DefaultLanguage switch
|
||||
{
|
||||
"en-us" => $" - {ResourceDateTime:dd/MM} {ResourceVersion}",
|
||||
_ => $" - {ResourceVersion}{ResourceDateTime:#ddMM}",
|
||||
_ => $" - {ResourceVersion}{ResourceDateTime:#MMdd}",
|
||||
}
|
||||
: string.Empty;
|
||||
rvm.WindowTitle = $"{prefix}MAA{currentConfiguration} - {CoreVersion}{resourceVersion}{connectConfigName}{connectAddress}{clientName}";
|
||||
|
||||
@@ -126,9 +126,9 @@
|
||||
Margin="0,5"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
hc:FloatingBlock.Content="{Binding ResourceDateTime}"
|
||||
hc:FloatingBlock.Content="{Binding ResourceDateTimeLong}"
|
||||
PreviewMouseDown="ResourceVersionClick"
|
||||
Status="{Binding ResourceDateTime, Mode=OneWay}"
|
||||
Status="{Binding ResourceDateTimeLong, Mode=OneWay}"
|
||||
Subject="资源日期"
|
||||
Color="#6969AA" />
|
||||
<Grid HorizontalAlignment="Center">
|
||||
@@ -211,9 +211,9 @@
|
||||
Margin="0,5"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
hc:FloatingBlock.Content="{Binding BuildDateTime}"
|
||||
hc:FloatingBlock.Content="{Binding BuildDateTimeLong}"
|
||||
PreviewMouseDown="CoreVersionClick"
|
||||
Status="{Binding BuildDateTime, Mode=OneWay}"
|
||||
Status="{Binding BuildDateTimeLong, Mode=OneWay}"
|
||||
Subject="构建日期"
|
||||
Color="#6969AA" />
|
||||
</StackPanel>
|
||||
|
||||
Reference in New Issue
Block a user