Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

fix(warnings): add example of how to fix date type warnings

  • Loading branch information...
Matt Lewis
Matt Lewis committed Apr 4, 2016
1 parent f9749d7 commit bf9d58fb50ebf9ea281278d76a3684e81fa39a4b
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/directives/mwlCalendar.js
@@ -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);

0 comments on commit bf9d58f

Please sign in to comment.
You can’t perform that action at this time.