diff --git a/views/inventory.js b/views/inventory.js index de15b3b0..6c128619 100644 --- a/views/inventory.js +++ b/views/inventory.js @@ -187,6 +187,13 @@ $(function() { return 'Wrong date format, needs to be YYYY-MM-DD'; } + else if (moment($el.val()).isValid()) + { + if (moment($el.val()).isBefore(moment(), 'day')) + { + return 'This value cannot be before today.'; + } + } }, 'notequal': function($el) { diff --git a/views/purchase.js b/views/purchase.js index aa8f8964..51dc2fa5 100644 --- a/views/purchase.js +++ b/views/purchase.js @@ -192,6 +192,13 @@ $(function() { return 'Wrong date format, needs to be YYYY-MM-DD'; } + else if (moment($el.val()).isValid()) + { + if (moment($el.val()).isBefore(moment(), 'day')) + { + return 'This value cannot be before today.'; + } + } } } });