~pepe/neil

d6e4cbb6bb03d1d9cf4e1ccecbd0ad34ce92b94e — Josef Pospíšil a month ago e0f9ffd
Format stats
1 files changed, 23 insertions(+), 23 deletions(-)

M neil/watch/stats/init.janet
M neil/watch/stats/init.janet => neil/watch/stats/init.janet +23 -23
@@ 20,43 20,43 @@
      (case i
        "today"
        (utils/loop-tasks (worked-tasks brush project state (:epoch (today)))
                                (>= (w :start) (:epoch (today)))
                                clients projects)
                          (>= (w :start) (:epoch (today)))
                          clients projects)
        "yesterday"
        (utils/loop-tasks (worked-tasks brush project state (:epoch (yesterday)) (:epoch (today)))
                                (and
                                  (>= (w :start) (:epoch (yesterday)))
                                  (<= (w :end) (:epoch (today))))
                                clients projects)
                          (and
                            (>= (w :start) (:epoch (yesterday)))
                            (<= (w :end) (:epoch (today))))
                          clients projects)
        "current-week"
        (utils/loop-tasks (worked-tasks brush project state (:epoch (current-week-start)))
                                (>= (w :start) (:epoch (current-week-start)))
                                clients projects)
                          (>= (w :start) (:epoch (current-week-start)))
                          clients projects)
        "last-week"
        (utils/loop-tasks (worked-tasks brush project state (:epoch (last-week-start)) (:epoch (current-week-start)))
                                (and
                                  (>= (w :start) (:epoch (last-week-start)))
                                  (<= (w :end) (:epoch (current-week-start))))
                                clients projects)
                          (and
                            (>= (w :start) (:epoch (last-week-start)))
                            (<= (w :end) (:epoch (current-week-start))))
                          clients projects)
        "current-month"
        (utils/loop-tasks (worked-tasks brush project state (:epoch (current-month-start)))
                                (>= (w :start) (:epoch (current-month-start)))
                                clients projects)
                          (>= (w :start) (:epoch (current-month-start)))
                          clients projects)
        "last-month"
        (utils/loop-tasks (worked-tasks brush project state (:epoch (last-month-start)) (:epoch (current-month-start)))
                                (and
                                  (>= (w :start) (:epoch (last-month-start)))
                                  (<= (w :end) (:epoch (current-month-start))))
                                clients projects)
                          (and
                            (>= (w :start) (:epoch (last-month-start)))
                            (<= (w :end) (:epoch (current-month-start))))
                          clients projects)
        "current-year"
        (utils/loop-tasks (worked-tasks brush project state (:epoch (current-year-start)))
                                (>= (w :start) (:epoch (current-year-start)))
                                clients projects)
                          (>= (w :start) (:epoch (current-year-start)))
                          clients projects)
        "last-year"
        (utils/loop-tasks (worked-tasks brush project state (:epoch (start-of-year 1)) (:epoch (current-year-start)))
                                (and (>= (w :start) (:epoch (start-of-year 1)))
                                     (<= (w :end) (:epoch (current-year-start))))
                                clients projects)))))
                          (and (>= (w :start) (:epoch (start-of-year 1)))
                               (<= (w :end) (:epoch (current-year-start))))
                          clients projects)))))

(defn filter [brush]
  (fn [{:body body}]