mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-05 10:46:33 +02:00
Add filename-compatible date & time format (#25020)
* enable the functionality to have filename-compatible date & time * fix PowerToys.sln * fix DateTime format * remove unrelated code * modify date time format * fix tests * fix hours to 24h format and modify tests to cover the case better. Simplify tests slightly
This commit is contained in:
@@ -256,6 +256,13 @@ namespace Microsoft.PowerToys.Run.Plugin.TimeDate.Components
|
||||
AlternativeSearchTag = ResultHelper.SelectStringFromResources(isSystemDateTime, "Microsoft_plugin_timedate_SearchTagFormat"),
|
||||
IconType = ResultIconType.DateTime,
|
||||
},
|
||||
new AvailableResult()
|
||||
{
|
||||
Value = dateTimeNow.ToString("yyyy-MM-dd_HH-mm-ss", CultureInfo.InvariantCulture),
|
||||
Label = Resources.Microsoft_plugin_timedate_filename_compatible,
|
||||
AlternativeSearchTag = ResultHelper.SelectStringFromResources(isSystemDateTime, "Microsoft_plugin_timedate_SearchTagFormat"),
|
||||
IconType = ResultIconType.DateTime,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -177,6 +177,15 @@ namespace Microsoft.PowerToys.Run.Plugin.TimeDate.Properties {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Date and time in filename-compatible format.
|
||||
/// </summary>
|
||||
internal static string Microsoft_plugin_timedate_filename_compatible {
|
||||
get {
|
||||
return ResourceManager.GetString("Microsoft_plugin_timedate_filename_compatible", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Hour.
|
||||
/// </summary>
|
||||
|
||||
@@ -175,6 +175,10 @@
|
||||
<value>ISO 8601 UTC with time zone</value>
|
||||
<comment>'UTC' means here 'Universal Time Convention'</comment>
|
||||
</data>
|
||||
<data name="Microsoft_plugin_timedate_filename_compatible" xml:space="preserve">
|
||||
<value>Date and time in filename-compatible format</value>
|
||||
<comment>The format allows for embedding in filenames</comment>
|
||||
</data>
|
||||
<data name="Microsoft_plugin_timedate_Millisecond" xml:space="preserve">
|
||||
<value>Millisecond</value>
|
||||
</data>
|
||||
|
||||
Reference in New Issue
Block a user