ListMonth-我需要一种可以显示一个月的整天的方法 - 即使一天没有事件

发布于 2025-02-09 13:21:39 字数 486 浏览 0 评论 0原文

  • fullcalendar 3 listMonth仅列出有事件的天数。

  • 我需要在listMonth视图中显示每月的整个天数,并在ListMonth中显示一些文本计算。

我如何强制listMonth视图显示本月的整个天数并将自定义文本传递给每一天渲染?

我想使用dayrender之类的东西将值传递给使用dayrender> -

dayRender: function (date, cell){
    cell.html("My custom text");
}

dayrender似乎与<< dayrender 代码> LISTMONTH 视图。

  • FullCalendar 3 listMonth only lists days that have events.

  • I need to display all days of the month in the listMonth view, and display some text calculation for each end very day in the listMonth view.

How can I force the listMonth view to show all days of the month and pass a custom text to each day rendered?

I would like to use something like dayRender to pass the values to each day rendered using dayRender -

dayRender: function (date, cell){
    cell.html("My custom text");
}

But dayRender does not seem to work with the listMonth view.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

为你拒绝所有暧昧 2025-02-16 13:21:39

您可以简单地生成一个包含所选日期listMonth视图之间所有几天的数组,以强迫FullCalendar显示所有日历日:

$start_date = $this->input->post('start');// or however you are getting the start date
$end_date = $this->input->post('end');// or however you are getting the end date

$date_span_Array = array();// init
$temp_Array = array();// init

        while(strtotime($start_date) <= strtotime($end_date)){

            $temp_Array['title'] = 'Your custom title';
            $temp_Array['start'] = $start_date;
            $temp_Array['allDay'] = 'true';
            $temp_Array['My_Custom_Value_Or_Text'] = 'My Text';

            array_push($date_span_Array, $temp_Array);

            $start_date = date ("Y-m-d", strtotime("+1 days", strtotime($start_date)));

        }

        // array of events that span all days between 2 dates for fullCalendar selected view
        echo json_encode($date_span_Array);

您可以在该数组的创建 - 如上所述 - 或之后Eventrender

You can simply generate an array that contains all of the days in-between the selected date listMonth view, to force FullCalendar to show all calendar days:

$start_date = $this->input->post('start');// or however you are getting the start date
$end_date = $this->input->post('end');// or however you are getting the end date

$date_span_Array = array();// init
$temp_Array = array();// init

        while(strtotime($start_date) <= strtotime($end_date)){

            $temp_Array['title'] = 'Your custom title';
            $temp_Array['start'] = $start_date;
            $temp_Array['allDay'] = 'true';
            $temp_Array['My_Custom_Value_Or_Text'] = 'My Text';

            array_push($date_span_Array, $temp_Array);

            $start_date = date ("Y-m-d", strtotime("+1 days", strtotime($start_date)));

        }

        // array of events that span all days between 2 dates for fullCalendar selected view
        echo json_encode($date_span_Array);

You can add your own custom data, or actual event data in the creation of that array - as seen above - or afterwards during eventRender

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文