diff options
author | Sean Whitton <spwhitton@spwhitton.name> | 2015-03-30 19:33:04 +0900 |
---|---|---|
committer | Sean Whitton <spwhitton@spwhitton.name> | 2015-03-30 19:33:04 +0900 |
commit | dd31aa6d4d41176854976a94a83de37c47a89778 (patch) | |
tree | 5e293aa7c2dbe1c9866f217f7132fb849e5ff826 | |
parent | 39057cadcee537a58011a6b0ac623c93b412c87e (diff) | |
download | srem-dd31aa6d4d41176854976a94a83de37c47a89778.tar.gz |
implement makeEventsCSV
-rw-r--r-- | src/Utility/EventCache.hs | 7 |
1 files changed, 6 insertions, 1 deletions
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 |