Reputation: 507
I'm using Moment.js to manipulate date format in my application and I would like to know how could I see if a my current date is between 31/08 and 30/09 (day/month) of the same year.
For example :
Upvotes: 0
Views: 250
Reputation: 5715
Seems simple enough:
var isInRange = date.month() === 8 || (date.month() === 7 && date.date() === 31)
Note that months are indexed from 0.
Upvotes: 1