Hey there, I'm facing an issue with one of my functions that displays the date. Currently, it shows up like this: 5/31/2021. However, I would like it to appear in the format 05/31/2021. Below is the code snippet for reference:
<span>{{ dtFormatter(course.updated_at) }}</span>
dtFormatter(d) {
var dateObj = new Date(d);
var day = dateObj.getUTCDate();
var month = dateObj.getUTCMonth() + 1; //months from 1-12
var year = dateObj.getUTCFullYear();
return day + "." + month + "." + year;
},