aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Date.hs7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/Date.hs b/src/Date.hs
index 6660f24..8ab9fd2 100644
--- a/src/Date.hs
+++ b/src/Date.hs
@@ -24,7 +24,10 @@ getCurrentDate = do
return $ Date d m (fromIntegral y)
sameDayAndMonth :: Date -> Date -> Bool
-sameDayAndMonth (Date d1 m1 _) (Date d2 m2 _) = m1 == m2 && d1 == d2
+sameDayAndMonth d1 d2 =
+ ( day d1 == day d2
+ && month d1 == month d2
+ )
yearsGap :: Date -> Date -> Int
-yearsGap (Date _ _ y1) (Date _ _ y2) = abs (y2 - y1)
+yearsGap d1 d2 = abs (year d2 - year d1)