aboutsummaryrefslogtreecommitdiff
path: root/common/src/Common/View
diff options
context:
space:
mode:
authorJoris2017-11-19 00:20:25 +0100
committerJoris2017-11-19 00:20:25 +0100
commit7194cddb28656c721342c2ef604f9f9fb0692960 (patch)
tree5b8c8562c9a1680aa315b4b7e10a3a7c22900863 /common/src/Common/View
parent42e94a45e26f40edc3ad71b1e77a4bf47c13fd3d (diff)
Show payment count and partition
- Also fixes exceedingPayer in back by using only punctual payments
Diffstat (limited to 'common/src/Common/View')
-rw-r--r--common/src/Common/View/Format.hs35
1 files changed, 16 insertions, 19 deletions
diff --git a/common/src/Common/View/Format.hs b/common/src/Common/View/Format.hs
index 783ad67..0597d17 100644
--- a/common/src/Common/View/Format.hs
+++ b/common/src/Common/View/Format.hs
@@ -1,5 +1,3 @@
-{-# LANGUAGE OverloadedStrings #-}
-
module Common.View.Format
( shortDay
, longDay
@@ -13,13 +11,12 @@ import Data.Text (Text)
import qualified Data.Text as T
import Data.Time.Calendar (Day, toGregorian)
-import qualified Common.Message as Message
-import qualified Common.Message.Key as Key
import Common.Model (Currency (..))
+import qualified Common.Msg as Msg
shortDay :: Day -> Text
shortDay date =
- Message.get $ Key.Date_Short
+ Msg.get $ Msg.Date_Short
day
month
(fromIntegral year)
@@ -27,24 +24,24 @@ shortDay date =
longDay :: Day -> Text
longDay date =
- Message.get $ Key.Date_Long
+ Msg.get $ Msg.Date_Long
day
- (fromMaybe "−" . fmap Message.get . monthToKey $ month)
+ (fromMaybe "−" . fmap Msg.get . monthToKey $ month)
(fromIntegral year)
where (year, month, day) = toGregorian date
- monthToKey 1 = Just Key.Month_January
- monthToKey 2 = Just Key.Month_February
- monthToKey 3 = Just Key.Month_March
- monthToKey 4 = Just Key.Month_April
- monthToKey 5 = Just Key.Month_May
- monthToKey 6 = Just Key.Month_June
- monthToKey 7 = Just Key.Month_July
- monthToKey 8 = Just Key.Month_August
- monthToKey 9 = Just Key.Month_September
- monthToKey 10 = Just Key.Month_October
- monthToKey 11 = Just Key.Month_November
- monthToKey 12 = Just Key.Month_December
+ monthToKey 1 = Just Msg.Month_January
+ monthToKey 2 = Just Msg.Month_February
+ monthToKey 3 = Just Msg.Month_March
+ monthToKey 4 = Just Msg.Month_April
+ monthToKey 5 = Just Msg.Month_May
+ monthToKey 6 = Just Msg.Month_June
+ monthToKey 7 = Just Msg.Month_July
+ monthToKey 8 = Just Msg.Month_August
+ monthToKey 9 = Just Msg.Month_September
+ monthToKey 10 = Just Msg.Month_October
+ monthToKey 11 = Just Msg.Month_November
+ monthToKey 12 = Just Msg.Month_December
monthToKey _ = Nothing
price :: Currency -> Int -> Text