dream543211 2019-05-15 15:02
浏览 105

使用RRule插件在fullcalendar V4中输出事件(json)

This is the PHP code that loads the events :

$q_e = mysqli_query($sqllink,"SELECT * FROM data_calendar_event WHERE
nuid='$nuid' AND valid='1'");
while ($r_e = mysqli_fetch_array($q_e) ){

    $start  = date("Y-m-d H:i",$r_e['StartDate']);
        $end    = date("Y-m-d H:i",$r_e['EndDate']);

    switch($r_e['FullDay']){
        case 0:
            $FullDay = FALSE;
        break;

        case 1:
            $FullDay    = TRUE;
            $end        = NULL;
        break;
    }
    //$rrule = "DTSTART:20129201T103000Z
RRULE:FREQ=WEEKLY;INTERVAL=5;UNTIL=20120601;BYDAY=MO,FR";// NULL;
    $EventID = base64url_encode($r_e['EventID']);
    $event_array[] = array(
    'id'                => $EventID,
    'title'             => $r_e['EventName'],
    'color'             => $r_e['EventColor'],
    'allDay'            => $FullDay,
    'start'             => $start,
    'end'               => $end,
    //'rrule'           => $rrule
    );
}

This is the javascript that calls the PHP script :

eventSources: [{
          url: 'load.events.php',
          method: 'POST',
          extraParams: {
            token: '<? echo $token; ?>'
          },
        }],

the token is just an internal part of the script.

Rrule output is something like this : DTSTART:20190301T230000Z RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=MO,WE,FR;COUNT=5

I am using the RRule Plugin of Fullcalendar and if I uncomment rrule I get the following error : Failure parsing JSON Object.

I have looked into the docs at https://fullcalendar.io/docs/rrule-plugin and followed the instructions, but I must have missed something.

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 数学的三元一次方程求解
    • ¥20 iqoo11 如何下载安装工程模式
    • ¥15 本题的答案是不是有问题
    • ¥15 关于#r语言#的问题:(svydesign)为什么在一个大的数据集中抽取了一个小数据集
    • ¥15 C++使用Gunplot
    • ¥15 这个电路是如何实现路灯控制器的,原理是什么,怎么求解灯亮起后熄灭的时间如图?
    • ¥15 matlab数字图像处理频率域滤波
    • ¥15 在abaqus做了二维正交切削模型,给刀具添加了超声振动条件后输出切削力为什么比普通切削增大这么多
    • ¥15 ELGamal和paillier计算效率谁快?
    • ¥15 蓝桥杯单片机第十三届第一场,整点继电器吸合,5s后断开出现了问题