andrewmcveigh / cljs-time

A clj-time inspired date library for clojurescript.
342 stars 57 forks source link

Comparing using `<` and `>` #123

Closed vikeri closed 6 years ago

vikeri commented 6 years ago

I have never seen any error when comparing things using cljs.core/> or < but I vaguely remember that one should use before? and after? instead. Why is this?

andrewmcveigh commented 6 years ago

If you are using (require 'cljs-time.extend), then < and > should work just like before? and after?. Otherwise, you're relying on the underlying implementation of goog.date and javascript's < and > to provide ordering which may or may not be OK.