|
Paul F. Johnson |
6bb2ef1 |
Index: mcs/class/System.Core/System/TimeZoneInfo.cs
|
|
Paul F. Johnson |
6bb2ef1 |
===================================================================
|
|
Paul F. Johnson |
6bb2ef1 |
--- mono-2.6.7/mcs/class/System.Core/System/TimeZoneInfo.cs (revision 160268)
|
|
Paul F. Johnson |
6bb2ef1 |
+++ mono-2.6.7/mcs/class/System.Core/System/TimeZoneInfo.cs (working copy)
|
|
Paul F. Johnson |
6bb2ef1 |
@@ -380,9 +380,22 @@
|
|
Paul F. Johnson |
6bb2ef1 |
else
|
|
Paul F. Johnson |
6bb2ef1 |
ParseRegTzi(adjustmentRules, 1, 9999, reg_tzi);
|
|
Paul F. Johnson |
6bb2ef1 |
|
|
Paul F. Johnson |
6bb2ef1 |
- return CreateCustomTimeZone (id, baseUtcOffset, display_name, standard_name, daylight_name, ValidateRules (adjustmentRules).ToArray ());
|
|
Paul F. Johnson |
6bb2ef1 |
+ return CreateCustomTimeZone (id, baseUtcOffset, display_name, standard_name, daylight_name,
|
|
Paul F. Johnson |
6bb2ef1 |
+ (AdjustmentRule []) ValidateRules (adjustmentRules).ToArray ());
|
|
Paul F. Johnson |
6bb2ef1 |
}
|
|
Paul F. Johnson |
6bb2ef1 |
|
|
Paul F. Johnson |
6bb2ef1 |
+ static List<AdjustmentRule> ValidateRules (List<AdjustmentRule> adjustmentRules)
|
|
Paul F. Johnson |
6bb2ef1 |
+ {
|
|
Paul F. Johnson |
6bb2ef1 |
+ AdjustmentRule prev = null;
|
|
Paul F. Johnson |
6bb2ef1 |
+ foreach (AdjustmentRule current in adjustmentRules.ToArray ()) {
|
|
Paul F. Johnson |
6bb2ef1 |
+ if (prev != null && prev.DateEnd > current.DateStart) {
|
|
Paul F. Johnson |
6bb2ef1 |
+ adjustmentRules.Remove (current);
|
|
Paul F. Johnson |
6bb2ef1 |
+ }
|
|
Paul F. Johnson |
6bb2ef1 |
+ prev = current;
|
|
Paul F. Johnson |
6bb2ef1 |
+ }
|
|
Paul F. Johnson |
6bb2ef1 |
+ return adjustmentRules;
|
|
Paul F. Johnson |
6bb2ef1 |
+ }
|
|
Paul F. Johnson |
6bb2ef1 |
+
|
|
Paul F. Johnson |
6bb2ef1 |
private static void ParseRegTzi (List<AdjustmentRule> adjustmentRules, int start_year, int end_year, byte [] buffer)
|
|
Paul F. Johnson |
6bb2ef1 |
{
|
|
Paul F. Johnson |
6bb2ef1 |
//int standard_bias = BitConverter.ToInt32 (buffer, 4); /* not sure how to handle this */
|
|
Paul F. Johnson |
6bb2ef1 |
@@ -895,22 +908,11 @@
|
|
Paul F. Johnson |
6bb2ef1 |
}
|
|
Paul F. Johnson |
6bb2ef1 |
return CreateCustomTimeZone (id, baseUtcOffset, id, standardDisplayName);
|
|
Paul F. Johnson |
6bb2ef1 |
} else {
|
|
Paul F. Johnson |
6bb2ef1 |
- return CreateCustomTimeZone (id, baseUtcOffset, id, standardDisplayName, daylightDisplayName, ValidateRules (adjustmentRules).ToArray ());
|
|
Paul F. Johnson |
6bb2ef1 |
+ return CreateCustomTimeZone (id, baseUtcOffset, id, standardDisplayName, daylightDisplayName,
|
|
Paul F. Johnson |
6bb2ef1 |
+ (AdjustmentRule []) ValidateRules (adjustmentRules).ToArray ());
|
|
Paul F. Johnson |
6bb2ef1 |
}
|
|
Paul F. Johnson |
6bb2ef1 |
}
|
|
Paul F. Johnson |
6bb2ef1 |
|
|
Paul F. Johnson |
6bb2ef1 |
- static List<AdjustmentRule> ValidateRules (List<AdjustmentRule> adjustmentRules)
|
|
Paul F. Johnson |
6bb2ef1 |
- {
|
|
Paul F. Johnson |
6bb2ef1 |
- AdjustmentRule prev = null;
|
|
Paul F. Johnson |
6bb2ef1 |
- foreach (AdjustmentRule current in adjustmentRules.ToArray ()) {
|
|
Paul F. Johnson |
6bb2ef1 |
- if (prev != null && prev.DateEnd > current.DateStart) {
|
|
Paul F. Johnson |
6bb2ef1 |
- adjustmentRules.Remove (current);
|
|
Paul F. Johnson |
6bb2ef1 |
- }
|
|
Paul F. Johnson |
6bb2ef1 |
- prev = current;
|
|
Paul F. Johnson |
6bb2ef1 |
- }
|
|
Paul F. Johnson |
6bb2ef1 |
- return adjustmentRules;
|
|
Paul F. Johnson |
6bb2ef1 |
- }
|
|
Paul F. Johnson |
6bb2ef1 |
-
|
|
Paul F. Johnson |
6bb2ef1 |
static Dictionary<int, string> ParseAbbreviations (byte [] buffer, int index, int count)
|
|
Paul F. Johnson |
6bb2ef1 |
{
|
|
Paul F. Johnson |
6bb2ef1 |
var abbrevs = new Dictionary<int, string> ();
|