我收到的日期格式如下:
const momentDate = localDate(date)
return momentDate.format('LL')
这将返回“5 de diciembre de 2023”,我想得到“diciembre 5, 2023”
我怎样才能得到这种格式?
您可以在这里找到答案https://momentjs.com/docs/#/displaying/format/
您可以使用图表来准确确定您想要的格式。
但是,考虑到您可能不想将
moment
添加到任何新项目(如果可以避免的话),基于 https://momentjs.com/docs/#/-project-status/