Skip to content

Moment.js-style escaping of literal text in date/time formats #39

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

stefanholzmueller
Copy link

See https://github.com/moment/momentjs.com/blob/master/docs/moment/04-displaying/01-format.md#escaping-characters

P.S.: If anyone knows a neater way to construct a parser for this, I'd be happy to learn about it.

@stefanholzmueller
Copy link
Author

By reading #22 I just realized that one can avoid the string parsing alltogether and use FormatterCommands directly and include a Placeholder with the desired literal text. This is arguably safer and more flexible.

Also, adding escaping would be a breaking change. I don't think this is really needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant