ToString implemented
parent
902d5725d9
commit
637f63422d
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue