我需要使用date-fns库从月份名称中获取月份索引号。之前我使用的是moment.js,使用moment.js很简单 moment().month('March').format('M');
// Month name will be variableand I don't want to use static dictionary to get index number 如何使用da
在CodeSandbox上的这个示例中,我尝试将日期格式化为dddd, MMMM Do,预期的结果应该是Thursday, January 13th,但实际结果却是0013, January 13th根据这里的date-fns文档,Date-fns format,编写dddd应该会给我返回当天的名称,但我得到的却是0013,我不知道为什么。我需要关于我写日期格式的方式的错误的帮助,