diff --git a/src/Orchard.Tests/Localization/DefaultDateFormatterTests.cs b/src/Orchard.Tests/Localization/DefaultDateFormatterTests.cs index becaec934..22d9d956a 100644 --- a/src/Orchard.Tests/Localization/DefaultDateFormatterTests.cs +++ b/src/Orchard.Tests/Localization/DefaultDateFormatterTests.cs @@ -218,7 +218,7 @@ namespace Orchard.Framework.Tests.Localization { } private DateParts GetExpectedDateParts(DateTime date, string format) { - var formatWithoutLiterals = Regex.Replace(format, @"((? String.Format("(.{{{0}}})", m.Value.Replace("\\", "").Length - 2)); + //result = Regex.Replace(result, @"(? EscapeForRegex(m.Value.Trim('\'', '"'))); + result = Regex.Replace(result, @"(? String.Format("(?:.{{{0}}})", m.Value.Replace("\\", "").Length - 2)); // Transform all DateTime format specifiers into corresponding Regex captures. result = result.ReplaceAll(replacements); diff --git a/src/Orchard/Localization/Services/IDateLocalizationServices.txt b/src/Orchard/Localization/Services/IDateLocalizationServices.txt index 2413a98f9..f39c2f303 100644 --- a/src/Orchard/Localization/Services/IDateLocalizationServices.txt +++ b/src/Orchard/Localization/Services/IDateLocalizationServices.txt @@ -42,9 +42,7 @@ struct DateLocalizationOptions { TODO: * Test for proper handling of fraction (f) format specifier - suspect it does not work properly in current state - * Literal parts in format strings should be transformed to corresponding literal in Regex, not just into a wildcard, otherwise the resulting wildcard in some cases will match subsequent non-literal parts of the date/time string. * Rewrite DefaultDateLocalizationServices * Write unit tests for DefaultDateLocalizationServices * Add warning message when saving unsupported combination in settings * Add support for the different Gregorian calendar types - * User ICultureManager and ICultureRepository to get the current CultureInfo in other classes \ No newline at end of file