1 {-# LANGUAGE DeriveDataTypeable #-}
2 {-# LANGUAGE StandaloneDeriving #-}
3 {-# LANGUAGE TypeSynonymInstances #-}
4 {-# OPTIONS_GHC -fno-warn-orphans #-}
5 module Hcompta.Model.Date where
8 import qualified Data.Time.LocalTime as Time (ZonedTime(..), utc, utcToZonedTime, zonedTimeToUTC)
9 import qualified Data.Time.Calendar as Time (Day)
10 import qualified Data.Time.Format as Time ()
11 import qualified Data.Time.Clock.POSIX as Time (posixSecondsToUTCTime)
12 import qualified Data.Time.Clock as Time (UTCTime)
13 import Data.Typeable ()
19 deriving instance Eq Date
22 nil = Time.utcToZonedTime Time.utc $ Time.posixSecondsToUTCTime 0
29 | Interval_Quarters Int
31 | Interval_DayOfMonth Int
32 | Interval_DayOfWeek Int
33 -- Interval_WeekOfYear Int
34 -- Interval_MonthOfYear Int
35 -- Interval_QuarterOfYear Int
36 deriving (Data, Eq, Ord, Read, Show, Typeable)
39 = (String, String, String)
42 = Span (Maybe Time.Day) (Maybe Time.Day)
43 deriving (Data, Eq, Ord, Read, Show, Typeable)
48 deriving (Eq, Read, Show)
55 type UTC = Time.UTCTime
58 to_UTC = Time.zonedTimeToUTC