Created
April 12, 2018 20:45
-
-
Save danielef/2c22d7a7b55cedbb006efd48cca9d4f8 to your computer and use it in GitHub Desktop.
IWRobot / Da un rango de fecha de entre 2 semanas y hoy
This file contains hidden or 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
(fn [ctx] | |
(letfn [(two-weeks [] | |
(let [now (java.util.Calendar/getInstance) | |
dis -15] | |
(-> (doto now | |
(.add java.util.Calendar/DATE dis)) | |
.getTime)))] | |
(let [fmt (java.text.SimpleDateFormat. "yyyy-MM-dd")] | |
(str (-> fmt (.format (two-weeks))) | |
"," | |
(-> fmt (.format (java.util.Date.))))))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment