首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >火狐中的FullCalendar IETF日期

火狐中的FullCalendar IETF日期
EN

Stack Overflow用户
提问于 2012-08-18 00:00:39
回答 1查看 400关注 0票数 0

我一直在使用FullCalendar,在火狐中遇到了一些问题。我有可选的on,开始日期是IETF格式的。出于某种原因,IE8可以发布(并自动转换为时间戳),但火狐不能。

它将其保留为IETF格式,并且PHP的date()函数不能使用它。我使用了fullCalendar.formatDate()函数作为变通方法,但这对我来说似乎不是最好的解决方案。

有没有其他方法可以让这件事起作用?

代码语言:javascript
复制
<script type='text/javascript'>
    $(document).ready(function () {
        var date = new Date();
        var calendar = $("#calendar").fullCalendar({
            theme: true,
            title: "Employee Calendar",

            header: {
                left: 'prev,next today',
                center: 'title',
                right: 'month,agendaWeek,agendaDay'
            },
            buttonIcons: {prev: 'circle-triangle-w', next: 'circle-triangle-e'},
            editable: true,
            droppable: true,
            events: '<?php echo matry::base_to('utilities/calendar_events');?>',
            eventClick: function (event) {
                $.ajax({
                    url: '<?php echo matry::base_to('utilities/calendar_tools');?>',
                    type: 'POST',
                    data: {id: event.id, job: 'getEvent'},
                    success: function(data){
                        $("#event_box").fadeIn(500);
                        $("#event_info").html(data);        
                    }
                });
            },
            selectable: true,
            selectHelper: true,
            select: function (start, end, allDay){                                    
                var title = prompt('Event Title');
                start = $.fullCalendar.formatDate(start, 'yyyy-MM-dd HH:mm:ss');
                end = $.fullCalendar.formatDate(end, 'yyyy-MM-dd HH:mm:ss');
                if (title)
                {
                    $.ajax({
                        type: 'POST',
                        url: '<?php echo matry::base_to('utilities/calendar_tools');?>',
                        data: {title: title, start: start, end: end, allDay: allDay, job: 'createEvent'},
                        success: function(data) {
                            calendar.fullCalendar('refetchEvents' );
                            $("#alerts").html(data);
                        }//close success function
                    })//close ajax
                }
                else 
                    calendar.fullCalendar('unselect');
            }//close select function
        }); //close fullcalendar function

        $("#calendar_controls").accordion({
            collapsible: true,
            clearStyle:true,
            active: false,
            autoHeight: true
        });//close calendar controls

        $(document).on('submit', '#event_form', function (event){
            event.preventDefault();
                $.ajax({
                    url: '<?php echo matry::base_to('utilities/calendar_tools');?>',
                    type: 'POST',
                    data: $('#event_form').serialize(),
                    success: function(data){
                        $("#event_box").fadeOut('2000');
                        $("#alerts").html(data).focus();
                    }
                })    
        });//close on function

        $(document).on('click', '#delete', function() {
            var con = confirm('Do you want to delete this Event?');
            if (con)
            {
                var id = $("#event_form input[name= 'id']").val();
                $.ajax({
                    url: '<?php echo matry::base_to('utilities/calendar_tools');?>',
                    data: {id: id, job: 'deleteEvent'},
                    type: 'POST',
                    success: function(data){
                        $("#alerts").html(data).focus()
                        calendar.fullCalendar('refetchEvents');
                        $("#event_box").fadeOut(1000);
                    ;}
                });
            }
        })
    }); //close document.ready function
</script>
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2012-09-14 01:47:01

firefox不能正确传递IETF日期格式,但是可以使用$.fullCalendar.formatDate()函数更改日期,该函数似乎工作得很好。如果将其添加到传递日期的任何位置,则可以更改格式。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/12009189

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档