spencermountain / spacetime

A lightweight javascript timezone library
http://spacetime.how/
Other
3.99k stars 184 forks source link

time() should accept 12-hour times that contain a space before the am/pm suffix #238

Closed coatesap closed 3 years ago

coatesap commented 3 years ago

Currently the time() setter accepts a 12-hour time in the format "6:30pm", however "6:30 pm" fails.

console.log(spacetime().time('6:30 pm').format('nice')) // Nov 11th, 6:30am

Having a space before the am/pm suffix seems fairly common, and therefore should be supported.

Happy to create a PR for this if that is acceptable.

spencermountain commented 3 years ago

👏👏