0
0
mirror of https://github.com/fawazahmed0/exchange-api.git synced 2025-06-29 18:21:14 +00:00
exchange-api/other/getdate-args.js
2024-02-29 19:39:38 +05:30

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(' '))