-- | Unusual format: 12005 for 01.01.2005, 322005 for 01.02.2005. HolidayServer needs that.
getDateIntFromDayOfYearInt :: Int
                           -> DateInt
getDateIntFromDayOfYearInt d = let year = fromIntegral $ d `mod` 10000
                                   dInYear = fromIntegral $ d `div` 10000
                               in let (_, month, day) = Date.toGregorian . Date.addDays (dInYear-1) $
                                                        Date.fromGregorian year 1 1
                                  in getDateInt (fromIntegral year * 10000 + month * 100 + day)
getDateIntFromDayOfYearInt :: Int
                           -> DateInt
getDateIntFromDayOfYearInt d = let year = fromIntegral $ d `mod` 10000
                                   dInYear = fromIntegral $ d `div` 10000
                               in let (_, month, day) = Date.toGregorian . Date.addDays (dInYear-1) $
                                                        Date.fromGregorian year 1 1
                                  in getDateInt (fromIntegral year * 10000 + month * 100 + day)
getDateIntFromDayOfYearInt d = let year = fromIntegral $ d `mod` 10000
                                   dInYear = fromIntegral $ d `div` 10000
                               in let (_, month, day) = Date.toGregorian . Date.addDays (dInYear-1) $
                                                        Date.fromGregorian year 1 1
                                  in getDateInt (fromIntegral year * 10000 + month * 100 + day)