You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

求助:@fullcalendar/react中formatDate导出未找到编译错误

解决FullCalendar中formatDate导出找不到的问题
  • 针对FullCalendar v6+版本
    从v6开始,formatDate的导出位置变更为@fullcalendar/common,正确操作:

    1. 修改导入语句:
      import { formatDate } from '@fullcalendar/common';
      
    2. 调用方式保持函数形式:
      {formatDate(event.start, {
        year: "numeric",
        month: "short",
        day: "numeric"
      })}
      
  • 针对FullCalendar v5版本
    v5中formatDate在@fullcalendar/core中导出,直接导入即可:

    import { formatDate } from '@fullcalendar/core';
    

    调用方式同上。

  • 关键注意事项
    确保所有FullCalendar相关依赖包版本完全一致,比如@fullcalendar/react、@fullcalendar/core、@fullcalendar/common的版本号必须相同,避免混合不同大版本导致的导出不兼容问题。

内容的提问来源于stack exchange,提问作者codesmith

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.24 14:52:01