Skip to content

Instantly share code, notes, and snippets.

@marufsiddiqui
Created November 10, 2019 13:44
Show Gist options
  • Save marufsiddiqui/552ec8e590f0aa266dd48f71315ff6ba to your computer and use it in GitHub Desktop.
Save marufsiddiqui/552ec8e590f0aa266dd48f71315ff6ba to your computer and use it in GitHub Desktop.
Asphalt 9 reps generator per season
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