From 09d822d47218141bf655d40a6f6f0395cfae69f0 Mon Sep 17 00:00:00 2001 From: Joris Date: Sun, 22 Nov 2015 12:15:41 +0100 Subject: Validate birthdates and show an error message if there are invalid ones --- src/Model/Mail.hs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/Model/Mail.hs') 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 "" ] -- cgit v1.2.3