summaryrefslogtreecommitdiff
path: root/src/Index.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Index.hs')
-rw-r--r--src/Index.hs5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/Index.hs b/src/Index.hs
index ee3cdaf..aaf0a81 100644
--- a/src/Index.hs
+++ b/src/Index.hs
@@ -18,6 +18,7 @@ module Index (
indexGetEventsDay,
indexNumEvents,
indexCalendar,
+ indexFileForDay,
) where
import Control.Applicative (empty)
@@ -487,6 +488,10 @@ indexGetEventsDay index@(Index _ mp _) chan kind day = do
in (firstlast, events')
Nothing -> (firstlast, []) -- if the file doesn't exist, there ain't no events
+indexFileForDay :: Index -> Channel -> Day -> FilePath
+indexFileForDay (Index basedir _ _) (Channel network channel) day =
+ basedir </> T.unpack network </> T.unpack channel </> toFileName (dayToYMD day)
+
-- utilities
loadDay :: Index -> Channel -> YMD -> IO (Maybe RawEvents)