diff options
author | Joris | 2015-11-22 12:15:41 +0100 |
---|---|---|
committer | Joris | 2015-11-22 12:15:41 +0100 |
commit | 09d822d47218141bf655d40a6f6f0395cfae69f0 (patch) | |
tree | 586785adc2bdb3073506eba25b1560f2f9af9986 /src/Model/Mail.hs | |
parent | 75e3bb69a3fec4be8850833da5cd11bbabcd99b7 (diff) |
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.hs | 5 |
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 "" ] |