Luxon: Escaping single quote

Created on 19 Jan 2020  路  5Comments  路  Source: moment/luxon

How can I escape a single quote (')?
I want to output a date in the format May 15 '19 but using the string MMM d '''yy outputs May 15 yy
Am I missing something?

enhancement

Most helpful comment

This looks more like a bug to me than an enhancement.. it's an incorrect parsing of the input.

All 5 comments

We don't currently have a way to escape these

This looks more like a bug to me than an enhancement.. it's an incorrect parsing of the input.

When it comes to certain things, sometimes its best to stick to a certain way.,. add support for \ to escape or just use moments approach... '[' until ']'... 馃槮

P.S. also need a similar formatting of dd MMM 'yy

Semi annoying workable solution though
.toFormat(format.replace("'", "'|'")).replace("|", "'");

We ended up using this symbol: LLL鈥檡y

Was this page helpful?
0 / 5 - 0 ratings