MadMG / moment-jdateformatparser

Translates the `java.text.SimpleDateFormat` date format to the `moment.js` date format.
MIT License
58 stars 29 forks source link

adds ability to translate formats that contain escape characters #19

Closed arikimolloy closed 7 years ago

arikimolloy commented 7 years ago

https://github.com/MadMG/moment-jdateformatparser/issues/7#issuecomment-252155592

arikimolloy commented 7 years ago

Doesn't work for escaping single quotes themselves.

E.g. "hh 'o''clock' a, zzzz" is supposed to display as "12 o'clock PM, Pacific Daylight Time"

but escaping the single quote in o'clock fails.

However, this fix will work on escaping other characters e.g. "ddHHmm'Z'MMMyyyy" will display as "062000ZMay2036"

Tests should also be added.

herom commented 7 years ago

Thanks a lot for your contribution @arikimolloy but could you please revert all other changes which are not related to the added functionality itself? This type of PR makes it really cumbersome and in later stages nearly impossible to tell what was really added, as you basically re-arranged the whole file. 😄

arikimolloy commented 7 years ago

My bad I think it was my formatter. Now it should only show the actually changed code.

herom commented 7 years ago

Awesome - thanks a ton @arikimolloy 👍

LGTM - what about you @MadMG, are you ok with that?

MadMG commented 7 years ago

@herom sorry for the late repsonse.... 👍