php - 全日历 :- On load events time is not correct

标签 php jquery mysql ajax fullcalendar

在加载/获取事件时,实际时间会增加 9 分钟。

在数据库中,这是2016-09-22 08:00:00,但在日历上,这是2016-09-22 08:09:00)。

我们使用以下代码来设置参数:-

 $('#calendar').fullCalendar({
        events: json_events,           
        utc: true,
        header: {
            left: 'prev,next today',
            center: 'title',
            right: 'month,agendaWeek'
        },
        defaultView: 'month',
        editable: true,
        droppable: true,
        slotDuration: '01:00:00', //'00:30:00' for 30 minutes
        displayEventTime: true,
        axisFormat: 'HH:mm',
        timeFormat: 'hh:mm',
        allDaySlot: false,      
        timezone: 'Asia/Kolkata',
});

最佳答案

我刚刚检查了你的代码,这没问题。我认为您正在 eventRender 函数中进行一些自定义。

如果您使用 format() 函数,请使用如下所示:-

event.start.format("YYYY-MM-DD HH:mm:ss")

我确信在您的情况下您正在使用如下所示:-

event.start.format("YYYY-MM-DD HH:MM:SS")

请告诉我这是否有帮助:)

关于php - 全日历 :- On load events time is not correct,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39533918/

相关文章:

php - 在 functions.php 中获取 protected 帖子的密码

php - 如何使用类似于pdo的mysqli一次插入多条记录

nginx - 警告 : [pool www] seems busy (you may need to increase pm. start_servers 或 pm.min/max_spare_servers),产卵

javascript - Chrome 上的 JQUERY PHP 对于 GET 请求给出 500 错误

javascript - 检查 $(document).ready() 返回的 jQuery 对象内容

php - 用 php 准备好的查询编写 sql 查询

jquery - position top inside position fixed div 总是为每个元素返回相同的值jquery

php - foreach循环与mysql链接表

mysql - 选择组中的第一个和最后一个值

mysql - 无法使用 group by 查询获取 MySQL 中的某些字段