2022年5月28日,星期一,转换为date-fns中的数据对象
在date-fns中,_。格式(new Date(),'eeee,do lll r')
给我2022年5月12日,星期四,现在如何转换日期字符串到date-fns中的日期对象?我尝试了
_。Parse('2022年5月12日,星期四,'eeee,do lll r',new Date())
,它告诉我
> Uncaught RangeError: The format string mustn't contain `do` and `R` at the same time
谢谢
In date-fns, _.format(new Date(), 'EEEE, do LLL R')
gives me Thursday, 12th May 2022
, now how can I convert the date string to a date object in date-fns? I tried _.parse('Thursday, 12th May 2022', 'EEEE, do LLL R', new Date())
, it tells me
> Uncaught RangeError: The format string mustn't contain `do` and `R` at the same time
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论