简体   繁体   English

如何从date-fns格式中跳过某些字符

[英]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): 在下面的示例中,我想说date-fns的格式不at (跳过这些字符):

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

See the documentation : 请参阅文档

The characters wrapped between two single quotes characters (') are escaped. 包装在两个单引号字符(')之间的字符被转义。

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM