MOMMJS不断获得以下错误时刻.JS:折旧警告:提供的值不在公认的RFC2822或ISO中



我正在尝试将Maddhatter Laravel-Fullcalendar集成到Laravel应用程序中,我的日历在大多数浏览器上都可以使用,但是当我进行Inspect Inspect时,它会在Internet Exprorer上失败。

我的数组看起来像这样:

$('#calendar-wean15RN').fullCalendar({
  "header":{
     "left":"prev,next today",
     "center":"title",
     "right":"month,agendaWeek,agendaDay"
  },
  "eventLimit":true,
  "defaultDate":"Apr 2017",
  "eventColor":"#3c8dbc !important",
  "eventBackgroundColor":"#3c8dbc !important",
  "eventBorderColor":"#3c8dbc",
  "eventTextColor":"#fff !important",
  "events":[{
    "id":"1557",
    "title":"xxx nHrs worked:6.00",
    "allDay":"true",
    "start":"2017-04-03T09:00:00+00:00",
    "end":"2017-04-03T15:00:00+00:00",
    "url":"/timesheet/1557/edit"
  }]
}

不确定我在做什么错。

完整错误看起来像这样

Deprecation warning: value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged and will be removed in an upcoming major release. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.
Arguments: 
[0] _isAMomentObject: true, _isUTC: true, _useUTC: true, _l: undefined, _i: Apr 2017, _f: undefined, _strict: undefined, _locale: [object Object]
Error
    at Function.createFromInputFallback (js/moment.js:314:94)
    at configFromString (js/moment.js:2172:11)
    at configFromInput (js/moment.js:2541:9)
    at prepareConfig (js/moment.js:2524:9)
    at createFromConfig (js/moment.js:2491:40)
    at createLocalOrUTC (js/moment.js:2578:12)
    at Function.createUTC [as utc] (js/moment.js:81:12)
    at makeMoment (js/fullcalendar.js:1197:21)
    at FC.moment.parseZone (js/fullcalendar.js:1154:9)
    at constructor.moment (js/fullcalendar.js:11795:30)
warn @ moment.js:287

"defaultDate":"Apr 2017"更改为 "defaultDate":moment("Apr 2017", "MMM YYYY")

fullcalendar文档状态 defaultDate的类型是力矩。

正如警告所述:提供的值("Apr 2017"(不在公认的RFC2822或ISO格式中;因此,您必须使用moment(String, String)解析功能。

在这里说:https://fullcalendar.io/docs/current_date/defaultdate/默认情况也应为ISO8601日期字符串。

$('#calendar-wean15RN').fullCalendar(
    {"header":{"left":"prev,next today","center":"title","right":"month,agendaWeek,agendaDay"},"eventLimit":true,"defaultDate":"2017-04-03T09:00:00+00:00","eventColor":"#3c8dbc !important","eventBackgroundColor":"#3c8dbc !important","eventBorderColor":"#3c8dbc","eventTextColor":"#fff !important","events":[{"id":"1557","title":"xxx nHrs worked:6.00","allDay":"true","start":"2017-04-03T09:00:00+00:00","end":"2017-04-03T15:00:00+00:00","url":"/timesheet/1557/edit"}]
}

相关内容

  • 没有找到相关文章

最新更新