Skip to content

Instantly share code, notes, and snippets.

@stenno
Created April 29, 2019 10:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stenno/201cfaeca1895bf931a141cab7cab5b2 to your computer and use it in GitHub Desktop.
Save stenno/201cfaeca1895bf931a141cab7cab5b2 to your computer and use it in GitHub Desktop.
angular isBeforeMinDate
scope.isBeforeMinDate = (month, first) => {
const { year } = scope.currentSelection;
const date = moment(`${first ? '01' : '15'}-${month}-${year}`, 'DD.MM.YYYY');
$log.info("GOING TO RETURN ", !!(scope.earliestMoment && date.isBefore(scope.earliestMoment)));
return (scope.earliestMoment && date.isBefore(scope.earliestMoment)) ? true : false;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment