git.iko.soy/typeable/timezone-olson
on master help sign in
Fix initial bugs in rendering TimeZoneSeries.
commitc2bc3a15c3454ec92ff7a046f58f076db2ccc4f2 authorYitzchak Gale <gale@sefer.org> dateMon 17 May 2010, 17:59 (16 years ago) parentddc8ac3
2 files changed+3−3
Data/Time/LocalTime/TimeZone/Olson/Render.hs+2−2 Data/Time/LocalTime/TimeZone/Olson/Types.hs+1−1
Data/Time/LocalTime/TimeZone/Olson/Render.hs+2−2
@@ -62,7 +62,7 @@ timeZoneSeriesToOlson (TimeZoneSeries dflt pairs)
6262 | otherwise = Just $
6363 OlsonData
6464 [Transition secs ttinfo |
65− (t, tzs) <- pairs,
65+ (t, tzs) <- reverse pairs,
6666 let secs = round $ utcTimeToPOSIXSeconds t,
6767 ttinfo <- maybeToList $ lookup (mkTT tzs) ttAssocs]
6868 ttinfos
@@ -73,7 +73,7 @@ timeZoneSeriesToOlson (TimeZoneSeries dflt pairs)
7373 TtInfo (offset*60) issdst Wall abbr
7474 dfltTT = mkTT dflt
7575 ttAssocs = (dfltTT, 0) :
76− zip (filter (/= dfltTT) $ map (mkTT . snd) pairs) [1..]
76+ zip (uniq . sort . filter (/= dfltTT) $ map (mkTT . snd) pairs) [1..]
7777 ttinfos = map fst ttAssocs
7878
7979-- | Render Olson timezone data as a binary Olson timezone file
Data/Time/LocalTime/TimeZone/Olson/Types.hs+1−1
@@ -97,7 +97,7 @@ data TtInfo abbr =
9797 tt_ttype :: TransitionType,
9898 tt_abbr :: abbr -- ^ The timezone abbreviation string.
9999 }
100− deriving (Eq, Show)
100+ deriving (Eq, Ord, Show)
101101
102102-- | Olson timezone files can contain leap second specifications, though
103103-- the official files have not done so since the late 1980s.