datejs / Datejs

A JavaScript Date and Time Library
Other
1.89k stars 483 forks source link

Check if date is between two days of this week returns an error. #136

Open AtanasBobev opened 5 years ago

AtanasBobev commented 5 years ago

Hi. I'm new to date.js. I have a localStorage key that holds date. My goal is to check if this specific date is between this monday and this sunday of this week. For example: today is Tuesday. Checking today I should get true but after one week the response should be false because one week has passed. What I came up so far provokes errors in the console. How to make this code work as intended?

image

Here is my code: Date.parse(localStorage.getItem('daysSet')).between(Date.parse("Monday") , Date.parse("Sunday"))