
Hi, I am working on some calendar GUI thing. And I cannot find a library to operate the "date". Like, when `now <- getZonedTime`, how could I get all the dates of the week. Or when I got `today`, how to get the date of 10 days ago? Thanks. -- 竹密岂妨流水过 山高哪阻野云飞

Magicloud Magiclouds
Hi, I am working on some calendar GUI thing. And I cannot find a library to operate the "date". Like, when `now <- getZonedTime`, how could I get all the dates of the week. Or when I got `today`, how to get the date of 10 days ago?
This sort of thing (given now <- getZonedTime): take 10 $ map (addDays (-1)) $ repeat $ utctDay $ zonedTimeToUTC now there's enough functions in that to be going on with, I think. -- Jón Fairbairn Jon.Fairbairn@cl.cam.ac.uk http://www.chaos.org.uk/~jf/Stuff-I-dont-want.html (updated 2009-01-31)

Bulat Ziganshin
Hello Jon,
Monday, March 2, 2009, 2:22:55 PM, you wrote:
take 10 $ map (addDays (-1)) $ repeat $ utctDay $ zonedTimeToUTC now
take 10 $ iterate (addDays (-1)) $ utctDay $ zonedTimeToUTC now
take anything I post before 14:00 with a pinch of salt. Or something stronger. -- Jón Fairbairn Jon.Fairbairn@cl.cam.ac.uk
participants (3)
-
Bulat Ziganshin
-
Jon Fairbairn
-
Magicloud Magiclouds