๐:-1
So I found a solution to this and it was to use moment.js.
link to reference: https://www.chartjs.org/docs/latest/axes/cartesian/time.html
Solution:
(`MY API LINK=${moment(new Date()).subtract(1, 'month').format('YYYY-MM-DD')}&end=${moment(new Date()).format('YYYY-MM-DD')}`)