如何从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