aboutsummaryrefslogtreecommitdiff
path: root/src/Model/Mail.hs
diff options
context:
space:
mode:
authorJoris2015-11-22 12:15:41 +0100
committerJoris2015-11-22 12:15:41 +0100
commit09d822d47218141bf655d40a6f6f0395cfae69f0 (patch)
tree586785adc2bdb3073506eba25b1560f2f9af9986 /src/Model/Mail.hs
parent75e3bb69a3fec4be8850833da5cd11bbabcd99b7 (diff)
downloadevents-09d822d47218141bf655d40a6f6f0395cfae69f0.tar.gz
events-09d822d47218141bf655d40a6f6f0395cfae69f0.tar.bz2
events-09d822d47218141bf655d40a6f6f0395cfae69f0.zip
Validate birthdates and show an error message if there are invalid ones
Diffstat (limited to 'src/Model/Mail.hs')
-rw-r--r--src/Model/Mail.hs5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/Model/Mail.hs b/src/Model/Mail.hs
index 19ebaeb..2ae8df4 100644
--- a/src/Model/Mail.hs
+++ b/src/Model/Mail.hs
@@ -97,7 +97,10 @@ mailBodyPart event currDate (line, birthdate) =
""
, fullname birthdate
, if event == Today then " is " else " will be "
- , T.pack . show $ age currDate birthdate
+ , T.pack . show $
+ if event == Today
+ then age currDate birthdate
+ else ageNextWeek currDate birthdate
, " years old"
, if line == SingleLine || line == LastLine then "." else ""
]