Support specifying case-sensitivity in formatter
shaolang opened this issue · 3 comments
shaolang commented
Running the following in JDK11 returns the local time correctly:
(def fmt (java-time/formatter "hh:mma"))
(java-time/local-time fmt "12:34AM")But JDK14 throws an exception Text '12:34AM' could not be parsed at index 5.
java.time.DateTimeFormatterBuilder has two methods parseCaseSensitive and parseCaseInsensitive. Option map for formatter could be extended to accept another key :case with values :sensitive or :insensitive.
If that's acceptable, I can submit a pull request to implement this.
dm3 commented
Sure, that would be great!
shaolang commented
Which of the following would you prefer for the option map?
:case :insensitive(and default is:sensitive):insensitive true(and default is false):sensitive false(and default is true)
dm3 commented
I think :case (:sensitive|:insensitive) would be best.