so far the fns for retrieving data regarding days and months for current year
(ns funicular.time
(:require [clj-time.predicates :as p]
[clj-time.core :as t]))
(defn now []
(t/now))
(t/day-of-week (now))
(t/plus (t/date-time 2016 1 1) (t/days 1))
(p/sunday? (now))months are integers indexed from 1 to 12 years are common years integers
(defn days-in-month [year month]
(t/number-of-days-in-the-month year month))
(days-in-month 2016 12)(defn sundays [year month]
(let [limit (t/number-of-days-in-the-month year month)]
(filter some? (for [a (range 1 limit)]
(when (p/sunday? (t/date-time year month a))
a)))))
(sundays 2016 12)#'funicular.time/days-in-month31
(now)
#object[org.joda.time.DateTime 0x679b5045 "2016-09-19T09:52:21.122Z"]