在同一个fullcalendar上显示周末和周末 [英] showing both weekdays and weekends on the same fullcalendar

查看:401
本文介绍了在同一个fullcalendar上显示周末和周末的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在同一个完整日历上显示星期几和星期几。我想在日历上有两个按钮,一个叫做星期,已经在整个日历上显示,显示整天一周和其他按钮称为工作周,它会在点击它后仅在周末显示我。
建议我一样。



这是我的代码

 < script type ='text / javascript'> 
$(function(){
var date = new Date();
var d = date.getDate();
var m = date.getMonth();
var y = date.getFullYear();
var calendar = $('#calendar')。fullCalendar({
header:{
left:'prev,next today',
center:'title',
right:'agendaDay,agendaWeek,month'
},
selectable:true,
selectHelper:true,
weekends: false,
defaultView:'agendaweek',
select:function(start,end,allDay){//calendar.fullCalendar('unselect');
},
editable:真
});
});


解决方案

$周末和周末之间的FullCalendar切换



所以这个答案只适用于从DOM中删除日历的前一个副本



http://arshaw.com/fullcalendar/docs/usage/



HTML :

 < input type =buttonid =weekendsvalue =包含周末/> 
< input type =buttonid =workweekvalue =排除周末/>

JavaScript

 <$ (#日历)。fullCalendar({weekends:true()){c $ c> $(function(){
$(#weekends ());
$)$ b $(#workweek)on(click,function(){
$('#calendar')。fullCalendar({weekends:false });
});
});

测试我的建议尝试粘贴这个



javascript:(function(){$('#calendar')。fullCalendar({weekends:false})})()


$
$ b

http://arshaw.com/js/fullcalendar-1.5.4/demos/external- dragging.html


I want to show both all days of the week and weekdays as well on the same full calendar.i want to have two button on the calendar one called as "week" which is already on the full calendar which show all day of the week and other button called as "workweek" which will show me only weekends after clicking on it. suggest me for the same.

Here is my code

<script type='text/javascript'>
$(function() { 
  var date = new Date(); 
  var d = date.getDate(); 
  var m = date.getMonth(); 
  var y = date.getFullYear(); 
  var calendar = $('#calendar').fullCalendar({ 
    header: { 
      left: 'prev,next today', 
      center: 'title', 
       right: 'agendaDay,agendaWeek,month' 
    }, 
    selectable: true, 
    selectHelper: true, 
    weekends:false, 
    defaultView: 'agendaWeek', 
    select: function(start, end, allDay) { //calendar.fullCalendar('unselect'); 
    },
    editable: true 
   }); 
 }); 
</script

解决方案

Duplicate of FullCalendar switch between weekends and no weekends

so this answer only works if you remove the previous copy of the calendar from the DOM

http://arshaw.com/fullcalendar/docs/usage/

HTML:

<input type="button" id="weekends" value="Include weekends" />
<input type="button" id="workweek" value="Exclude weekends" />

JavaScript

$(function() {
  $("#weekends").on("click",function() {
    $('#calendar').fullCalendar({weekends:true});
  });
  $("#workweek").on("click",function() {
    $('#calendar').fullCalendar({weekends:false});
  });
});

to test my suggestion try pasting this

javascript:(function() {$('#calendar').fullCalendar({weekends:false})})()

into the location bar on this page and press enter (in Fx 15+ use the console or create a bookmark)

http://arshaw.com/js/fullcalendar-1.5.4/demos/external-dragging.html

这篇关于在同一个fullcalendar上显示周末和周末的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆