【问题标题】:Full Calendar color/textColor not working完整的日历颜色/textColor 不起作用
【发布时间】:2014-12-15 07:37:44
【问题描述】:

我正在使用带有服务器端处理的完整日历。

PHP

while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) {
  $event_array = array();

  $event_array['id'] = $row['id'];
  $event_array['title'] = $row['forename'] "" $row['surname'];
  $event_array['start'] = $row['start'];
  $event_array['end'] = $row['end'];
  $event_array['allDay'] = true;
  $event_array['color'] = $row['colour'];
  $event_array['textColor'] = "white";

  array_push($return_array, $event_array);
}

问题

colortextColor 值对日历没有影响。我已经阅读了http://fullcalendar.io/docs/event_data/events_array/,这些都是有效的选项,但我不确定我是否在数组中正确使用它们。

$row['colour']是数据库中存储black等颜色值的行。

【问题讨论】:

标签: php jquery mysql pdo fullcalendar


【解决方案1】:

解决方案

我使用了$event_array['className'] = $row['colour'];,其中row['colour'] 返回例如black

然后我用了:

.black div {
  background-color: black;
  border-color:     black;
  color:            white;
}

在 CSS 中。

【讨论】:

    【解决方案2】:

    这样使用。

        eventRender: function(info) {
            if (moment(info.event.end) < moment()){
                info.el.style.backgroundColor  = "#e3e3e3";
                info.el.style.borderColor ="#e3e3e3";
            } else {
                info.el.style.backgroundColor  = "#6a49fc";
                info.el.style.borderColor ="#6a49fc";
                info.el.style.color = "#ffffff";
              }
          },
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-06-21
      • 2012-09-30
      • 1970-01-01
      • 2020-07-06
      • 1970-01-01
      • 2011-01-27
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多