Learn the Date Object by Building a Date Formatter - Step 26

Tell us what’s happening:

Help me to fix the error
Error meassage:Your answer should follow this format: mm-dd-yyyy h Hours m Minutes. Replace mm, dd, yyyy, h, and m with the month, day, year, hours, and minutes variables you created earlier.

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":
      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 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36

Challenge Information:

Learn the Date Object by Building a Date Formatter - Step 26

Hi there @bhagyaj !

Make sure the wording and spacing are correct. You have an extra space after the word Hours

Ya i remove the extra space but again shows the same error

Ya the code passed.Thanks

1 Like

Yeah, the code passed. Thanks!

1 Like

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.