I want to insert a single quote character before year.
format(parseISO(date), "dd MMM '\''yy");
this does not seem to work. According to date-fns documentation, to add characters, we need to include them between two single quotes. I get the output for the above code as 06 Apr 'yy
whereas the expected output is 06 Apr '20
.
How can I add single quote character in format function of date-fns?
1.9k views Asked by Fenil Shah At
1
From the documentation:
The last example shows how to do it:
So in your case it should be: