【发布时间】:2021-02-16 06:56:00
【问题描述】:
我正在尝试使用 React-big-calendar 显示事件。我的时间格式有问题。我在将事件传递给日历时使用的数据如下:
{
end: Tue Nov 03 2020 21:42:16 GMT+0100 (Central European Standard Time)
start: Tue Nov 03 2020 20:42:06 GMT+0100 (Central European Standard Time)
}
结果出乎意料。图书馆将我的时间格式视为 12 小时格式:
我还注意到日历中的current 时间值错误。我使用date-fns 作为带有波兰语locale 的定位器。我还在使用 culture 属性作为日历组件。这是我的组件 - https://github.com/sSwiergosz/fitness-platform/blob/develop/frontend/components/Calendar.js
我没有想法......有人可以帮助我吗?
【问题讨论】:
-
不明白为什么这个问题被否决了......我正在根据文档做所有事情并提供完整的代码示例
标签: reactjs calendar react-big-calendar date-fns