mirror of
https://github.com/fawazahmed0/exchange-api.git
synced 2025-06-29 18:21:14 +00:00
11 lines
413 B
JavaScript
11 lines
413 B
JavaScript
const startMonth = -2
|
|
const endMonths = -12
|
|
const dateToday = new Date()
|
|
dateToday.setMonth(dateToday.getMonth()+startMonth)
|
|
let datesArr = []
|
|
for(let i=startMonth;i>=endMonths;i--){
|
|
dateToday.setMonth(dateToday.getMonth()-1)
|
|
datesArr.push(`${dateToday.toLocaleString("sv-SE", { dateStyle: 'short'}).slice(0,7).replace('-','\\-')}\\-[0-9]+`)
|
|
}
|
|
console.log(datesArr.map(e=>`--path-regex ${e}`).join(' '))
|