我试图让日历在我的离子应用程序上运行,通过bower安装日历和moment.js但是我得到错误,它说的是TypeError:d不是一个功能。它将我带到了线路" var previousDate = moment(vm.viewDate);"在mwlCalendar.js:35
.controller('profileCtrl', function($scope, $state, User, calendarConfig, moment) {
//Calendar Stuff
$scope.calendarView = 'day';
$scope.viewDate = new Date();
var test = new Date('9/20/2016');
console.log(moment());
$scope.calendarTitle = "Test Calendar";
//test data
$scope.events = [{
title: 'My event title', // The title of the event
startsAt: new Date(2016, 10, 1, 1), // A javascript date object for when the event starts
endsAt: new Date(2016, 10, 26, 15), // Optional - a javascript date object for when the event ends
color: { // can also be calendarConfig.colorTypes.warning for shortcuts to the deprecated event types
primary: '#e3bc08', // the primary event color (should be darker than secondary)
secondary: '#fdf1ba' // the secondary event color (should be lighter than primary)
},
actions: [{ // an array of actions that will be displayed next to the event title
label: '<i class=\'glyphicon glyphicon-pencil\'></i>', // the label of the action
cssClass: 'edit-action', // a CSS class that will be added to the action element so you can implement custom styling
onClick: function(args) { // the action that occurs when it is clicked. The first argument will be an object containing the parent event
console.log('Edit event', args.calendarEvent);
}
}],
draggable: false, //Allow an event to be dragged and dropped
resizable: false, //Allow an event to be resizable
incrementsBadgeTotal: true, //If set to false then will not count towards the badge total amount on the month and year view
cssClass: 'a-css-class-name', //A CSS class (or more, just separate with spaces) that will be added to the event when it is displayed on each view. Useful for marking an event as selected / active etc
allDay: false // set to true to display the event as an all day event on the day view
}];
}
&#13;
<div class="calendar" ng-hide="profile">
<mwl-calendar view="calendarView" view-date="viewDate" events="events" view-title="calendarTitle">
</mwl-calendar>
</div>
&#13;
答案 0 :(得分:3)
发现我的问题,我在momentjs
之前加载了angular-bootstrap-calendar的源代码