diff options
Diffstat (limited to 'src/Model/Birthdate.hs')
-rw-r--r-- | src/Model/Birthdate.hs | 6 |
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 ) ) |