]> Git — Sourcephile - comptalang.git/blob - lib/Hcompta/Model/Date.hs
Ajout : Format.Ledger.Read : account, amount
[comptalang.git] / lib / Hcompta / Model / Date.hs
1 {-# LANGUAGE DeriveDataTypeable #-}
2 module Hcompta.Model.Date where
3
4 import Data.Data
5 import qualified Data.Time.Calendar as Time (Day)
6 import qualified Data.Time.Clock as Time (UTCTime)
7 import qualified Data.Time.Format as Time ()
8 import qualified Data.Time.Clock.POSIX as Time (posixSecondsToUTCTime)
9 import Data.Typeable ()
10
11 -- * The 'Date' type
12
13 type Date
14 = Time.UTCTime
15
16 nil :: Date
17 nil = Time.posixSecondsToUTCTime 0
18
19 data Interval
20 = Interval_None
21 | Interval_Days Int
22 | Interval_Weeks Int
23 | Interval_Months Int
24 | Interval_Quarters Int
25 | Interval_Years Int
26 | Interval_DayOfMonth Int
27 | Interval_DayOfWeek Int
28 -- Interval_WeekOfYear Int
29 -- Interval_MonthOfYear Int
30 -- Interval_QuarterOfYear Int
31 deriving (Data, Eq, Ord, Read, Show, Typeable)
32
33 type Smart
34 = (String, String, String)
35
36 data Span
37 = Span (Maybe Time.Day) (Maybe Time.Day)
38 deriving (Data, Eq, Ord, Read, Show, Typeable)
39
40 data Which
41 = Which_Primary
42 | Which_Secondary
43 deriving (Eq, Read, Show)
44
45 type Year
46 = Integer