Created
August 9, 2020 09:29
-
-
Save palanisamym14/8ab7630c6053ab9f794f56235a17af4a to your computer and use it in GitHub Desktop.
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
let startDate = moment(date).subtract(1,'M').startOf('month').add(15,'d').format('YYYY-MM-DD') | |
let endDate = moment(date).subtract(1,'M').startOf('month').add(1,'M').add(14,'d').format('YYYY-MM-DD') | |
if(moment(date).isSameOrAfter(startDate) && moment(date).isSameOrBefore(endDate)){ | |
console.log(moment(startDate).format('MMM, YYYY')) | |
}else{ | |
console.log(moment(endDate).format('MMM, YYYY')) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment