From dd31aa6d4d41176854976a94a83de37c47a89778 Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Mon, 30 Mar 2015 19:33:04 +0900 Subject: implement makeEventsCSV --- src/Utility/EventCache.hs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Utility/EventCache.hs b/src/Utility/EventCache.hs index 58cd2c0..e97cc1b 100644 --- a/src/Utility/EventCache.hs +++ b/src/Utility/EventCache.hs @@ -69,7 +69,12 @@ parseEventsCSV :: String -> [Reminder] parseEventsCSV = undefined makeEventsCSV :: [Reminder] -> String -makeEventsCSV = undefined +makeEventsCSV = unlines . foldr ((:) . makeEventCSV) [] + +makeEventCSV :: Reminder -> String +makeEventCSV r = (show . getReminderHour $ r) ++ "," ++ + (show . getReminderMinute $ r) ++ "," + ++ getReminderText r todaysCacheFileDateString :: IO String todaysCacheFileDateString = showGregorian . utctDay <$> getCurrentTime -- cgit v1.2.3