Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to skip some characters from formatting in date-fns

In the folowing example I want to say date-fns do not format at (skip these characters):

format(DATE, 'cccc, MMMM d at h:mm a')

Output is:

Thursday, August 8 AM492296400 12:30 AM

Expected is:

Thursday, August 8 at 12:30 AM
like image 786
Iman Mahmoudinasab Avatar asked Sep 06 '19 19:09

Iman Mahmoudinasab


1 Answers

See the documentation:

The characters wrapped between two single quotes characters (') are escaped.

format(DATE, "cccc, MMMM d 'at' h:mm a")
like image 133
str Avatar answered Nov 04 '22 11:11

str