aboutsummaryrefslogtreecommitdiff
path: root/src/Birthdate.hs
diff options
context:
space:
mode:
authorJoris2015-11-21 21:41:38 +0100
committerJoris2015-11-21 21:41:38 +0100
commit5375ad26dd78220185f1ffe05222250c06dc1a0c (patch)
tree30998d4fe19206e8c5c9e564db116d2022e5e313 /src/Birthdate.hs
parent7acd7a42f7663aa79d18e24bdb9fe19bf15f8fae (diff)
downloadevents-5375ad26dd78220185f1ffe05222250c06dc1a0c.tar.gz
events-5375ad26dd78220185f1ffe05222250c06dc1a0c.tar.bz2
events-5375ad26dd78220185f1ffe05222250c06dc1a0c.zip
Get next week birthdays and send an empty mail for the moment
Diffstat (limited to 'src/Birthdate.hs')
-rw-r--r--src/Birthdate.hs37
1 files changed, 0 insertions, 37 deletions
diff --git a/src/Birthdate.hs b/src/Birthdate.hs
deleted file mode 100644
index 48d3a4e..0000000
--- a/src/Birthdate.hs
+++ /dev/null
@@ -1,37 +0,0 @@
-{-# LANGUAGE OverloadedStrings #-}
-
-module Birthdate
- ( Birthdate(..)
- , fullname
- , age
- , filterBirthdayAt
- ) where
-
-import Data.Text (Text)
-import qualified Data.Text as T
-
-import Date
-
-data Birthdate = Birthdate
- { date :: Date
- , firstname :: Text
- , lastname :: Text
- } deriving (Eq, Show)
-
-fullname :: Birthdate -> Text
-fullname d = T.concat [firstname d, " ", lastname d]
-
-age :: Date -> Birthdate -> Int
-age currentDate birthdate = yearsGap currentDate (date birthdate)
-
-filterBirthdayAt :: Date -> [Birthdate] -> [Birthdate]
-filterBirthdayAt d = filter (sameDayAndMonth d . date)
-
-filterBirthdayBetween :: Date -> Date -> [Birthdate] -> [Birthdate]
-filterBirthdayBetween begin end =
- filter (\bd ->
- let d = date bd
- in ( d `isAfterOrEqualDayAndMonth` begin
- && d `isBeforeOrEqualDayAndMonth` end
- )
- )