【发布时间】:2021-09-30 00:24:09
【问题描述】:
我正在 ReactJS 上用葡萄牙语制作日历。
尽管很简单,但我无法将我的图书馆日期“moment.js”更改为葡萄牙语(巴西)。
已经尝试过的代码:
<strong>{moment(currentDate).locale('pt-br').format('LLLL')}</strong>
但我不工作,它一直用英文显示日期。
1:
这是日期格式代码:
const [currentDate, setCurrentDate] = useState(new Date())
<Col>
<strong>{moment(currentDate).format('LLLL')}</strong>
</Col>
如何让日期停留在葡萄牙语(巴西)?
【问题讨论】:
-
相关,也许会有所帮助:stackoverflow.com/questions/28110282/…
-
@squillman 没有帮助,伤心。