- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在使用 jQuery FullCalendar 插件并想在日 View 中隐藏某些时间。
我想显示早上 6 点到上午 10 点以及中午 12 点到下午 4 点的日历。
我已经设置了 minTime: '6:00'
和 maxTime: '14:00'
但我还需要隐藏上午 10 点到中午 12 点之间的时间。
最佳答案
问题是,fullcalendar 依赖于 Moment.js 持续时间。据我所知,你不能有多个持续时间的持续时间。
不过fullcalendar好像是先渲染agenda,然后计算agenda布局后events需要在什么位置。因此,如果可以接受 CSS 解决方案,您始终可以执行以下操作:
[data-time^="10"]>td, [data-time^="11"]>td, [data-time^="12"]>td
{
height: 0 !important;
border: 0 !important;
}
这通过匹配表格行的“数据时间”属性来实现。匹配模式是前缀匹配,以节省一些输入。如果你不想使用^=
来匹配前缀,你可以试试这些:
https://www.w3.org/TR/css3-selectors/#selectors
编辑演示(适用于 Chrome 52)。如您所见,我还需要隐藏受影响单元格的子级 (display: none;
)。另请注意,您需要过滤自己的数据以排除或更改落在该范围内的日期时间。我已经包含了一些事件,这些事件表明如果您不采取这种预防措施会发生什么。
$(document).ready(function() {
$('#calendar').fullCalendar({
header: {
left: 'prev,next today',
center: 'title',
right: 'agendaDay'
},
defaultView: 'agendaDay',
defaultDate: '2016-06-12',
editable: true,
eventLimit: true,
events: [
{
title: 'Meeting',
start: '2016-06-12T10:30:00',
end: '2016-06-12T12:30:00'
},
{
title: 'Loooong Meeting',
start: '2016-06-12T09:30:00',
end: '2016-06-12T14:30:00'
},
{
title: 'Lunch',
start: '2016-06-12T12:00:00'
},
{
title: 'Meeting',
start: '2016-06-12T14:30:00'
},
{
title: 'Happy Hour',
start: '2016-06-12T17:30:00'
},
{
title: 'Dinner',
start: '2016-06-12T20:00:00'
}
]
});
})
[data-time^="10"]>td,
[data-time^="11"]>td,
[data-time^="12"]>td
{
height: 0 !important;
border: 0 !important;
}
[data-time^="10"]>td *,
[data-time^="11"]>td *,
[data-time^="12"]>td *
{
display: none !important;
}
<link href="http://fullcalendar.io/js/fullcalendar-2.9.1/fullcalendar.min.css" rel="stylesheet"/>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/moment.js/2.9.0/moment.min.js"></script>
<script src="http://fullcalendar.io/js/fullcalendar-2.9.1/fullcalendar.min.js"></script>
<div id="calendar"></div>
关于FullCalendar - 在日 View 中隐藏某些时间,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39147769/
我正在使用 C#。 我知道我可以用 ToLongDateString() 显示如下内容: Friday, February 27, 2009 我喜欢做的是展示类似的东西: Febru
我将用户输入的时间和日期作为: DatePicker dp = (DatePicker) findViewById(R.id.datePicker); TimePicker tp = (TimePic
我需要检查是否 DateTime.Now是在每个月的前 3 个工作日(周一至周五)。我还需要提供一个 List有国定假日,应相应处理。 如果 DateTime.Now 是星期六并且是该月的 1 号,则
我想以 2012 年 1 月 1 日 - 2012 年 1 月 31 日的格式显示日期 并获取由 dateranges['jan 1,2012 - jan 31,2012','December 1,2
我有这两个函数可以以正确的格式 (mm-dd-yyyy) 创建一个新字符串,但现在它似乎工作得不太好......当我输入日期 31-03-2013 这是一个有效的日期,它出现在 04-01-2013
我只想在 Fullcalendar 中加载 December 月份,其中 2 个日期启用 2012 年 12 月 14 日、15 日。 var date = new Date(2012, 11); v
我创建了一个convertDate类,用于转换我的时间戳,即Date().sinceReferenceDate(即自2001年1月1日凌晨12:00起)。我有一个问题:当时间戳的日期超过 3 周前时,
我有来自两个来源的数据,我试图在日期/时间上进行匹配。问题是我没有得到匹配。所以我将日期/时间转换为 Julian 并遇到了一些奇怪的事情。 8/11/2015 6:50:22.000 42227
我正在尝试将毫秒转换为如下所示的日期:Oct 04, 2013 .我将毫秒转换为日期对象: var d1 = new Date(milliseconds); 然后输出如下内容: Fri Oct 04
我正在尝试使用 javascript 进行倒计时。但是,我的倒计时只能计算天数、小时数、分钟数和秒数。我还想显示年份和月份。 以下是我的代码: today = new Date();
我有下面的查询不适合我, 这个函数 from_tz(to_timestamp(START_TIME, 'YYYYMMDDHH24MISS'), substr(UTC_TIME_CODE_OFFSET,
例如,我有一列数据如下: 17.14.11 17.15.10 18.21.06 现在是 2017 年 11 月 14 日,我想将其更改为 DateTime 对象,例如: 2017-11-14 2017
$date1 = "2000-01-01"; $date2 = "2011-03-14"; $diff = abs(strtotime($date2) - strtotime($date1)); $y
我有以下代码来验证给定日期格式的日期: val df = new SimpleDateFormat("MM/dd/yyyy"); df.setLenient(false); try { val
我有一个包含两个 DateTime 成员的类。 但是,当我尝试将表示日期的“人类可读”值分配给 DateTime 成员时,它拒绝它并显示消息“字符串未被识别为有效的 DateTime”。 失败的代码行
已关闭。此问题不符合Stack Overflow guidelines 。目前不接受答案。 要求提供代码的问题必须表现出对所解决问题的最低限度的了解。包括尝试的解决方案、为什么它们不起作用以及预期结果
这个问题已经有答案了: Adding days to a date in Java [duplicate] (6 个回答) 已关闭 6 年前。 如何在 java 中将给定的日期转换为日历格式。 示例初
这个问题已经有答案了: Illegal pattern character 'T' when parsing a date string to java.util.Date (4 个回答) 已关闭 6
我现在在香港。如何获取美国的年、月、日? 我已经尝试过: Calendar calendar = Calendar.getInstance(); SimpleDateFormat sdf = new
我正在尝试使用 php 和 Mysql 开发一个搜索系统,但是您如何搜索:例如当数据库中的日期格式为 2012-03-26(年/月/日)时的三月份 最佳答案 根据列数据的格式,这样的事情可能会起作用:
我是一名优秀的程序员,十分优秀!