Created
May 3, 2021 15:13
-
-
Save aalfiann/c8b9ec9a6e65c9f1d9d3a45ac924fea6 to your computer and use it in GitHub Desktop.
Example Get or Set Date 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
var current_date = '2021-04-30'; | |
var date = new Date(current_date+' 00:00:01'); | |
var lastWeek = new Date(date.setDate(date.getDate()-7)); | |
var firstDay = new Date(date.getFullYear(), date.getMonth(), 1); | |
var lastDay = new Date(date.getFullYear(), date.getMonth() + 1, 0); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment