Link to home
Start Free TrialLog in
Avatar of Jorge Batres
Jorge BatresFlag for United States of America

asked on

Showing day of the week in date format

Hi, I have a js script that generates the date format without the day of the week like September 24, 2019, but I need it to display Tuesday, September 24, 2019. Could you please help me edit the script to make that change?

Thank you in advance for your help.

Jorge B.
calendarmain.js
Avatar of j2nku
j2nku
Flag of Estonia image

Hi Jorge,

It would help if you could paste your code to display the date, but easiest solution  should be to add:
var dayOfWeek = new Date().toLocaleDateString('en', {weekday:'long'});
YourDateString = dayOfWeek + ", " + YourDateString

BR,
J
Avatar of Jorge Batres

ASKER

I thought I had uploaded the js file on my original question but I edited the question and uploaded the file so it is there now.
ASKER CERTIFIED SOLUTION
Avatar of j2nku
j2nku
Flag of Estonia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thank you so much, it worked!
Thank you very much for your fast response. Your suggestion worked perfectly.