在下面的示例中,我想说 date-fns 不格式化 at
(跳过这些字符):
format(DATE, 'cccc, MMMM d at h:mm a')
输出是:
Thursday, August 8 AM492296400 12:30 AM
预期是:
Thursday, August 8 at 12:30 AM
最佳答案
参见 documentation :
The characters wrapped between two single quotes characters (') are escaped.
format(DATE, "cccc, MMMM d 'at' h:mm a")
关于javascript - 如何在 date-fns 中跳过格式化中的某些字符,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57827498/