简体   繁体   English

全日历将当前日期作为开始日期,而不显示以前的日期

[英]Fullcalendar make current date as the start date and do not display previous dates

I am thinking whether it's possible in the fullcalendar to make the start date as the current date and the previous dates should not be displayed. 我正在考虑是否可以在全日历中将开始日期设为当前日期,而不应显示以前的日期。

Here's a graphical image on what I meant. 这是我的意思的图形图像。 在此处输入图片说明

The first day is set using the function firstDay() . 使用函数firstDay()设置第一天。
You could set it with getDay() . 您可以使用getDay()进行设置

$(document).ready(function() {
    $('#calendar').fullCalendar({
        firstDay(getDay());
    })
});

For the button at the top, you could compare the calendar date (using fullCalendar getDate() ) and the current date (fullCalendar uses MomentJS for the Date handling) and then hide when needed the back button with the fullCalendar header option . 对于顶部的按钮,您可以比较日历日期(使用fullCalendar getDate() )和当前日期 (fullCalendar使用MomentJS进行日期处理),然后在需要时隐藏带有fullCalendar 标头选项的后退按钮。

on php 在PHP上

$dayOfWeek=date('w');

on fullcalendar 在全日历上

firstDay:<?php echo $dayOfWeek; ?>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 从当前日期开始的FullCalendar开始视图 - FullCalendar start view from the current date fullcalendar 获取当前月份的开始和结束日期反应示例 - fullcalendar get current month start and end date react example 如何将 fullcalendar 视图设置为在当前日期前 1 周开始? - How to set fullcalendar view to start 1 week before the current date? FullCalendar-不可点击日期 - FullCalendar - Make date not clickable 如何在 safari 浏览器中显示当前周的开始日期和当前日期 - how to display start date and current date of current week in safari browser 以全日历显示基于所选开始日期和结束日期的数据 - Display data based on selected start and end date in fullcalendar FullCalendar Scheduler滚动到当前日期 - FullCalendar Scheduler Scroll to current date JavaScript-如何获取当前日期并存储以前的日期以用于列表中? - JavaScript - How to get current date, and store previous dates, for use in a list? 我希望在jQuery r Bootstrap中将END日期中的datepicker作为当前日期并将START日期作为END日期之前7天 - I want datepicker in that END date as current date and START date as 7 days previous to END date in Jquery r Bootstrap Jquery FullCalendar延长开始日期或结束日期 - Jquery FullCalendar Extend Start Date or End Date
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM