Allow interpolating variables like $date and expressions like (year $date) in strings

Issue #11 new
utapyngo created an issue

It would be great if arbtt could produce statistics by day, week, month, and year, using rules like these:

tag $date,
tag (year $date),
tag (month $date), -- should be more elaborate expression to show "January 2014"
tag (week $date), -- same as above, should look like "Week 10 of 2014"

Comments (2)

  1. Maciej ┼╗uk

    i made change myself which suited my needs, maybe it will help:

    --- Categorize.hs   2014-09-08 21:47:00.000000000 +0200
    +++ Categorize.hs   2014-11-07 12:31:17.000000000 +0100
    @@ -523,6 +523,8 @@
                     return p
     getVar "desktop" ctx = do
                     return $ cDesktop (tlData (cNow ctx))
    +getVar "date" ctx = do
    +                return (T.pack (formatTime defaultTimeLocale (iso8601DateFormat Nothing) (tlTime (cNow ctx))))
     getVar v ctx = error $ "Unknown variable " ++ v
    
     getNumVar :: String -> CtxFun Integer
    
  2. Log in to comment