Skip to content
This repository has been archived by the owner on Jun 19, 2018. It is now read-only.

Commit

Permalink
fix(warnings): add example of how to fix date type warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Matt Lewis committed Apr 4, 2016
1 parent f9749d7 commit bf9d58f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/directives/mwlCalendar.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@ angular
}

if (!angular.isDate(event.startsAt)) {
$log.warn('Bootstrap calendar: ', 'Event startsAt should be a javascript date object', event);
$log.warn('Bootstrap calendar: ', 'Event startsAt should be a javascript date object. Do `new Date(event.startsAt)` to fix it.', event);
}

if (angular.isDefined(event.endsAt)) {
if (!angular.isDate(event.endsAt)) {
$log.warn('Bootstrap calendar: ', 'Event endsAt should be a javascript date object', event);
$log.warn('Bootstrap calendar: ', 'Event endsAt should be a javascript date object. Do `new Date(event.endsAt)` to fix it.', event);
}
if (moment(event.startsAt).isAfter(moment(event.endsAt))) {
$log.warn('Bootstrap calendar: ', 'Event cannot start after it finishes', event);
Expand Down

0 comments on commit bf9d58f

Please sign in to comment.