Fork me on GitHub
#clojure-europe
<
2020-02-18
>
kardan08:02:03

Good morning

Rachel Westmacott09:02:51

morning europeeps!

agigao09:02:14

დილა მშვიდობის!

otfrom14:02:46

ugh. I hate it when a number of bad records is a power of 2 (32 in this instance) it really makes me worry it is a problem in my code

otfrom15:02:57

heh, hooray for lexicographical sorting and ISO8601 dates

otfrom15:02:02

clojure
(defn birthdate-on-or-before-report-date? [{:strs [report_date DOB]}]
  (let [cmp (compare DOB report_date)]
    (or (neg? cmp) (zero? cmp))))

(comment
  (birthdate-on-or-before-report-date? {"report_date" "2020-01-02" "DOB" "2020-02"})
  false

  (birthdate-on-or-before-report-date? {"report_date" "2020-01-02" "DOB" "2020-01"})
  true
  
  )

otfrom15:02:36

and I'm glad I remembered strs exists

😍 4