如何從json url(/ comments)渲染我的fullcalendar時間?它顯示時間應該顯示的「對象對象」。從json網址獲取時間的正確方法是什麼?從URLFullcalendar:如何從json url渲染時間 - 類型錯誤hasTime()
JSON例如
{"Title": "qwerty", "Description": "asdf", "IsFullDay": null, "EndAt": "2016-09-21T09:10:15.549000", "StartAt": "2016-09-21T09:10:15.549000"}
fullcalendar
從 「fullcalendar.min」
錯誤個controller.js
function populate() {
clearCalendar();
$http.get('/comments', {
cache: true,
params: {},
}).then(function (data) {
$scope.projects.slice(0, $scope.projects.length);
angular.forEach(data.data, function (value) {
$scope.projects.push({
// id : value.ProjectID,
title: value.Title,
description: value.Description,
start: new Date(value.StartAt),
end: new Date(value.EndAt),
allDay: value.IsFullDay,
stick: true
});
});
});
}
//configure calendar
$scope.uiConfig = {
calendar: {
eventSources:{
url: '/comments',
},
height: 500,
editable: true,
displayEventTime: true,
header: {
left: 'month, agendaWeek, agendaDay',
center: 'title',
right: 'today prev,next'
},
timeFormat : {
month: ' ', //for hide on month view
agenda: 'h:mm: t'
},
selectable: true,
selectHelper: true,
select: function(start, end){
var fromDate = moment(start).format('DD/MM/YYYY LT');
var endDate = moment(end).format('DD/MM/YYYY LT');
$scope.NewProject = {
ProjectID : 0,
StartAt : fromDate,
EndAt : endDate,
IsFullDay : false,
Title : '',
Description: ''
}
$scope.ShowModal()
},
展開錯誤並查看代碼中源自的位置。 – Ryan89
@ Ryan89它來自fullcalendar.min不能改變該代碼當然 –
沒有點擊左側的箭頭,並跟蹤到你的代碼中源於它的痕跡。只有來自fullcalendar.min和jquery.min的 – Ryan89