FullCalendar每月更改视图

时间:2013-11-29 03:29:15

标签: jquery calendar fullcalendar

在我的FullCalendar应用程序中,更具体地说是月视图可视化,我在同一天添加了3个或更多事件时会出现一个链接,然后我想让该链接指向该特定日期视图模式一天。

我该怎么做?我很确定有办法做到这一点,但我不知道是什么。

$(".events-view-more a").click(function () {
    alert("clicou");
});

父级(.events-view-more a的父级)td元素包含一个数据属性,其日期值包含类似“2013-11-29”的内容。如何使用它将可视化模式更改为当天的日视图?

任何帮助将不胜感激

提前致谢

7 个答案:

答案 0 :(得分:12)

如果您在月视图中单击单元格的任何位置,则会出现类似这样的内容,从月视图到日视图:

$('#calendar').fullCalendar({

   //other parameters here          

   dayClick: function(date, jsEvent, view) {

            $('#calendar').fullCalendar('gotoDate',date);
            $('#calendar').fullCalendar('changeView','agendaDay');

   }

});

希望这对其他人有用,我知道这是一个老帖子。

答案 1 :(得分:2)

对于寻找非jquery 解决方案的所有人:

window.calendar = new FullCalendar.Calendar(element, options);

// do stuff ...

window.calendar.changeView("timeGridDay")

答案 2 :(得分:1)

$(".events-view-more a").click(function () {
    var date=new Date($(this).parents('td').attr('date'));
$('#fullCalendar').fullCalendar('gotoDate', date.getFullYear(), date.getMonth(), date.getDate());
});

答案 3 :(得分:1)

dayClick: function(date, jsEvent, view) {
    var ajandamodu=view.name;
    if(ajandamodu=='month')
    {                             
        $('#calendar').fullCalendar( 'changeView', 'basicDay'  );
    }
},    

答案 4 :(得分:0)

您唯一需要做的就是在header中指定视图名称(例如agendaDayagendaWeek):

$('#calendar').fullCalendar({
    // put your options and callbacks here

    header: {
        left:   'title',
        center: '',
        right:  'today prev,next agendaDay,agendaWeek'
    },

    defaultView: 'agendaWeek'
});

答案 5 :(得分:0)

@rodrigoalves在日历配置中尝试低于一个。

eventLimit: 3,
eventLimitClick: 'day',

这适合我。

答案 6 :(得分:0)

从上面这里是我对angularjs的解决方案

<div ui-calendar="uiConfig.calendar" config="uiConfig.calendar" calendar="myCalendar" data-ng-model="eventSources"></div>

我像这样设置我的Cal div

import tensorflow as tf
import matplotlib.pyplot as plt

# Make a queue of file names including all the JPEG images files in the relative image directory.
filename_queue = tf.train.string_input_producer(tf.train.match_filenames_once("./MNIST_data/*.png"))

reader = tf.WholeFileReader()
key, value = reader.read(filename_queue)

image = tf.image.decode_png(value) # use png or jpg decoder based on your files.

num_preprocess_threads = 1
min_queue_examples = 256
batch_size=2;
images = tf.train.shuffle_batch([image], batch_size, min_queue_examples + 3 * batch_size, num_threads=num_preprocess_threads, min_after_dequeue=min_queue_examples)

with tf.Session() as sess:
  sess.run(tf.initialize_all_variables())

  coord = tf.train.Coordinator()
  threads = tf.train.start_queue_runners(coord=coord)
  t_image = image.eval() #here is your image Tensor :) 
  fig = plt.figure()
  plt.imshow(t_image)
  plt.show()

  coord.request_stop()
  coord.join(threads)
相关问题