doulongsi1831 2018-07-04 08:27
浏览 125
已采纳

如何在Laravel Full Calendar上查看具体日期?

I'm using Maddhatter fullcalendar composer. And I want to make input that allow you to go to specific date.

like this

I just search in fullcalendar.io and I found gotoDate function. How can I use that function on laravel? or is there any solution to make this happen?

  • 写回答

2条回答 默认 最新

  • douyong1885 2018-07-04 12:30
    关注

    There is no need to do it in Laravel at all...Laravel/PHP code runs server-side. The Laravel code just renders some HTML and JavaScript into the browser to get fullCalendar to work. Therefore you can do this entirely client-side using JavaScript, and disregard the Laravel part. The only thing you need to take note of from your PHP code is the ID you give to the calendar - replace the calendar ID in my code below with the ID you've used.

    HTML:

    Date: <input type="date" id="dateField"/>
    <button type="button" id="dateBtn">Go to date</button>
    

    JavaScript:

    $("#dateBtn").click(function(){
        $("#calendar").fullCalendar("gotoDate", $("#dateField").val());
    });
    

    See http://jsfiddle.net/sbxpv25p/826/ for a working demo.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥20 机器学习能否像多层线性模型一样处理嵌套数据
  • ¥20 西门子S7-Graph,S7-300,梯形图
  • ¥50 用易语言http 访问不了网页
  • ¥50 safari浏览器fetch提交数据后数据丢失问题
  • ¥15 matlab不知道怎么改,求解答!!
  • ¥15 永磁直线电机的电流环pi调不出来
  • ¥15 用stata实现聚类的代码
  • ¥15 请问paddlehub能支持移动端开发吗?在Android studio上该如何部署?
  • ¥20 docker里部署springboot项目,访问不到扬声器
  • ¥15 netty整合springboot之后自动重连失效