[CmdPal] Added fallback for time and date (#38918)

* Added fallback for time and date

Signed-off-by: Shawn Yuan <shuai.yuan.zju@gmail.com>

* only support week/now/time/year query

Signed-off-by: Shawn Yuan <shuai.yuan.zju@gmail.com>

* Add week option

Signed-off-by: Shawn Yuan <shuai.yuan.zju@gmail.com>

* Changed setting for time date fallback.

Signed-off-by: Shawn Yuan <shuai.yuan.zju@gmail.com>

* update globalization string

Signed-off-by: Shawn Yuan <shuai.yuan.zju@gmail.com>

* use week of year.

Signed-off-by: Shawn Yuan <shuai.yuan.zju@gmail.com>

* update

Signed-off-by: Shawn Yuan <shuai.yuan.zju@gmail.com>

---------

Signed-off-by: Shawn Yuan <shuai.yuan.zju@gmail.com>
This commit is contained in:
Shawn Yuan
2025-04-24 14:58:01 +08:00
committed by GitHub
parent 25c29ade8e
commit 100d560f9e
7 changed files with 172 additions and 81 deletions

View File

@@ -213,6 +213,15 @@ namespace Microsoft.CmdPal.Ext.TimeDate {
}
}
/// <summary>
/// Looks up a localized string similar to Open Time Data Command.
/// </summary>
public static string Microsoft_plugin_timedate_fallback_display_title {
get {
return ResourceManager.GetString("Microsoft_plugin_timedate_fallback_display_title", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Date and time in filename-compatible format.
/// </summary>
@@ -609,6 +618,15 @@ namespace Microsoft.CmdPal.Ext.TimeDate {
}
}
/// <summary>
/// Looks up a localized string similar to Current Week; Calendar week; Week of the year; Week.
/// </summary>
public static string Microsoft_plugin_timedate_SearchTagWeek {
get {
return ResourceManager.GetString("Microsoft_plugin_timedate_SearchTagWeek", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Second.
/// </summary>
@@ -663,6 +681,24 @@ namespace Microsoft.CmdPal.Ext.TimeDate {
}
}
/// <summary>
/// Looks up a localized string similar to Enable fallback items for TimeDate (week, year, now, time, date).
/// </summary>
public static string Microsoft_plugin_timedate_SettingEnableFallbackItems {
get {
return ResourceManager.GetString("Microsoft_plugin_timedate_SettingEnableFallbackItems", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Show time and date results when typing keywords like &quot;week&quot;, &quot;year&quot;, &quot;now&quot;, &quot;time&quot;, or &quot;date&quot;.
/// </summary>
public static string Microsoft_plugin_timedate_SettingEnableFallbackItems_Description {
get {
return ResourceManager.GetString("Microsoft_plugin_timedate_SettingEnableFallbackItems_Description", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to First day of the week.
/// </summary>
@@ -780,33 +816,6 @@ namespace Microsoft.CmdPal.Ext.TimeDate {
}
}
/// <summary>
/// Looks up a localized string similar to Hide &apos;Invalid number input&apos; error message on global queries.
/// </summary>
public static string Microsoft_plugin_timedate_SettingHideNumberMessageOnGlobalQuery {
get {
return ResourceManager.GetString("Microsoft_plugin_timedate_SettingHideNumberMessageOnGlobalQuery", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Show only &apos;Time&apos;, &apos;Date&apos; and &apos;Now&apos; result for system time on global queries.
/// </summary>
public static string Microsoft_plugin_timedate_SettingOnlyDateTimeNowGlobal {
get {
return ResourceManager.GetString("Microsoft_plugin_timedate_SettingOnlyDateTimeNowGlobal", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Regardless of this setting, for global queries the first word of the query has to be a complete match..
/// </summary>
public static string Microsoft_plugin_timedate_SettingOnlyDateTimeNowGlobal_Description {
get {
return ResourceManager.GetString("Microsoft_plugin_timedate_SettingOnlyDateTimeNowGlobal_Description", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Show time with seconds.
/// </summary>

View File

@@ -265,15 +265,6 @@
<data name="Microsoft_plugin_timedate_SettingDateWithWeekday_Description" xml:space="preserve">
<value>This setting applies to the 'Date' and 'Now' result.</value>
</data>
<data name="Microsoft_plugin_timedate_SettingHideNumberMessageOnGlobalQuery" xml:space="preserve">
<value>Hide 'Invalid number input' error message on global queries</value>
</data>
<data name="Microsoft_plugin_timedate_SettingOnlyDateTimeNowGlobal" xml:space="preserve">
<value>Show only 'Time', 'Date' and 'Now' result for system time on global queries</value>
</data>
<data name="Microsoft_plugin_timedate_SettingOnlyDateTimeNowGlobal_Description" xml:space="preserve">
<value>Regardless of this setting, for global queries the first word of the query has to be a complete match.</value>
</data>
<data name="Microsoft_plugin_timedate_SettingTimeWithSeconds" xml:space="preserve">
<value>Show time with seconds</value>
</data>
@@ -433,4 +424,16 @@
<data name="Microsoft_plugin_timedate_DaysInMonth" xml:space="preserve">
<value>Days in month</value>
</data>
<data name="Microsoft_plugin_timedate_fallback_display_title" xml:space="preserve">
<value>Open Time Data Command</value>
</data>
<data name="Microsoft_plugin_timedate_SearchTagWeek" xml:space="preserve">
<value>Current Week; Calendar week; Week of the year; Week</value>
</data>
<data name="Microsoft_plugin_timedate_SettingEnableFallbackItems" xml:space="preserve">
<value>Enable fallback items for TimeDate (week, year, now, time, date)</value>
</data>
<data name="Microsoft_plugin_timedate_SettingEnableFallbackItems_Description" xml:space="preserve">
<value>Show time and date results when typing keywords like "week", "year", "now", "time", or "date"</value>
</data>
</root>