Skip to content

Commit

Permalink
Merge branch '1.9.x' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
DaRosenberg committed Aug 16, 2015
2 parents 9429ad6 + f19b57c commit 1b55f42
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/Orchard.Tests/Localization/DefaultDateFormatterTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -327,9 +327,16 @@ public void ParseTimeTest01() {
var container = TestHelpers.InitializeContainer(culture.Name, null, TimeZoneInfo.Utc);
var formats = container.Resolve<IDateTimeFormatProvider>();
var target = container.Resolve<IDateFormatter>();
var hoursToTest = Enumerable.Range(0, 23);

// Fix for some cultures on Windows 10 where both designators for some reason
// are empty strings. A 24-hour time cannot possibly be round-tripped without any
// way to distinguish AM from PM, so for these cases test only 12-hour time.
if (culture.DateTimeFormat.AMDesignator == culture.DateTimeFormat.PMDesignator)
hoursToTest = Enumerable.Range(1, 12);

foreach (var timeFormat in formats.AllTimeFormats) { // All time formats supported by the culture.
for (var hour = 0; hour <= 23; hour++) { // All hours in the day.
foreach (var hour in hoursToTest) { // All hours in the day.

DateTime time = new DateTime(1998, 1, 1, hour, 30, 30);
var timeString = time.ToString(timeFormat, culture);
Expand Down

0 comments on commit 1b55f42

Please sign in to comment.