Skip to content

Instantly share code, notes, and snippets.

@dangrossman
Created May 9, 2018 20:31
Show Gist options
  • Save dangrossman/041f797fd13ed957de11071eac74cca7 to your computer and use it in GitHub Desktop.
Save dangrossman/041f797fd13ed957de11071eac74cca7 to your computer and use it in GitHub Desktop.
isInvalidDate: function(arg) {
if (arg.day == 0 || arg.day() == 6) return true;
var thisMonth = arg._d.getMonth() + 1; // Months are 0 based
if (thisMonth < 10) {
thisMonth = "0" + thisMonth; // Leading 0
}
var thisDate = arg._d.getDate();
if (thisDate < 10) {
thisDate = "0" + thisDate; // Leading 0
}
var thisYear = arg._d.getYear() + 1900; // Years are 1900 based
var thisCompare = thisMonth + "/" + thisDate + "/" + thisYear;
console.log(thisCompare);
if ($.inArray(thisCompare, disabledArr) != -1) {
return true; //arg._pf = {userInvalidated: true};
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment