ToString implemented

main
Erenando 2022-11-07 09:31:44 +01:00
parent 902d5725d9
commit 637f63422d
1 changed files with 11 additions and 3 deletions

View File

@ -17,11 +17,11 @@ type alias Date =
-- 1 Punkt:
year : Date -> Year
--year (a, b, c) = c
year (a,b,c) = c
month : Date -> Month
--month (a,b,c) = b
month (a,b,c) = b
day : Date -> Day
--day (a,b , c) = a
day (a,b,c) = a
-- 1 Punkt:
lt : Date -> Date -> Bool
@ -30,6 +30,14 @@ gt : Date -> Date -> Bool
-- 1 Punkt:
toString : Date -> String
toString (a,b,c) = (if a < 10 then "0" ++ String.fromInt(a) else String.fromInt(a))
++ (if b < 10 then "0" ++ String.fromInt(b) else String.fromInt(b))
++ (if c < 10 then "000" ++ String.fromInt(c)
else if c < 100 then "00" ++ String.fromInt(c)
else if c < 1000 then "0" ++ String.fromInt(c)
else String.fromInt(c))
-- TT.MM.YYYY
-- 2 Punkte:
next : Date -> Date