javascript - FullCalendar 不显示日期时间

标签 javascript node.js fullcalendar sails.js

尝试将 FullCalendar v3.9.0 与 SailsJS 结合使用。使用 jQuery v3.2.1。 MomentJS 和 jQuery 在 fullcalendar 之前加载。这是我当前的 FullCalendar 代码。

$('#calendar').fullCalendar({
  header: {
    left: 'today prev,next',
    center: 'title',
    right: 'agendaWeek,agendaDay'
  },
  views: {
    week: {
      titleFormat: 'DD.MM.YYYY'
    }
  },
  defaultView: 'agendaWeek',
  locale: 'fi',
  weekends: true,
  events: [
    {
      title: 'Event 1',
      start: '2018-06-25T15:00+03:00'
    },
    {
      title: 'Event 2',
      start: '2018-06-26T12:00+03:00'
    }
  ],
  editable: true,
  selectable: true,
});

然而,结果看起来像这样。 https://i.imgur.com/AIm5k9n.png

每行的日期时间丢失。标题两侧的按钮也丢失了。

最佳答案

从屏幕截图来看,您似乎使用的是 FullCalendar 提供的打印 CSS,而不是浏览器 CSS。

如果您已包含这两个文件,请确保在 print.css 文件上正确设置媒体查询,以便仅在打印页面时使用它。例如:

<link href='fullcalendar.min.css' rel='stylesheet' />
<link href='fullcalendar.print.min.css' rel='stylesheet' media='print' />

确保“print”文件中存在 media='print',如上面的示例所示。

参见https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link对于语法,和 https://developer.mozilla.org/en-US/docs/Web/CSS/Media_Queries/Using_media_queries有关一般媒体查询的信息。

关于javascript - FullCalendar 不显示日期时间,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51057296/

相关文章:

javascript - 我可以从日历外部触发 eventClick 吗?

javascript - 范围值未显示在 View 中

node.js - 亚马逊 EC2 Ubuntu 实例 : Where should I upload the files to access them from the browser?

javascript - 我无法将字符串转换为 JavaScript 对象

fullcalendar - 启动计划事件的工具提示

jquery - 使用 JSON 在完整日历上呈现事件

javascript - 如何使用 Ajax 刷新或重新加载 div 的内容

javascript - 删除对象数组中的谷歌地图标记

javascript - Jquery 与新的 Javascript 框架/库(Angular、Ember、React 等)

javascript - 浏览器 API : how to pass advanced option to script