Skip to content

Instantly share code, notes, and snippets.

Created Oct 23, 2014
What would you like to do?
(import 'java.util.Calendar)
(def firstday (doto (Calendar/getInstance) (.set Calendar/DATE 1)))
(def day-of-week (.get firstday Calendar/DAY_OF_WEEK))
(def last-date (.getMaximum firstday Calendar/DATE))
(def dates
(repeat (dec day-of-week) " ")
(map (partial format "%2d") (range 1 (inc last-date)))))
[week (map (partial clojure.string/join " ") (partition-all 7 dates))]
(println week))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment