Skip to content

Instantly share code, notes, and snippets.

@kureikei
Created Oct 23, 2014
Embed
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
(concat
(repeat (dec day-of-week) " ")
(map (partial format "%2d") (range 1 (inc last-date)))))
(doseq
[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