Last active
October 25, 2021 02:45
-
-
Save ryumada/f38779a22223882f0f0c0fc28c755b6c to your computer and use it in GitHub Desktop.
get daterange one month javascript
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const getDaterangeOneMonth = () => { | |
let date = new Date(); | |
let dateLater = new Date(); | |
dateLater.setDate(date.getDate() + 30); | |
return `${date.toISOString().split("T")[0]} - ${dateLater.toISOString().split("T")[0]}`; | |
} | |
console.log(getDaterangeOneMonth); // 2021-10-25 - 2021-11-24 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment