Currently, I am utilizing moment.js to retrieve the present date and time with the intention of formatting it in the specific format below
'MMMM Do YYYY, h:mm:ss a'
Unfortunately, the problem arises as the delineation between hours, minutes, and seconds appears as an underscore instead of colons. This is how I have integrated it:
download() {
var url = OFFERS_URL + '?';
this.$axios.get(url, { responseType: 'blob' })
.then(response => {
var file = new Blob([response.data]);
FileSaver.saveAs(file, 'Offers ' + moment().format('MMMM Do YYYY, h:mm:ss a') + '.xls');
});
}
When the file is downloaded, the name displayed is as follows:
Offers April 20th 2021, 1_26_59 PM
whereas it should actually be:
Offers April 20th 2021, 1:26:59 PM