mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 19:54:57 +08:00
Improved RegEx construction to account for empty 13th month name. Excluded testing for Upper Sorbian (hsb) culture on Windows 8 and later.
This commit is contained in:
@@ -52,6 +52,10 @@ namespace Orchard.Framework.Tests.Localization {
|
||||
IDateFormatter target = new DefaultDateFormatter();
|
||||
var cultures = CultureInfo.GetCultures(CultureTypes.AllCultures);
|
||||
foreach (CultureInfo cultureInfo in cultures) {
|
||||
// Due to a bug in .NET 4.5 in combination with updated Upper Sorbian culture in Windows 8.
|
||||
if (System.Environment.OSVersion.Version.ToString().CompareTo("6.2.0.0") >= 0 && cultureInfo.Name.StartsWith("hsb")) {
|
||||
continue;
|
||||
}
|
||||
DateTime dateTime = new DateTime(2014, 12, 31, 10, 20, 40, 567);
|
||||
cultureInfo.DateTimeFormat.Calendar = new GregorianCalendar();
|
||||
var dateString = dateTime.ToString("G", cultureInfo);
|
||||
|
@@ -97,8 +97,8 @@ namespace Orchard.Framework.Localization.Services {
|
||||
{"ddd", String.Format("(?<day>{0})", String.Join("|", culture.DateTimeFormat.AbbreviatedDayNames))},
|
||||
{"dd", "(?<day>[0-9]{2})"},
|
||||
{"d", "(?<day>[0-9]{1,2})"},
|
||||
{"MMMM", String.Format("(?<month>{0})", String.Join("|", culture.DateTimeFormat.MonthNames))},
|
||||
{"MMM", String.Format("(?<month>{0})", String.Join("|", culture.DateTimeFormat.AbbreviatedMonthNames))},
|
||||
{"MMMM", String.Format("(?<month>{0})", String.Join("|", culture.DateTimeFormat.MonthNames.Where(x => !String.IsNullOrEmpty(x))))},
|
||||
{"MMM", String.Format("(?<month>{0})", String.Join("|", culture.DateTimeFormat.AbbreviatedMonthNames.Where(x => !String.IsNullOrEmpty(x))))},
|
||||
{"MM", "(?<month>[0-9]{2})"},
|
||||
{"M", "(?<month>[0-9]{1,2})"},
|
||||
{"yyyyy", "(?<year>[0-9]{5})"},
|
||||
|
Reference in New Issue
Block a user