Rename the [Ee]xts dir to ext (#38852)

**WARNING:** This PR will probably blow up all in-flight PRs

at some point in the early days of CmdPal, two of us created seperate
`Exts` and `exts` dirs. Depending on what the casing was on the branch
that you checked one of those out from, it'd get stuck like that on your
PC forever.

Windows didn't care, so we never noticed.

But GitHub does care, and now browsing the source on GitHub is basically
impossible.

Closes #38081
This commit is contained in:
Mike Griese
2025-04-15 06:07:22 -05:00
committed by GitHub
parent 60f50d853b
commit 2b5181b4c9
379 changed files with 35 additions and 35 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

View File

@@ -0,0 +1,22 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<g filter="url(#filter0_i_1873_17784)">
<path d="M8 16C12.4183 16 16 12.4183 16 8C16 3.58172 12.4183 0 8 0C3.58172 0 0 3.58172 0 8C0 12.4183 3.58172 16 8 16Z" fill="url(#paint0_linear_1873_17784)"/>
</g>
<path d="M8 3V9H13" stroke="#666666" stroke-width="1.15385" stroke-linecap="round" stroke-linejoin="round"/>
<defs>
<filter id="filter0_i_1873_17784" x="-0.865385" y="-0.865385" width="16.8654" height="16.8654" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
<feBlend mode="normal" in="SourceGraphic" in2="BackgroundImageFix" result="shape"/>
<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
<feOffset dx="-0.865385" dy="-0.865385"/>
<feGaussianBlur stdDeviation="0.75"/>
<feComposite in2="hardAlpha" operator="arithmetic" k2="-1" k3="1"/>
<feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0"/>
<feBlend mode="normal" in2="shape" result="effect1_innerShadow_1873_17784"/>
</filter>
<linearGradient id="paint0_linear_1873_17784" x1="3.73077" y1="1.46154" x2="10.1246" y2="16" gradientUnits="userSpaceOnUse">
<stop stop-color="#E9EFF4"/>
<stop offset="1" stop-color="#CCCCCC"/>
</linearGradient>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 959 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1023 B

View File

@@ -0,0 +1,84 @@
// Copyright (c) Microsoft Corporation
// The Microsoft Corporation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System.Runtime.CompilerServices;
using Microsoft.CommandPalette.Extensions.Toolkit;
[assembly: InternalsVisibleTo("Microsoft.PowerToys.Run.Plugin.TimeDate.UnitTests")]
namespace Microsoft.CmdPal.Ext.TimeDate.Helpers;
internal class AvailableResult
{
/// <summary>
/// Gets or sets the time/date value
/// </summary>
internal string Value { get; set; }
/// <summary>
/// Gets or sets the text used for the subtitle and as search term
/// </summary>
internal string Label { get; set; }
/// <summary>
/// Gets or sets an alternative search tag that will be evaluated if label doesn't match. For example we like to show the era on searches for 'year' too.
/// </summary>
internal string AlternativeSearchTag { get; set; }
/// <summary>
/// Gets or sets a value indicating the type of result
/// </summary>
internal ResultIconType IconType { get; set; }
/// <summary>
/// Returns the path to the icon
/// </summary>
/// <param name="theme">Theme</param>
/// <returns>Path</returns>
public IconInfo GetIconInfo()
{
return IconType switch
{
ResultIconType.Time => ResultHelper.TimeIcon,
ResultIconType.Date => ResultHelper.CalendarIcon,
ResultIconType.DateTime => ResultHelper.TimeDateIcon,
_ => null,
};
}
public ListItem ToListItem()
{
return new ListItem(new CopyTextCommand(this.Value))
{
Title = this.Value,
Subtitle = this.Label,
Icon = this.GetIconInfo(),
};
}
public int Score(string query, string label, string tags)
{
// Get match for label (or for tags if label score is <1)
var score = StringMatcher.FuzzySearch(query, label).Score;
if (score < 1)
{
foreach (var t in tags.Split(";"))
{
var tagScore = StringMatcher.FuzzySearch(query, t.Trim()).Score / 2;
if (tagScore > score)
{
score = tagScore / 2;
}
}
}
return score;
}
}
public enum ResultIconType
{
Time,
Date,
DateTime,
}

View File

@@ -0,0 +1,284 @@
// Copyright (c) Microsoft Corporation
// The Microsoft Corporation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
namespace Microsoft.CmdPal.Ext.TimeDate.Helpers;
internal static class AvailableResultsList
{
/// <summary>
/// Returns a list with all available date time formats
/// </summary>
/// <param name="timeLongFormat">Required for UnitTest: Show time in long format</param>
/// <param name="dateLongFormat">Required for UnitTest: Show date in long format</param>
/// <param name="timestamp">Use custom <see cref="DateTime"/> object to calculate results instead of the system date/time</param>
/// <param name="firstWeekOfYear">Required for UnitTest: Use custom first week of the year instead of the plugin setting.</param>
/// <param name="firstDayOfWeek">Required for UnitTest: Use custom first day of the week instead the plugin setting.</param>
/// <returns>List of results</returns>
internal static List<AvailableResult> GetList(bool isKeywordSearch, SettingsManager settings, bool? timeLongFormat = null, bool? dateLongFormat = null, DateTime? timestamp = null, CalendarWeekRule? firstWeekOfYear = null, DayOfWeek? firstDayOfWeek = null)
{
var results = new List<AvailableResult>();
var calendar = CultureInfo.CurrentCulture.Calendar;
var timeExtended = timeLongFormat ?? settings.TimeWithSecond;
var dateExtended = dateLongFormat ?? settings.DateWithWeekday;
var isSystemDateTime = timestamp == null;
var dateTimeNow = timestamp ?? DateTime.Now;
var dateTimeNowUtc = dateTimeNow.ToUniversalTime();
var firstWeekRule = firstWeekOfYear ?? TimeAndDateHelper.GetCalendarWeekRule(settings.FirstWeekOfYear);
var firstDayOfTheWeek = firstDayOfWeek ?? TimeAndDateHelper.GetFirstDayOfWeek(settings.FirstDayOfWeek);
results.AddRange(new[]
{
// This range is reserved for the following three results: Time, Date, Now
// Don't add any new result in this range! For new results, please use the next range.
new AvailableResult()
{
Value = dateTimeNow.ToString(TimeAndDateHelper.GetStringFormat(FormatStringType.Time, timeExtended, dateExtended), CultureInfo.CurrentCulture),
Label = Resources.Microsoft_plugin_timedate_Time,
AlternativeSearchTag = ResultHelper.SelectStringFromResources(isSystemDateTime, string.Empty, "Microsoft_plugin_timedate_SearchTagTimeNow"),
IconType = ResultIconType.Time,
},
new AvailableResult()
{
Value = dateTimeNow.ToString(TimeAndDateHelper.GetStringFormat(FormatStringType.Date, timeExtended, dateExtended), CultureInfo.CurrentCulture),
Label = Resources.Microsoft_plugin_timedate_Date,
AlternativeSearchTag = ResultHelper.SelectStringFromResources(isSystemDateTime, string.Empty, "Microsoft_plugin_timedate_SearchTagDateNow"),
IconType = ResultIconType.Date,
},
new AvailableResult()
{
Value = dateTimeNow.ToString(TimeAndDateHelper.GetStringFormat(FormatStringType.DateTime, timeExtended, dateExtended), CultureInfo.CurrentCulture),
Label = ResultHelper.SelectStringFromResources(isSystemDateTime, "Microsoft_plugin_timedate_DateAndTime", "Microsoft_plugin_timedate_Now"),
AlternativeSearchTag = ResultHelper.SelectStringFromResources(isSystemDateTime, "Microsoft_plugin_timedate_SearchTagFormat"),
IconType = ResultIconType.DateTime,
},
});
if (isKeywordSearch || !settings.OnlyDateTimeNowGlobal)
{
// We use long instead of int for unix time stamp because int is too small after 03:14:07 UTC 2038-01-19
var unixTimestamp = ((DateTimeOffset)dateTimeNowUtc).ToUnixTimeSeconds();
var unixTimestampMilliseconds = ((DateTimeOffset)dateTimeNowUtc).ToUnixTimeMilliseconds();
var weekOfYear = calendar.GetWeekOfYear(dateTimeNow, firstWeekRule, firstDayOfTheWeek);
var era = DateTimeFormatInfo.CurrentInfo.GetEraName(calendar.GetEra(dateTimeNow));
var eraShort = DateTimeFormatInfo.CurrentInfo.GetAbbreviatedEraName(calendar.GetEra(dateTimeNow));
results.AddRange(new[]
{
new AvailableResult()
{
Value = dateTimeNowUtc.ToString(TimeAndDateHelper.GetStringFormat(FormatStringType.Time, timeExtended, dateExtended), CultureInfo.CurrentCulture),
Label = Resources.Microsoft_plugin_timedate_TimeUtc,
AlternativeSearchTag = ResultHelper.SelectStringFromResources(isSystemDateTime, string.Empty, "Microsoft_plugin_timedate_SearchTagTimeNow"),
IconType = ResultIconType.Time,
},
new AvailableResult()
{
Value = dateTimeNowUtc.ToString(TimeAndDateHelper.GetStringFormat(FormatStringType.DateTime, timeExtended, dateExtended), CultureInfo.CurrentCulture),
Label = ResultHelper.SelectStringFromResources(isSystemDateTime, "Microsoft_plugin_timedate_DateAndTimeUtc", "Microsoft_plugin_timedate_NowUtc"),
AlternativeSearchTag = ResultHelper.SelectStringFromResources(isSystemDateTime, "Microsoft_plugin_timedate_SearchTagFormat"),
IconType = ResultIconType.DateTime,
},
new AvailableResult()
{
Value = unixTimestamp.ToString(CultureInfo.CurrentCulture),
Label = Resources.Microsoft_plugin_timedate_Unix,
AlternativeSearchTag = ResultHelper.SelectStringFromResources(isSystemDateTime, "Microsoft_plugin_timedate_SearchTagFormat"),
IconType = ResultIconType.DateTime,
},
new AvailableResult()
{
Value = unixTimestampMilliseconds.ToString(CultureInfo.CurrentCulture),
Label = Resources.Microsoft_plugin_timedate_Unix_Milliseconds,
AlternativeSearchTag = ResultHelper.SelectStringFromResources(isSystemDateTime, "Microsoft_plugin_timedate_SearchTagFormat"),
IconType = ResultIconType.DateTime,
},
new AvailableResult()
{
Value = dateTimeNow.Hour.ToString(CultureInfo.CurrentCulture),
Label = Resources.Microsoft_plugin_timedate_Hour,
AlternativeSearchTag = ResultHelper.SelectStringFromResources(isSystemDateTime, "Microsoft_plugin_timedate_SearchTagTime"),
IconType = ResultIconType.Time,
},
new AvailableResult()
{
Value = dateTimeNow.Minute.ToString(CultureInfo.CurrentCulture),
Label = Resources.Microsoft_plugin_timedate_Minute,
AlternativeSearchTag = ResultHelper.SelectStringFromResources(isSystemDateTime, "Microsoft_plugin_timedate_SearchTagTime"),
IconType = ResultIconType.Time,
},
new AvailableResult()
{
Value = dateTimeNow.Second.ToString(CultureInfo.CurrentCulture),
Label = Resources.Microsoft_plugin_timedate_Second,
AlternativeSearchTag = ResultHelper.SelectStringFromResources(isSystemDateTime, "Microsoft_plugin_timedate_SearchTagTime"),
IconType = ResultIconType.Time,
},
new AvailableResult()
{
Value = dateTimeNow.Millisecond.ToString(CultureInfo.CurrentCulture),
Label = Resources.Microsoft_plugin_timedate_Millisecond,
AlternativeSearchTag = ResultHelper.SelectStringFromResources(isSystemDateTime, "Microsoft_plugin_timedate_SearchTagTime"),
IconType = ResultIconType.Time,
},
new AvailableResult()
{
Value = DateTimeFormatInfo.CurrentInfo.GetDayName(dateTimeNow.DayOfWeek),
Label = Resources.Microsoft_plugin_timedate_Day,
AlternativeSearchTag = ResultHelper.SelectStringFromResources(isSystemDateTime, "Microsoft_plugin_timedate_SearchTagDate"),
IconType = ResultIconType.Date,
},
new AvailableResult()
{
Value = TimeAndDateHelper.GetNumberOfDayInWeek(dateTimeNow, firstDayOfTheWeek).ToString(CultureInfo.CurrentCulture),
Label = Resources.Microsoft_plugin_timedate_DayOfWeek,
AlternativeSearchTag = ResultHelper.SelectStringFromResources(isSystemDateTime, "Microsoft_plugin_timedate_SearchTagDate"),
IconType = ResultIconType.Date,
},
new AvailableResult()
{
Value = dateTimeNow.Day.ToString(CultureInfo.CurrentCulture),
Label = Resources.Microsoft_plugin_timedate_DayOfMonth,
AlternativeSearchTag = ResultHelper.SelectStringFromResources(isSystemDateTime, "Microsoft_plugin_timedate_SearchTagDate"),
IconType = ResultIconType.Date,
},
new AvailableResult()
{
Value = dateTimeNow.DayOfYear.ToString(CultureInfo.CurrentCulture),
Label = Resources.Microsoft_plugin_timedate_DayOfYear,
AlternativeSearchTag = ResultHelper.SelectStringFromResources(isSystemDateTime, "Microsoft_plugin_timedate_SearchTagDate"),
IconType = ResultIconType.Date,
},
new AvailableResult()
{
Value = TimeAndDateHelper.GetWeekOfMonth(dateTimeNow, firstDayOfTheWeek).ToString(CultureInfo.CurrentCulture),
Label = Resources.Microsoft_plugin_timedate_WeekOfMonth,
AlternativeSearchTag = ResultHelper.SelectStringFromResources(isSystemDateTime, "Microsoft_plugin_timedate_SearchTagDate"),
IconType = ResultIconType.Date,
},
new AvailableResult()
{
Value = weekOfYear.ToString(CultureInfo.CurrentCulture),
Label = Resources.Microsoft_plugin_timedate_WeekOfYear,
AlternativeSearchTag = ResultHelper.SelectStringFromResources(isSystemDateTime, "Microsoft_plugin_timedate_SearchTagDate"),
IconType = ResultIconType.Date,
},
new AvailableResult()
{
Value = DateTimeFormatInfo.CurrentInfo.GetMonthName(dateTimeNow.Month),
Label = Resources.Microsoft_plugin_timedate_Month,
AlternativeSearchTag = ResultHelper.SelectStringFromResources(isSystemDateTime, "Microsoft_plugin_timedate_SearchTagDate"),
IconType = ResultIconType.Date,
},
new AvailableResult()
{
Value = dateTimeNow.Month.ToString(CultureInfo.CurrentCulture),
Label = Resources.Microsoft_plugin_timedate_MonthOfYear,
AlternativeSearchTag = ResultHelper.SelectStringFromResources(isSystemDateTime, "Microsoft_plugin_timedate_SearchTagDate"),
IconType = ResultIconType.Date,
},
new AvailableResult()
{
Value = dateTimeNow.ToString("M", CultureInfo.CurrentCulture),
Label = Resources.Microsoft_plugin_timedate_DayMonth,
AlternativeSearchTag = ResultHelper.SelectStringFromResources(isSystemDateTime, "Microsoft_plugin_timedate_SearchTagDate"),
IconType = ResultIconType.Date,
},
new AvailableResult()
{
Value = calendar.GetYear(dateTimeNow).ToString(CultureInfo.CurrentCulture),
Label = Resources.Microsoft_plugin_timedate_Year,
AlternativeSearchTag = ResultHelper.SelectStringFromResources(isSystemDateTime, "Microsoft_plugin_timedate_SearchTagDate"),
IconType = ResultIconType.Date,
},
new AvailableResult()
{
Value = era,
Label = Resources.Microsoft_plugin_timedate_Era,
AlternativeSearchTag = ResultHelper.SelectStringFromResources(isSystemDateTime, "Microsoft_plugin_timedate_SearchTagEra"),
IconType = ResultIconType.Date,
},
new AvailableResult()
{
Value = era != eraShort ? eraShort : string.Empty, // Setting value to empty string if 'era == eraShort'. This result will be filtered later.
Label = Resources.Microsoft_plugin_timedate_EraAbbreviation,
AlternativeSearchTag = ResultHelper.SelectStringFromResources(isSystemDateTime, "Microsoft_plugin_timedate_SearchTagEra"),
IconType = ResultIconType.Date,
},
new AvailableResult()
{
Value = dateTimeNow.ToString("Y", CultureInfo.CurrentCulture),
Label = Resources.Microsoft_plugin_timedate_MonthYear,
AlternativeSearchTag = ResultHelper.SelectStringFromResources(isSystemDateTime, "Microsoft_plugin_timedate_SearchTagDate"),
IconType = ResultIconType.Date,
},
new AvailableResult()
{
Value = dateTimeNow.ToFileTime().ToString(CultureInfo.CurrentCulture),
Label = Resources.Microsoft_plugin_timedate_WindowsFileTime,
AlternativeSearchTag = ResultHelper.SelectStringFromResources(isSystemDateTime, "Microsoft_plugin_timedate_SearchTagFormat"),
IconType = ResultIconType.DateTime,
},
new AvailableResult()
{
Value = dateTimeNowUtc.ToString("u"),
Label = Resources.Microsoft_plugin_timedate_UniversalTime,
AlternativeSearchTag = ResultHelper.SelectStringFromResources(isSystemDateTime, "Microsoft_plugin_timedate_SearchTagFormat"),
IconType = ResultIconType.DateTime,
},
new AvailableResult()
{
Value = dateTimeNow.ToString("s"),
Label = Resources.Microsoft_plugin_timedate_Iso8601,
AlternativeSearchTag = ResultHelper.SelectStringFromResources(isSystemDateTime, "Microsoft_plugin_timedate_SearchTagFormat"),
IconType = ResultIconType.DateTime,
},
new AvailableResult()
{
Value = dateTimeNowUtc.ToString("yyyy-MM-ddTHH:mm:ss", CultureInfo.InvariantCulture),
Label = Resources.Microsoft_plugin_timedate_Iso8601Utc,
AlternativeSearchTag = ResultHelper.SelectStringFromResources(isSystemDateTime, "Microsoft_plugin_timedate_SearchTagFormat"),
IconType = ResultIconType.DateTime,
},
new AvailableResult()
{
Value = dateTimeNow.ToString("yyyy-MM-ddTHH:mm:ssK", CultureInfo.InvariantCulture),
Label = Resources.Microsoft_plugin_timedate_Iso8601Zone,
AlternativeSearchTag = ResultHelper.SelectStringFromResources(isSystemDateTime, "Microsoft_plugin_timedate_SearchTagFormat"),
IconType = ResultIconType.DateTime,
},
new AvailableResult()
{
Value = dateTimeNowUtc.ToString("yyyy-MM-ddTHH:mm:ss'Z'", CultureInfo.InvariantCulture),
Label = Resources.Microsoft_plugin_timedate_Iso8601ZoneUtc,
AlternativeSearchTag = ResultHelper.SelectStringFromResources(isSystemDateTime, "Microsoft_plugin_timedate_SearchTagFormat"),
IconType = ResultIconType.DateTime,
},
new AvailableResult()
{
Value = dateTimeNow.ToString("R"),
Label = Resources.Microsoft_plugin_timedate_Rfc1123,
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,
},
});
}
// Return only results where value is not empty
// This can happen, for example, when we can't read the 'era' or when 'era == era abbreviation' and we set value explicitly to an empty string.
return results.Where(x => !string.IsNullOrEmpty(x.Value)).ToList();
}
}

View File

@@ -0,0 +1,53 @@
// Copyright (c) Microsoft Corporation
// The Microsoft Corporation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System;
using System.Globalization;
using System.IO;
using Microsoft.CommandPalette.Extensions.Toolkit;
namespace Microsoft.CmdPal.Ext.TimeDate.Helpers;
internal static class ResultHelper
{
/// <summary>
/// Get the string based on the requested type
/// </summary>
/// <param name="isSystemTimeDate">Does the user search for system date/time?</param>
/// <param name="stringId">Id of the string. (Example: `MyString` for `MyString` and `MyStringNow`)</param>
/// <param name="stringIdNow">Optional string id for now case</param>
/// <returns>The string from the resource file, or <see cref="string.Empty"/> otherwise.</returns>
internal static string SelectStringFromResources(bool isSystemTimeDate, string stringId, string stringIdNow = default)
{
return !isSystemTimeDate
? Resources.ResourceManager.GetString(stringId, CultureInfo.CurrentUICulture) ?? string.Empty
: !string.IsNullOrEmpty(stringIdNow)
? Resources.ResourceManager.GetString(stringIdNow, CultureInfo.CurrentUICulture) ?? string.Empty
: Resources.ResourceManager.GetString(stringId + "Now", CultureInfo.CurrentUICulture) ?? string.Empty;
}
public static IconInfo TimeIcon { get; } = new IconInfo("\uE823");
public static IconInfo CalendarIcon { get; } = new IconInfo("\uE787");
public static IconInfo TimeDateIcon { get; } = new IconInfo("\uEC92");
/// <summary>
/// Gets a result with an error message that only numbers can't be parsed
/// </summary>
/// <returns>Element of type <see cref="Result"/>.</returns>
internal static ListItem CreateNumberErrorResult() => new ListItem(new NoOpCommand())
{
Title = Resources.Microsoft_plugin_timedate_ErrorResultTitle,
Subtitle = Resources.Microsoft_plugin_timedate_ErrorResultSubTitle,
Icon = IconHelpers.FromRelativePaths("Microsoft.CmdPal.Ext.TimeDate\\Assets\\Warning.light.png", "Microsoft.CmdPal.Ext.TimeDate\\Assets\\Warning.dark.png"),
};
internal static ListItem CreateInvalidInputErrorResult() => new ListItem(new NoOpCommand())
{
Title = Resources.Microsoft_plugin_timedate_InvalidInput_ErrorMessageTitle,
Subtitle = Resources.Microsoft_plugin_timedate_InvalidInput_ErrorMessageSubTitle,
Icon = IconHelpers.FromRelativePaths("Microsoft.CmdPal.Ext.TimeDate\\Assets\\Warning.light.png", "Microsoft.CmdPal.Ext.TimeDate\\Assets\\Warning.dark.png"),
};
}

View File

@@ -0,0 +1,170 @@
// Copyright (c) Microsoft Corporation
// The Microsoft Corporation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using Microsoft.CommandPalette.Extensions.Toolkit;
namespace Microsoft.CmdPal.Ext.TimeDate.Helpers;
public class SettingsManager : JsonSettingsManager
{
private static readonly string _namespace = "timeDate";
private static string Namespaced(string propertyName) => $"{_namespace}.{propertyName}";
private static readonly List<ChoiceSetSetting.Choice> _firstWeekOfYearChoices = new()
{
new ChoiceSetSetting.Choice(Resources.Microsoft_plugin_timedate_Setting_UseSystemSetting, "-1"),
new ChoiceSetSetting.Choice(Resources.Microsoft_plugin_timedate_SettingFirstWeekRule_FirstDay, "0"),
new ChoiceSetSetting.Choice(Resources.Microsoft_plugin_timedate_SettingFirstWeekRule_FirstFullWeek, "1"),
new ChoiceSetSetting.Choice(Resources.Microsoft_plugin_timedate_SettingFirstWeekRule_FirstFourDayWeek, "2"),
};
private static readonly List<ChoiceSetSetting.Choice> _firstDayOfWeekChoices = GetFirstDayOfWeekChoices();
private static List<ChoiceSetSetting.Choice> GetFirstDayOfWeekChoices()
{
// List (Sorted for first day is Sunday)
var list = new List<ChoiceSetSetting.Choice>
{
new ChoiceSetSetting.Choice(Resources.Microsoft_plugin_timedate_Setting_UseSystemSetting, "-1"),
new ChoiceSetSetting.Choice(Resources.Microsoft_plugin_timedate_SettingFirstDayOfWeek_Sunday, "0"),
new ChoiceSetSetting.Choice(Resources.Microsoft_plugin_timedate_SettingFirstDayOfWeek_Monday, "1"),
new ChoiceSetSetting.Choice(Resources.Microsoft_plugin_timedate_SettingFirstDayOfWeek_Tuesday, "2"),
new ChoiceSetSetting.Choice(Resources.Microsoft_plugin_timedate_SettingFirstDayOfWeek_Wednesday, "3"),
new ChoiceSetSetting.Choice(Resources.Microsoft_plugin_timedate_SettingFirstDayOfWeek_Thursday, "4"),
new ChoiceSetSetting.Choice(Resources.Microsoft_plugin_timedate_SettingFirstDayOfWeek_Friday, "5"),
new ChoiceSetSetting.Choice(Resources.Microsoft_plugin_timedate_SettingFirstDayOfWeek_Saturday, "6"),
};
// Order Rules
var orderRuleSaturday = new string[] { "-1", "6", "0", "1", "2", "3", "4", "5" };
var orderRuleMonday = new string[] { "-1", "1", "2", "3", "4", "5", "6", "0" };
switch (DateTimeFormatInfo.CurrentInfo.FirstDayOfWeek)
{
case DayOfWeek.Saturday:
return list.OrderBy(x => Array.IndexOf(orderRuleSaturday, x.Value)).ToList();
case DayOfWeek.Monday:
return list.OrderBy(x => Array.IndexOf(orderRuleMonday, x.Value)).ToList();
default:
// DayOfWeek.Sunday
return list;
}
}
private readonly ChoiceSetSetting _firstWeekOfYear = new(
Namespaced(nameof(FirstWeekOfYear)),
Resources.Microsoft_plugin_timedate_SettingFirstWeekRule,
Resources.Microsoft_plugin_timedate_SettingFirstWeekRule_Description,
_firstWeekOfYearChoices);
private readonly ChoiceSetSetting _firstDayOfWeek = new(
Namespaced(nameof(FirstDayOfWeek)),
Resources.Microsoft_plugin_timedate_SettingFirstDayOfWeek,
Resources.Microsoft_plugin_timedate_SettingFirstDayOfWeek,
_firstDayOfWeekChoices);
private readonly ToggleSetting _onlyDateTimeNowGlobal = new(
Namespaced(nameof(OnlyDateTimeNowGlobal)),
Resources.Microsoft_plugin_timedate_SettingOnlyDateTimeNowGlobal,
Resources.Microsoft_plugin_timedate_SettingOnlyDateTimeNowGlobal_Description,
true); // TODO -- double check default value
private readonly ToggleSetting _timeWithSeconds = new(
Namespaced(nameof(TimeWithSecond)),
Resources.Microsoft_plugin_timedate_SettingTimeWithSeconds,
Resources.Microsoft_plugin_timedate_SettingTimeWithSeconds_Description,
false); // TODO -- double check default value
private readonly ToggleSetting _dateWithWeekday = new(
Namespaced(nameof(DateWithWeekday)),
Resources.Microsoft_plugin_timedate_SettingDateWithWeekday,
Resources.Microsoft_plugin_timedate_SettingDateWithWeekday_Description,
false); // TODO -- double check default value
private readonly ToggleSetting _hideNumberMessageOnGlobalQuery = new(
Namespaced(nameof(HideNumberMessageOnGlobalQuery)),
Resources.Microsoft_plugin_timedate_SettingHideNumberMessageOnGlobalQuery,
Resources.Microsoft_plugin_timedate_SettingHideNumberMessageOnGlobalQuery,
true); // TODO -- double check default value
public int FirstWeekOfYear
{
get
{
if (_firstWeekOfYear.Value == null || string.IsNullOrEmpty(_firstWeekOfYear.Value))
{
return -1;
}
var success = int.TryParse(_firstWeekOfYear.Value, out var result);
if (!success)
{
return -1;
}
return result;
}
}
public int FirstDayOfWeek
{
get
{
if (_firstDayOfWeek.Value == null || string.IsNullOrEmpty(_firstDayOfWeek.Value))
{
return -1;
}
var success = int.TryParse(_firstDayOfWeek.Value, out var result);
if (!success)
{
return -1;
}
return result;
}
}
public bool OnlyDateTimeNowGlobal => _onlyDateTimeNowGlobal.Value;
public bool TimeWithSecond => _timeWithSeconds.Value;
public bool DateWithWeekday => _dateWithWeekday.Value;
public bool HideNumberMessageOnGlobalQuery => _hideNumberMessageOnGlobalQuery.Value;
internal static string SettingsJsonPath()
{
var directory = Utilities.BaseSettingsPath("Microsoft.CmdPal");
Directory.CreateDirectory(directory);
// now, the state is just next to the exe
return Path.Combine(directory, "settings.json");
}
public SettingsManager()
{
FilePath = SettingsJsonPath();
Settings.Add(_firstWeekOfYear);
Settings.Add(_firstDayOfWeek);
Settings.Add(_onlyDateTimeNowGlobal);
Settings.Add(_timeWithSeconds);
Settings.Add(_dateWithWeekday);
Settings.Add(_hideNumberMessageOnGlobalQuery);
// Load settings from file upon initialization
LoadSettings();
Settings.SettingsChanged += (s, a) => this.SaveSettings();
}
}

View File

@@ -0,0 +1,189 @@
// Copyright (c) Microsoft Corporation
// The Microsoft Corporation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System;
using System.Globalization;
using System.Text.RegularExpressions;
namespace Microsoft.CmdPal.Ext.TimeDate.Helpers;
internal static class TimeAndDateHelper
{
/// <summary>
/// Get the format for the time string
/// </summary>
/// <param name="targetFormat">Type of format</param>
/// <param name="timeLong">Show date with weekday and name of month (long format)</param>
/// <param name="dateLong">Show time with seconds (long format)</param>
/// <returns>String that identifies the time/date format (<see href="https://learn.microsoft.com/dotnet/api/system.datetime.tostring"/>)</returns>
internal static string GetStringFormat(FormatStringType targetFormat, bool timeLong, bool dateLong)
{
switch (targetFormat)
{
case FormatStringType.Time:
return timeLong ? "T" : "t";
case FormatStringType.Date:
return dateLong ? "D" : "d";
case FormatStringType.DateTime:
if (timeLong & dateLong)
{
return "F"; // Friday, October 31, 2008 5:04:32 PM
}
else if (timeLong & !dateLong)
{
return "G"; // 10/31/2008 5:04:32 PM
}
else if (!timeLong & dateLong)
{
return "f"; // Friday, October 31, 2008 5:04 PM
}
else
{
// (!timeLong & !dateLong)
return "g"; // 10/31/2008 5:04 PM
}
default:
return string.Empty; // Windows default based on current culture settings
}
}
/// <summary>
/// Returns the number week in the month (Used code from 'David Morton' from <see href="https://social.msdn.microsoft.com/Forums/vstudio/bf504bba-85cb-492d-a8f7-4ccabdf882cb/get-week-number-for-month"/>)
/// </summary>
/// <param name="date">date</param>
/// <returns>Number of week in the month</returns>
internal static int GetWeekOfMonth(DateTime date, DayOfWeek formatSettingFirstDayOfWeek)
{
var beginningOfMonth = new DateTime(date.Year, date.Month, 1);
var adjustment = 1; // We count from 1 to 7 and not from 0 to 6
while (date.Date.AddDays(1).DayOfWeek != formatSettingFirstDayOfWeek)
{
date = date.AddDays(1);
}
return (int)Math.Truncate((double)date.Subtract(beginningOfMonth).TotalDays / 7f) + adjustment;
}
/// <summary>
/// Returns the number of the day in the week
/// </summary>
/// <param name="date">Date</param>
/// <returns>Number of the day in the week</returns>
internal static int GetNumberOfDayInWeek(DateTime date, DayOfWeek formatSettingFirstDayOfWeek)
{
var daysInWeek = 7;
var adjustment = 1; // We count from 1 to 7 and not from 0 to 6
return ((date.DayOfWeek + daysInWeek - formatSettingFirstDayOfWeek) % daysInWeek) + adjustment;
}
/// <summary>
/// Convert input string to a <see cref="DateTime"/> object in local time
/// </summary>
/// <param name="input">String with date/time</param>
/// <param name="timestamp">The new <see cref="DateTime"/> object</param>
/// <returns>True on success, otherwise false</returns>
internal static bool ParseStringAsDateTime(in string input, out DateTime timestamp)
{
if (DateTime.TryParse(input, out timestamp))
{
// Known date/time format
return true;
}
else if (Regex.IsMatch(input, @"^u[\+-]?\d{1,10}$") && long.TryParse(input.TrimStart('u'), out var secondsU))
{
// Unix time stamp
// We use long instead of int, because int is too small after 03:14:07 UTC 2038-01-19
timestamp = DateTimeOffset.FromUnixTimeSeconds(secondsU).LocalDateTime;
return true;
}
else if (Regex.IsMatch(input, @"^ums[\+-]?\d{1,13}$") && long.TryParse(input.TrimStart("ums".ToCharArray()), out var millisecondsUms))
{
// Unix time stamp in milliseconds
// We use long instead of int because int is too small after 03:14:07 UTC 2038-01-19
timestamp = DateTimeOffset.FromUnixTimeMilliseconds(millisecondsUms).LocalDateTime;
return true;
}
else if (Regex.IsMatch(input, @"^ft\d+$") && long.TryParse(input.TrimStart("ft".ToCharArray()), out var secondsFt))
{
// Windows file time
// DateTime.FromFileTime returns as local time.
timestamp = DateTime.FromFileTime(secondsFt);
return true;
}
else
{
timestamp = new DateTime(1, 1, 1, 1, 1, 1);
return false;
}
}
/// <summary>
/// Test if input is special parsing for Unix time, Unix time in milliseconds or File time.
/// </summary>
/// <param name="input">String with date/time</param>
/// <returns>True if yes, otherwise false</returns>
internal static bool IsSpecialInputParsing(string input)
{
return Regex.IsMatch(input, @"^.*(u|ums|ft)\d");
}
/// <summary>
/// Returns a CalendarWeekRule enum value based on the plugin setting.
/// </summary>
internal static CalendarWeekRule GetCalendarWeekRule(int pluginSetting)
{
switch (pluginSetting)
{
case 0:
return CalendarWeekRule.FirstDay;
case 1:
return CalendarWeekRule.FirstFullWeek;
case 2:
return CalendarWeekRule.FirstFourDayWeek;
default:
// Wrong json value and system setting (-1).
return DateTimeFormatInfo.CurrentInfo.CalendarWeekRule;
}
}
/// <summary>
/// Returns a DayOfWeek enum value based on the FirstDayOfWeek plugin setting.
/// </summary>
internal static DayOfWeek GetFirstDayOfWeek(int pluginSetting)
{
switch (pluginSetting)
{
case 0:
return DayOfWeek.Sunday;
case 1:
return DayOfWeek.Monday;
case 2:
return DayOfWeek.Tuesday;
case 3:
return DayOfWeek.Wednesday;
case 4:
return DayOfWeek.Thursday;
case 5:
return DayOfWeek.Friday;
case 6:
return DayOfWeek.Saturday;
default:
// Wrong json value and system setting (-1).
return DateTimeFormatInfo.CurrentInfo.FirstDayOfWeek;
}
}
}
/// <summary>
/// Type of time/date format
/// </summary>
internal enum FormatStringType
{
Time,
Date,
DateTime,
}

View File

@@ -0,0 +1,108 @@
// Copyright (c) Microsoft Corporation
// The Microsoft Corporation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text.RegularExpressions;
using Microsoft.CommandPalette.Extensions.Toolkit;
namespace Microsoft.CmdPal.Ext.TimeDate.Helpers;
public sealed partial class TimeDateCalculator
{
/// <summary>
/// Var that holds the delimiter between format and date
/// </summary>
private const string InputDelimiter = "::";
/// <summary>
/// A list of conjunctions that we ignore on search
/// </summary>
private static readonly string[] _conjunctionList = Resources.Microsoft_plugin_timedate_Search_ConjunctionList.Split("; ");
/// <summary>
/// Searches for results
/// </summary>
/// <param name="query">Search query object</param>
/// <returns>List of Wox <see cref="Result"/>s.</returns>
public static List<ListItem> ExecuteSearch(SettingsManager settings, string query)
{
var isEmptySearchInput = string.IsNullOrEmpty(query);
List<AvailableResult> availableFormats = new List<AvailableResult>();
List<ListItem> results = new List<ListItem>();
// currently, all of the search in V2 is keyword search.
var isKeywordSearch = true;
// Switch search type
if (isEmptySearchInput || (!isKeywordSearch && settings.OnlyDateTimeNowGlobal))
{
// Return all results for system time/date on empty keyword search
// or only time, date and now results for system time on global queries if the corresponding setting is enabled
availableFormats.AddRange(AvailableResultsList.GetList(isKeywordSearch, settings));
}
else if (Regex.IsMatch(query, @".+" + Regex.Escape(InputDelimiter) + @".+"))
{
// Search for specified format with specified time/date value
var userInput = query.Split(InputDelimiter);
if (TimeAndDateHelper.ParseStringAsDateTime(userInput[1], out DateTime timestamp))
{
availableFormats.AddRange(AvailableResultsList.GetList(isKeywordSearch, settings, null, null, timestamp));
query = userInput[0];
}
}
else if (TimeAndDateHelper.ParseStringAsDateTime(query, out DateTime timestamp))
{
// Return all formats for specified time/date value
availableFormats.AddRange(AvailableResultsList.GetList(isKeywordSearch, settings, null, null, timestamp));
query = string.Empty;
}
else
{
// Search for specified format with system time/date (All other cases)
availableFormats.AddRange(AvailableResultsList.GetList(isKeywordSearch, settings));
}
// Check searchTerm after getting results to select type of result list
if (string.IsNullOrEmpty(query))
{
// Generate list with all results
foreach (var f in availableFormats)
{
results.Add(f.ToListItem());
}
}
else
{
// Generate filtered list of results
foreach (var f in availableFormats)
{
var score = f.Score(query, f.Label, f.AlternativeSearchTag);
if (score > 0)
{
results.Add(f.ToListItem());
}
}
}
// If search term is only a number that can't be parsed return an error message
if (!isEmptySearchInput && results.Count == 0 && Regex.IsMatch(query, @"\w+\d+.*$") && !query.Any(char.IsWhiteSpace) && (TimeAndDateHelper.IsSpecialInputParsing(query) || !Regex.IsMatch(query, @"\d+[\.:/]\d+")))
{
// Without plugin key word show only if message is not hidden by setting
if (!settings.HideNumberMessageOnGlobalQuery)
{
results.Add(ResultHelper.CreateNumberErrorResult());
}
}
if (results.Count == 0)
{
results.Add(ResultHelper.CreateInvalidInputErrorResult());
}
return results;
}
}

View File

@@ -0,0 +1,43 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\..\..\Common.Dotnet.CsWinRT.props" />
<Import Project="..\..\Microsoft.CmdPal.UI\CmdPal.pre.props" />
<PropertyGroup>
<RootNamespace>Microsoft.CmdPal.Ext.TimeDate</RootNamespace>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<AppendRuntimeIdentifierToOutputPath>false</AppendRuntimeIdentifierToOutputPath>
<!-- MRT from windows app sdk will search for a pri file with the same name of the module before defaulting to resources.pri -->
<ProjectPriFileName>Microsoft.CmdPal.Ext.TimeDate.pri</ProjectPriFileName>
</PropertyGroup>
<ItemGroup>
<EmbeddedResource Update="Properties\Resources.resx">
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
<Generator>PublicResXFileCodeGenerator</Generator>
<CustomToolNamespace>Microsoft.CmdPal.Ext.TimeDate</CustomToolNamespace>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\extensionsdk\Microsoft.CommandPalette.Extensions.Toolkit\Microsoft.CommandPalette.Extensions.Toolkit.csproj" />
</ItemGroup>
<ItemGroup>
<Compile Update="Properties\Resources.Designer.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<None Include="Assets\TimeDate.png" />
</ItemGroup>
<ItemGroup>
<Content Update="Assets\TimeDate.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Update="Assets\TimeDate.svg">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>
</Project>

View File

@@ -0,0 +1,92 @@
// Copyright (c) Microsoft Corporation
// The Microsoft Corporation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using Microsoft.CmdPal.Ext.TimeDate.Helpers;
using Microsoft.CommandPalette.Extensions;
using Microsoft.CommandPalette.Extensions.Toolkit;
namespace Microsoft.CmdPal.Ext.TimeDate.Pages;
internal sealed partial class TimeDateExtensionPage : DynamicListPage
{
private readonly Lock _resultsLock = new();
private IList<ListItem> _results = new List<ListItem>();
private bool initialized;
private SettingsManager _settingsManager;
public TimeDateExtensionPage(SettingsManager settingsManager)
{
Icon = IconHelpers.FromRelativePath("Assets\\TimeDate.svg");
Title = Resources.Microsoft_plugin_timedate_main_page_title;
Name = Resources.Microsoft_plugin_timedate_main_page_name;
PlaceholderText = Resources.Microsoft_plugin_timedate_placeholder_text;
Id = "com.microsoft.cmdpal.timedate";
_settingsManager = settingsManager;
}
public override IListItem[] GetItems()
{
if (!initialized)
{
DoExecuteSearch(string.Empty);
}
lock (_resultsLock)
{
ListItem[] results = _results.ToArray();
return results;
}
}
public override void UpdateSearchText(string oldSearch, string newSearch)
{
if (newSearch == oldSearch)
{
return;
}
DoExecuteSearch(newSearch);
}
private void DoExecuteSearch(string query)
{
try
{
var result = TimeDateCalculator.ExecuteSearch(_settingsManager, query);
UpdateResult(result);
}
catch (Exception)
{
// sometimes, user's input may not correct.
// In most of the time, user may not have completed their input.
// So, we need to clean the result.
// But in that time, empty result may cause exception.
// So, we need to add at least on item to user.
var items = new List<ListItem>
{
ResultHelper.CreateInvalidInputErrorResult(),
};
UpdateResult(items);
}
}
private void UpdateResult(IList<ListItem> result)
{
lock (_resultsLock)
{
initialized = true;
this._results = result;
}
RaiseItemsChanged(this._results.Count);
}
}

View File

@@ -0,0 +1,783 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace Microsoft.CmdPal.Ext.TimeDate {
using System;
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
// This class was auto-generated by the StronglyTypedResourceBuilder
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
public class Resources {
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources() {
}
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
public static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Microsoft.CmdPal.Ext.TimeDate.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
public static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
/// <summary>
/// Looks up a localized string similar to Copy failed.
/// </summary>
public static string Microsoft_plugin_timedate_copy_failed {
get {
return ResourceManager.GetString("Microsoft_plugin_timedate_copy_failed", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Copy value (Ctrl+C).
/// </summary>
public static string Microsoft_plugin_timedate_CopyToClipboard {
get {
return ResourceManager.GetString("Microsoft_plugin_timedate_CopyToClipboard", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Date.
/// </summary>
public static string Microsoft_plugin_timedate_Date {
get {
return ResourceManager.GetString("Microsoft_plugin_timedate_Date", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Date and time.
/// </summary>
public static string Microsoft_plugin_timedate_DateAndTime {
get {
return ResourceManager.GetString("Microsoft_plugin_timedate_DateAndTime", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Date and time UTC.
/// </summary>
public static string Microsoft_plugin_timedate_DateAndTimeUtc {
get {
return ResourceManager.GetString("Microsoft_plugin_timedate_DateAndTimeUtc", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Day (Week day).
/// </summary>
public static string Microsoft_plugin_timedate_Day {
get {
return ResourceManager.GetString("Microsoft_plugin_timedate_Day", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Month and day.
/// </summary>
public static string Microsoft_plugin_timedate_DayMonth {
get {
return ResourceManager.GetString("Microsoft_plugin_timedate_DayMonth", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Day of the month.
/// </summary>
public static string Microsoft_plugin_timedate_DayOfMonth {
get {
return ResourceManager.GetString("Microsoft_plugin_timedate_DayOfMonth", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Day of the week (Week day).
/// </summary>
public static string Microsoft_plugin_timedate_DayOfWeek {
get {
return ResourceManager.GetString("Microsoft_plugin_timedate_DayOfWeek", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Day of the year.
/// </summary>
public static string Microsoft_plugin_timedate_DayOfYear {
get {
return ResourceManager.GetString("Microsoft_plugin_timedate_DayOfYear", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Era.
/// </summary>
public static string Microsoft_plugin_timedate_Era {
get {
return ResourceManager.GetString("Microsoft_plugin_timedate_Era", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Era abbreviation.
/// </summary>
public static string Microsoft_plugin_timedate_EraAbbreviation {
get {
return ResourceManager.GetString("Microsoft_plugin_timedate_EraAbbreviation", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Valid prefixes: &apos;u&apos; for Unix Timestamp, &apos;ums&apos; for Unix Timestamp in milliseconds, &apos;ft&apos; for Windows file time.
/// </summary>
public static string Microsoft_plugin_timedate_ErrorResultSubTitle {
get {
return ResourceManager.GetString("Microsoft_plugin_timedate_ErrorResultSubTitle", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Error: Invalid number input.
/// </summary>
public static string Microsoft_plugin_timedate_ErrorResultTitle {
get {
return ResourceManager.GetString("Microsoft_plugin_timedate_ErrorResultTitle", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Date and time in filename-compatible format.
/// </summary>
public 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>
public static string Microsoft_plugin_timedate_Hour {
get {
return ResourceManager.GetString("Microsoft_plugin_timedate_Hour", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Valid prefixes: &apos;u&apos; for Unix Timestamp, &apos;ums&apos; for Unix Timestamp in milliseconds, &apos;ft&apos; for Windows file time.
/// </summary>
public static string Microsoft_plugin_timedate_InvalidInput_ErrorMessageSubTitle {
get {
return ResourceManager.GetString("Microsoft_plugin_timedate_InvalidInput_ErrorMessageSubTitle", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Error: Invalid input.
/// </summary>
public static string Microsoft_plugin_timedate_InvalidInput_ErrorMessageTitle {
get {
return ResourceManager.GetString("Microsoft_plugin_timedate_InvalidInput_ErrorMessageTitle", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to ISO 8601.
/// </summary>
public static string Microsoft_plugin_timedate_Iso8601 {
get {
return ResourceManager.GetString("Microsoft_plugin_timedate_Iso8601", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to ISO 8601 UTC.
/// </summary>
public static string Microsoft_plugin_timedate_Iso8601Utc {
get {
return ResourceManager.GetString("Microsoft_plugin_timedate_Iso8601Utc", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to ISO 8601 with time zone.
/// </summary>
public static string Microsoft_plugin_timedate_Iso8601Zone {
get {
return ResourceManager.GetString("Microsoft_plugin_timedate_Iso8601Zone", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to ISO 8601 UTC with time zone.
/// </summary>
public static string Microsoft_plugin_timedate_Iso8601ZoneUtc {
get {
return ResourceManager.GetString("Microsoft_plugin_timedate_Iso8601ZoneUtc", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Open.
/// </summary>
public static string Microsoft_plugin_timedate_main_page_name {
get {
return ResourceManager.GetString("Microsoft_plugin_timedate_main_page_name", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Time and Date.
/// </summary>
public static string Microsoft_plugin_timedate_main_page_title {
get {
return ResourceManager.GetString("Microsoft_plugin_timedate_main_page_title", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Millisecond.
/// </summary>
public static string Microsoft_plugin_timedate_Millisecond {
get {
return ResourceManager.GetString("Microsoft_plugin_timedate_Millisecond", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Minute.
/// </summary>
public static string Microsoft_plugin_timedate_Minute {
get {
return ResourceManager.GetString("Microsoft_plugin_timedate_Minute", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Month.
/// </summary>
public static string Microsoft_plugin_timedate_Month {
get {
return ResourceManager.GetString("Microsoft_plugin_timedate_Month", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Month of the year.
/// </summary>
public static string Microsoft_plugin_timedate_MonthOfYear {
get {
return ResourceManager.GetString("Microsoft_plugin_timedate_MonthOfYear", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Month and year.
/// </summary>
public static string Microsoft_plugin_timedate_MonthYear {
get {
return ResourceManager.GetString("Microsoft_plugin_timedate_MonthYear", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Now.
/// </summary>
public static string Microsoft_plugin_timedate_Now {
get {
return ResourceManager.GetString("Microsoft_plugin_timedate_Now", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Now UTC.
/// </summary>
public static string Microsoft_plugin_timedate_NowUtc {
get {
return ResourceManager.GetString("Microsoft_plugin_timedate_NowUtc", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Search values or type a custom time stamp....
/// </summary>
public static string Microsoft_plugin_timedate_placeholder_text {
get {
return ResourceManager.GetString("Microsoft_plugin_timedate_placeholder_text", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Provides time and date values in different formats.
/// </summary>
public static string Microsoft_plugin_timedate_plugin_description {
get {
return ResourceManager.GetString("Microsoft_plugin_timedate_plugin_description", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Calendar week.
/// </summary>
public static string Microsoft_plugin_timedate_plugin_description_example_calendarWeek {
get {
return ResourceManager.GetString("Microsoft_plugin_timedate_plugin_description_example_calendarWeek", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Day.
/// </summary>
public static string Microsoft_plugin_timedate_plugin_description_example_day {
get {
return ResourceManager.GetString("Microsoft_plugin_timedate_plugin_description_example_day", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Time.
/// </summary>
public static string Microsoft_plugin_timedate_plugin_description_example_time {
get {
return ResourceManager.GetString("Microsoft_plugin_timedate_plugin_description_example_time", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Time and Date.
/// </summary>
public static string Microsoft_plugin_timedate_plugin_name {
get {
return ResourceManager.GetString("Microsoft_plugin_timedate_plugin_name", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to RFC1123.
/// </summary>
public static string Microsoft_plugin_timedate_Rfc1123 {
get {
return ResourceManager.GetString("Microsoft_plugin_timedate_Rfc1123", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to for; and; nor; but; or; so.
/// </summary>
public static string Microsoft_plugin_timedate_Search_ConjunctionList {
get {
return ResourceManager.GetString("Microsoft_plugin_timedate_Search_ConjunctionList", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Date.
/// </summary>
public static string Microsoft_plugin_timedate_SearchTagDate {
get {
return ResourceManager.GetString("Microsoft_plugin_timedate_SearchTagDate", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Current date; Now.
/// </summary>
public static string Microsoft_plugin_timedate_SearchTagDateNow {
get {
return ResourceManager.GetString("Microsoft_plugin_timedate_SearchTagDateNow", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Year; Calendar era; Date.
/// </summary>
public static string Microsoft_plugin_timedate_SearchTagEra {
get {
return ResourceManager.GetString("Microsoft_plugin_timedate_SearchTagEra", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Current year; Current calendar era; Current date; Now.
/// </summary>
public static string Microsoft_plugin_timedate_SearchTagEraNow {
get {
return ResourceManager.GetString("Microsoft_plugin_timedate_SearchTagEraNow", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Date and time; Time and Date.
/// </summary>
public static string Microsoft_plugin_timedate_SearchTagFormat {
get {
return ResourceManager.GetString("Microsoft_plugin_timedate_SearchTagFormat", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Current date and time; Current time and date; Now.
/// </summary>
public static string Microsoft_plugin_timedate_SearchTagFormatNow {
get {
return ResourceManager.GetString("Microsoft_plugin_timedate_SearchTagFormatNow", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Time.
/// </summary>
public static string Microsoft_plugin_timedate_SearchTagTime {
get {
return ResourceManager.GetString("Microsoft_plugin_timedate_SearchTagTime", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Current Time; Now.
/// </summary>
public static string Microsoft_plugin_timedate_SearchTagTimeNow {
get {
return ResourceManager.GetString("Microsoft_plugin_timedate_SearchTagTimeNow", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Second.
/// </summary>
public static string Microsoft_plugin_timedate_Second {
get {
return ResourceManager.GetString("Microsoft_plugin_timedate_Second", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Use system setting.
/// </summary>
public static string Microsoft_plugin_timedate_Setting_UseSystemSetting {
get {
return ResourceManager.GetString("Microsoft_plugin_timedate_Setting_UseSystemSetting", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Show date with weekday and name of month.
/// </summary>
public static string Microsoft_plugin_timedate_SettingDateWithWeekday {
get {
return ResourceManager.GetString("Microsoft_plugin_timedate_SettingDateWithWeekday", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to This setting applies to the &apos;Date&apos; and &apos;Now&apos; result..
/// </summary>
public static string Microsoft_plugin_timedate_SettingDateWithWeekday_Description {
get {
return ResourceManager.GetString("Microsoft_plugin_timedate_SettingDateWithWeekday_Description", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to First day of the week.
/// </summary>
public static string Microsoft_plugin_timedate_SettingFirstDayOfWeek {
get {
return ResourceManager.GetString("Microsoft_plugin_timedate_SettingFirstDayOfWeek", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Friday.
/// </summary>
public static string Microsoft_plugin_timedate_SettingFirstDayOfWeek_Friday {
get {
return ResourceManager.GetString("Microsoft_plugin_timedate_SettingFirstDayOfWeek_Friday", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Monday.
/// </summary>
public static string Microsoft_plugin_timedate_SettingFirstDayOfWeek_Monday {
get {
return ResourceManager.GetString("Microsoft_plugin_timedate_SettingFirstDayOfWeek_Monday", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Saturday.
/// </summary>
public static string Microsoft_plugin_timedate_SettingFirstDayOfWeek_Saturday {
get {
return ResourceManager.GetString("Microsoft_plugin_timedate_SettingFirstDayOfWeek_Saturday", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Sunday.
/// </summary>
public static string Microsoft_plugin_timedate_SettingFirstDayOfWeek_Sunday {
get {
return ResourceManager.GetString("Microsoft_plugin_timedate_SettingFirstDayOfWeek_Sunday", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Thursday.
/// </summary>
public static string Microsoft_plugin_timedate_SettingFirstDayOfWeek_Thursday {
get {
return ResourceManager.GetString("Microsoft_plugin_timedate_SettingFirstDayOfWeek_Thursday", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Tuesday.
/// </summary>
public static string Microsoft_plugin_timedate_SettingFirstDayOfWeek_Tuesday {
get {
return ResourceManager.GetString("Microsoft_plugin_timedate_SettingFirstDayOfWeek_Tuesday", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Wednesday.
/// </summary>
public static string Microsoft_plugin_timedate_SettingFirstDayOfWeek_Wednesday {
get {
return ResourceManager.GetString("Microsoft_plugin_timedate_SettingFirstDayOfWeek_Wednesday", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to First week of the year.
/// </summary>
public static string Microsoft_plugin_timedate_SettingFirstWeekRule {
get {
return ResourceManager.GetString("Microsoft_plugin_timedate_SettingFirstWeekRule", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Configure the calendar rule for the first week of the year..
/// </summary>
public static string Microsoft_plugin_timedate_SettingFirstWeekRule_Description {
get {
return ResourceManager.GetString("Microsoft_plugin_timedate_SettingFirstWeekRule_Description", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to First day of year.
/// </summary>
public static string Microsoft_plugin_timedate_SettingFirstWeekRule_FirstDay {
get {
return ResourceManager.GetString("Microsoft_plugin_timedate_SettingFirstWeekRule_FirstDay", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to First four day week.
/// </summary>
public static string Microsoft_plugin_timedate_SettingFirstWeekRule_FirstFourDayWeek {
get {
return ResourceManager.GetString("Microsoft_plugin_timedate_SettingFirstWeekRule_FirstFourDayWeek", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to First full week.
/// </summary>
public static string Microsoft_plugin_timedate_SettingFirstWeekRule_FirstFullWeek {
get {
return ResourceManager.GetString("Microsoft_plugin_timedate_SettingFirstWeekRule_FirstFullWeek", resourceCulture);
}
}
/// <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>
public static string Microsoft_plugin_timedate_SettingTimeWithSeconds {
get {
return ResourceManager.GetString("Microsoft_plugin_timedate_SettingTimeWithSeconds", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to This setting applies to the &apos;Time&apos; and &apos;Now&apos; result..
/// </summary>
public static string Microsoft_plugin_timedate_SettingTimeWithSeconds_Description {
get {
return ResourceManager.GetString("Microsoft_plugin_timedate_SettingTimeWithSeconds_Description", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Select or press Ctrl+C to copy.
/// </summary>
public static string Microsoft_plugin_timedate_SubTitleNote {
get {
return ResourceManager.GetString("Microsoft_plugin_timedate_SubTitleNote", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Time.
/// </summary>
public static string Microsoft_plugin_timedate_Time {
get {
return ResourceManager.GetString("Microsoft_plugin_timedate_Time", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Time UTC.
/// </summary>
public static string Microsoft_plugin_timedate_TimeUtc {
get {
return ResourceManager.GetString("Microsoft_plugin_timedate_TimeUtc", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Alternative search tags:.
/// </summary>
public static string Microsoft_plugin_timedate_ToolTipAlternativeSearchTag {
get {
return ResourceManager.GetString("Microsoft_plugin_timedate_ToolTipAlternativeSearchTag", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Universal time format: YYYY-MM-DD hh:mm:ss.
/// </summary>
public static string Microsoft_plugin_timedate_UniversalTime {
get {
return ResourceManager.GetString("Microsoft_plugin_timedate_UniversalTime", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Unix epoch time.
/// </summary>
public static string Microsoft_plugin_timedate_Unix {
get {
return ResourceManager.GetString("Microsoft_plugin_timedate_Unix", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Unix epoch time in milliseconds.
/// </summary>
public static string Microsoft_plugin_timedate_Unix_Milliseconds {
get {
return ResourceManager.GetString("Microsoft_plugin_timedate_Unix_Milliseconds", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Week of the month.
/// </summary>
public static string Microsoft_plugin_timedate_WeekOfMonth {
get {
return ResourceManager.GetString("Microsoft_plugin_timedate_WeekOfMonth", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Week of the year (Calendar week, Week number).
/// </summary>
public static string Microsoft_plugin_timedate_WeekOfYear {
get {
return ResourceManager.GetString("Microsoft_plugin_timedate_WeekOfYear", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Windows file time (Int64 number).
/// </summary>
public static string Microsoft_plugin_timedate_WindowsFileTime {
get {
return ResourceManager.GetString("Microsoft_plugin_timedate_WindowsFileTime", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Year.
/// </summary>
public static string Microsoft_plugin_timedate_Year {
get {
return ResourceManager.GetString("Microsoft_plugin_timedate_Year", resourceCulture);
}
}
}
}

View File

@@ -0,0 +1,378 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="Microsoft_plugin_timedate_CopyToClipboard" xml:space="preserve">
<value>Copy value (Ctrl+C)</value>
<comment>'Ctrl+C' is a shortcut</comment>
</data>
<data name="Microsoft_plugin_timedate_copy_failed" xml:space="preserve">
<value>Copy failed</value>
</data>
<data name="Microsoft_plugin_timedate_Date" xml:space="preserve">
<value>Date</value>
</data>
<data name="Microsoft_plugin_timedate_DateAndTime" xml:space="preserve">
<value>Date and time</value>
</data>
<data name="Microsoft_plugin_timedate_DateAndTimeUtc" xml:space="preserve">
<value>Date and time UTC</value>
<comment>'UTC' means here 'Universal Time Convention'</comment>
</data>
<data name="Microsoft_plugin_timedate_Day" xml:space="preserve">
<value>Day (Week day)</value>
</data>
<data name="Microsoft_plugin_timedate_DayMonth" xml:space="preserve">
<value>Month and day</value>
</data>
<data name="Microsoft_plugin_timedate_DayOfMonth" xml:space="preserve">
<value>Day of the month</value>
</data>
<data name="Microsoft_plugin_timedate_DayOfWeek" xml:space="preserve">
<value>Day of the week (Week day)</value>
</data>
<data name="Microsoft_plugin_timedate_DayOfYear" xml:space="preserve">
<value>Day of the year</value>
</data>
<data name="Microsoft_plugin_timedate_Era" xml:space="preserve">
<value>Era</value>
</data>
<data name="Microsoft_plugin_timedate_EraAbbreviation" xml:space="preserve">
<value>Era abbreviation</value>
</data>
<data name="Microsoft_plugin_timedate_ErrorResultSubTitle" xml:space="preserve">
<value>Valid prefixes: 'u' for Unix Timestamp, 'ums' for Unix Timestamp in milliseconds, 'ft' for Windows file time</value>
</data>
<data name="Microsoft_plugin_timedate_ErrorResultTitle" xml:space="preserve">
<value>Error: Invalid number input</value>
</data>
<data name="Microsoft_plugin_timedate_Hour" xml:space="preserve">
<value>Hour</value>
</data>
<data name="Microsoft_plugin_timedate_Iso8601" xml:space="preserve">
<value>ISO 8601</value>
</data>
<data name="Microsoft_plugin_timedate_Iso8601Utc" xml:space="preserve">
<value>ISO 8601 UTC</value>
<comment>'UTC' means here 'Universal Time Convention'</comment>
</data>
<data name="Microsoft_plugin_timedate_Iso8601Zone" xml:space="preserve">
<value>ISO 8601 with time zone</value>
</data>
<data name="Microsoft_plugin_timedate_Iso8601ZoneUtc" xml:space="preserve">
<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>
<data name="Microsoft_plugin_timedate_Minute" xml:space="preserve">
<value>Minute</value>
</data>
<data name="Microsoft_plugin_timedate_Month" xml:space="preserve">
<value>Month</value>
</data>
<data name="Microsoft_plugin_timedate_MonthOfYear" xml:space="preserve">
<value>Month of the year</value>
</data>
<data name="Microsoft_plugin_timedate_MonthYear" xml:space="preserve">
<value>Month and year</value>
</data>
<data name="Microsoft_plugin_timedate_Now" xml:space="preserve">
<value>Now</value>
</data>
<data name="Microsoft_plugin_timedate_NowUtc" xml:space="preserve">
<value>Now UTC</value>
<comment>'UTC' means here 'Universal Time Convention'</comment>
</data>
<data name="Microsoft_plugin_timedate_plugin_description" xml:space="preserve">
<value>Provides time and date values in different formats</value>
<comment>Do not translate the placeholders like '{0}' because it will be replaced in code.</comment>
</data>
<data name="Microsoft_plugin_timedate_plugin_description_example_calendarWeek" xml:space="preserve">
<value>Calendar week</value>
</data>
<data name="Microsoft_plugin_timedate_plugin_description_example_day" xml:space="preserve">
<value>Day</value>
</data>
<data name="Microsoft_plugin_timedate_plugin_description_example_time" xml:space="preserve">
<value>Time</value>
</data>
<data name="Microsoft_plugin_timedate_plugin_name" xml:space="preserve">
<value>Time and Date</value>
</data>
<data name="Microsoft_plugin_timedate_Rfc1123" xml:space="preserve">
<value>RFC1123</value>
</data>
<data name="Microsoft_plugin_timedate_SearchTagDate" xml:space="preserve">
<value>Date</value>
<comment>Don't change order</comment>
</data>
<data name="Microsoft_plugin_timedate_SearchTagDateNow" xml:space="preserve">
<value>Current date; Now</value>
<comment>Don't change order</comment>
</data>
<data name="Microsoft_plugin_timedate_SearchTagEra" xml:space="preserve">
<value>Year; Calendar era; Date</value>
<comment>Don't change order</comment>
</data>
<data name="Microsoft_plugin_timedate_SearchTagEraNow" xml:space="preserve">
<value>Current year; Current calendar era; Current date; Now</value>
<comment>Don't change order</comment>
</data>
<data name="Microsoft_plugin_timedate_SearchTagFormat" xml:space="preserve">
<value>Date and time; Time and Date</value>
<comment>Don't change order</comment>
</data>
<data name="Microsoft_plugin_timedate_SearchTagFormatNow" xml:space="preserve">
<value>Current date and time; Current time and date; Now</value>
<comment>Don't change order</comment>
</data>
<data name="Microsoft_plugin_timedate_SearchTagTime" xml:space="preserve">
<value>Time</value>
<comment>Don't change order</comment>
</data>
<data name="Microsoft_plugin_timedate_SearchTagTimeNow" xml:space="preserve">
<value>Current Time; Now</value>
<comment>Don't change order</comment>
</data>
<data name="Microsoft_plugin_timedate_Search_ConjunctionList" xml:space="preserve">
<value>for; and; nor; but; or; so</value>
<comment>List of conjunctions. We don't add 'yet' because this can be a synonym of 'now' which might be problematic on localized searches.</comment>
</data>
<data name="Microsoft_plugin_timedate_Second" xml:space="preserve">
<value>Second</value>
</data>
<data name="Microsoft_plugin_timedate_SettingDateWithWeekday" xml:space="preserve">
<value>Show date with weekday and name of month</value>
</data>
<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>
<data name="Microsoft_plugin_timedate_SettingTimeWithSeconds_Description" xml:space="preserve">
<value>This setting applies to the 'Time' and 'Now' result.</value>
</data>
<data name="Microsoft_plugin_timedate_SubTitleNote" xml:space="preserve">
<value>Select or press Ctrl+C to copy</value>
<comment>'Ctrl+C' is a shortcut</comment>
</data>
<data name="Microsoft_plugin_timedate_Time" xml:space="preserve">
<value>Time</value>
</data>
<data name="Microsoft_plugin_timedate_TimeUtc" xml:space="preserve">
<value>Time UTC</value>
<comment>'UTC' means here 'Universal Time Convention'</comment>
</data>
<data name="Microsoft_plugin_timedate_ToolTipAlternativeSearchTag" xml:space="preserve">
<value>Alternative search tags:</value>
</data>
<data name="Microsoft_plugin_timedate_UniversalTime" xml:space="preserve">
<value>Universal time format: YYYY-MM-DD hh:mm:ss</value>
</data>
<data name="Microsoft_plugin_timedate_Unix" xml:space="preserve">
<value>Unix epoch time</value>
</data>
<data name="Microsoft_plugin_timedate_WeekOfMonth" xml:space="preserve">
<value>Week of the month</value>
</data>
<data name="Microsoft_plugin_timedate_WeekOfYear" xml:space="preserve">
<value>Week of the year (Calendar week, Week number)</value>
</data>
<data name="Microsoft_plugin_timedate_WindowsFileTime" xml:space="preserve">
<value>Windows file time (Int64 number)</value>
</data>
<data name="Microsoft_plugin_timedate_Year" xml:space="preserve">
<value>Year</value>
</data>
<data name="Microsoft_plugin_timedate_Unix_Milliseconds" xml:space="preserve">
<value>Unix epoch time in milliseconds</value>
</data>
<data name="Microsoft_plugin_timedate_SettingFirstDayOfWeek" xml:space="preserve">
<value>First day of the week</value>
</data>
<data name="Microsoft_plugin_timedate_SettingFirstDayOfWeek_Friday" xml:space="preserve">
<value>Friday</value>
</data>
<data name="Microsoft_plugin_timedate_SettingFirstDayOfWeek_Monday" xml:space="preserve">
<value>Monday</value>
</data>
<data name="Microsoft_plugin_timedate_SettingFirstDayOfWeek_Saturday" xml:space="preserve">
<value>Saturday</value>
</data>
<data name="Microsoft_plugin_timedate_SettingFirstDayOfWeek_Sunday" xml:space="preserve">
<value>Sunday</value>
</data>
<data name="Microsoft_plugin_timedate_SettingFirstDayOfWeek_Thursday" xml:space="preserve">
<value>Thursday</value>
</data>
<data name="Microsoft_plugin_timedate_SettingFirstDayOfWeek_Tuesday" xml:space="preserve">
<value>Tuesday</value>
</data>
<data name="Microsoft_plugin_timedate_SettingFirstDayOfWeek_Wednesday" xml:space="preserve">
<value>Wednesday</value>
</data>
<data name="Microsoft_plugin_timedate_SettingFirstWeekRule" xml:space="preserve">
<value>First week of the year</value>
</data>
<data name="Microsoft_plugin_timedate_SettingFirstWeekRule_Description" xml:space="preserve">
<value>Configure the calendar rule for the first week of the year.</value>
</data>
<data name="Microsoft_plugin_timedate_SettingFirstWeekRule_FirstDay" xml:space="preserve">
<value>First day of year</value>
</data>
<data name="Microsoft_plugin_timedate_SettingFirstWeekRule_FirstFourDayWeek" xml:space="preserve">
<value>First four day week</value>
</data>
<data name="Microsoft_plugin_timedate_SettingFirstWeekRule_FirstFullWeek" xml:space="preserve">
<value>First full week</value>
</data>
<data name="Microsoft_plugin_timedate_Setting_UseSystemSetting" xml:space="preserve">
<value>Use system setting</value>
</data>
<data name="Microsoft_plugin_timedate_main_page_name" xml:space="preserve">
<value>Open</value>
</data>
<data name="Microsoft_plugin_timedate_placeholder_text" xml:space="preserve">
<value>Search values or type a custom time stamp...</value>
</data>
<data name="Microsoft_plugin_timedate_InvalidInput_ErrorMessageTitle" xml:space="preserve">
<value>Error: Invalid input</value>
</data>
<data name="Microsoft_plugin_timedate_main_page_title" xml:space="preserve">
<value>Time and Date</value>
</data>
<data name="Microsoft_plugin_timedate_InvalidInput_ErrorMessageSubTitle" xml:space="preserve">
<value>Valid prefixes: 'u' for Unix Timestamp, 'ums' for Unix Timestamp in milliseconds, 'ft' for Windows file time</value>
</data>
</root>

View File

@@ -0,0 +1,48 @@
// Copyright (c) Microsoft Corporation
// The Microsoft Corporation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System;
using System.Globalization;
using System.Text;
using Microsoft.CmdPal.Ext.TimeDate.Helpers;
using Microsoft.CmdPal.Ext.TimeDate.Pages;
using Microsoft.CommandPalette.Extensions;
using Microsoft.CommandPalette.Extensions.Toolkit;
namespace Microsoft.CmdPal.Ext.TimeDate;
public partial class TimeDateCommandsProvider : CommandProvider
{
private readonly CommandItem _command;
private static readonly SettingsManager _settingsManager = new();
private static readonly CompositeFormat MicrosoftPluginTimedatePluginDescription = System.Text.CompositeFormat.Parse(Resources.Microsoft_plugin_timedate_plugin_description);
private static readonly TimeDateExtensionPage _timeDateExtensionPage = new(_settingsManager);
public TimeDateCommandsProvider()
{
DisplayName = Resources.Microsoft_plugin_timedate_plugin_name;
Id = "DateTime";
_command = new CommandItem(_timeDateExtensionPage)
{
Icon = _timeDateExtensionPage.Icon,
Title = Resources.Microsoft_plugin_timedate_plugin_name,
Subtitle = GetTranslatedPluginDescription(),
MoreCommands = [new CommandContextItem(_settingsManager.Settings.SettingsPage)],
};
Icon = _timeDateExtensionPage.Icon;
Settings = _settingsManager.Settings;
}
private string GetTranslatedPluginDescription()
{
// The extra strings for the examples are required for correct translations.
var timeExample = Resources.Microsoft_plugin_timedate_plugin_description_example_time + "::" + DateTime.Now.ToString("T", CultureInfo.CurrentCulture);
var dayExample = Resources.Microsoft_plugin_timedate_plugin_description_example_day + "::" + DateTime.Now.ToString("d", CultureInfo.CurrentCulture);
var calendarWeekExample = Resources.Microsoft_plugin_timedate_plugin_description_example_calendarWeek + "::" + DateTime.Now.ToString("d", CultureInfo.CurrentCulture);
return string.Format(CultureInfo.CurrentCulture, MicrosoftPluginTimedatePluginDescription, Resources.Microsoft_plugin_timedate_plugin_description_example_day, dayExample, timeExample, calendarWeekExample);
}
public override ICommandItem[] TopLevelCommands() => [_command];
}