Tell us what’s happening:
my template back tick seems correct but for some reasons It doesn’t pass the test
here is it
currentDateParagraph.textContent = ${month}-${day}-${year} ${hours} Hours ${minutes} Minutes
;
the pattern to follow is mm -dd-year h Hours m Minutes
can anyone help figure out what i am missing?
thanks in advance
Your code so far
<!-- file: index.html -->
/* file: script.js */
// User Editable Region
switch (dateOptionsSelectElement.value) {
case "yyyy-mm-dd":
currentDateParagraph.textContent = formattedDate
.split("-")
.reverse()
.join("-");
break;
case "mm-dd-yyyy h mm":
let ar = formattedDate.split("-")
let m = ar[1]
let d = ar[0]
ar[0] = m;
ar[1] = d
let mdyhm = ar.join("-")
currentDateParagraph.textContent = `${month}-${day}-${year} ${hours} Hours ${minutes} Minutes`;
break;
}
// User Editable Region
/* file: styles.css */
Your browser information:
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/132.0.0.0 Safari/537.36
Challenge Information:
Learn the Date Object by Building a Date Formatter - Step 26