Skip to content

Instantly share code, notes, and snippets.

@kureikei
Created October 23, 2014 12:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kureikei/e99909251a35e6f16f8a to your computer and use it in GitHub Desktop.
Save kureikei/e99909251a35e6f16f8a to your computer and use it in GitHub Desktop.
(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