-
-
Save kureikei/e99909251a35e6f16f8a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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