arshadkazmi42 / simple-date-validator

Simple Date Validator Library (NodeJs)
GNU General Public License v3.0
3 stars 12 forks source link

Functionality #5, added function to check past dates with tests #19

Closed leeyspaul closed 6 years ago

leeyspaul commented 6 years ago

Issue #5 Added functionality for checking past dates.

isBefore documentation: http://momentjs.com/docs/#/query/

screen shot 2018-09-29 at 21 22 11

Let me know if I've messed something up and I'll fix it up as soon as I can! Thanks~

arshadkazmi42 commented 6 years ago

@leeyspaul I have suggested few changes. Also can you tag the issue number in PR description

leeyspaul commented 6 years ago

Ok I fixed the isDatePast function as requested and then utilized moment().add(...) and .subtract(...) functionality for tests. Although the number is still hardcoded into add and subtract. Wasn't sure if this was wanted, do let me know!~

arshadkazmi42 commented 6 years ago

@leeyspaul This is awsome, just a small change and we are good to go.

arshadkazmi42 commented 6 years ago

@leeyspaul Cool. waiting for the checks to complete. Will merge it as soon as tests are completed.