Created
November 10, 2019 13:44
-
-
Save marufsiddiqui/552ec8e590f0aa266dd48f71315ff6ba to your computer and use it in GitHub Desktop.
Asphalt 9 reps generator per season
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 generate = (startDate, seasonsLengthInDays = 28, repPerDay = 4000) => { | |
return new Array(seasonsLengthInDays).fill(null).map((_, i) => { | |
const today = new Date(startDate); | |
const tomorrow = new Date(startDate); | |
today.setDate(today.getDate() + i) | |
tomorrow.setDate(tomorrow.getDate() + i + 1) | |
return [`${today.toLocaleDateString()} - ${tomorrow.toLocaleDateString()}`, repPerDay * (i + 1)].join(',\t') | |
}) | |
} | |
console.log(generate('2019-11-01').join('\n')) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment