aboutsummaryrefslogtreecommitdiff
path: root/src/Model/Birthdate.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Model/Birthdate.hs')
-rw-r--r--src/Model/Birthdate.hs6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/Model/Birthdate.hs b/src/Model/Birthdate.hs
index d135419..32bd6a4 100644
--- a/src/Model/Birthdate.hs
+++ b/src/Model/Birthdate.hs
@@ -25,6 +25,10 @@ fullname d = T.concat [firstname d, " ", lastname d]
age :: Date -> Birthdate -> Int
age currentDate birthdate = yearsGap currentDate (date birthdate)
+ageNextWeek :: Date -> Birthdate -> Int
+ageNextWeek currentDate birthdate =
+ (+1) $ (daysGap currentDate (date birthdate)) `div` 365
+
filterBirthdayAt :: Date -> [Birthdate] -> [Birthdate]
filterBirthdayAt d = filter (sameDayAndMonth d . date)
@@ -32,7 +36,7 @@ filterBirthdayBetween :: Date -> Date -> [Birthdate] -> [Birthdate]
filterBirthdayBetween begin end =
filter (\bd ->
let d = date bd
- in ( d `isAfterOrEqualDayAndMonth` begin
+ in ( begin `isBeforeOrEqualDayAndMonth` d
&& d `isBeforeOrEqualDayAndMonth` end
)
)