Skip to content

Instantly share code, notes, and snippets.

@danielef
Created April 12, 2018 20:45
Show Gist options
  • Save danielef/2c22d7a7b55cedbb006efd48cca9d4f8 to your computer and use it in GitHub Desktop.
Save danielef/2c22d7a7b55cedbb006efd48cca9d4f8 to your computer and use it in GitHub Desktop.
IWRobot / Da un rango de fecha de entre 2 semanas y hoy
(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