I'm using jquery and moment.js for a custom calendar.
I have a date object in a variable myDate
like :
Object { date="2014-12-23 14:00:00", timezone_type=3, timezone="Europe/Paris"}
I want, using moment.js (or not) get the day name of this date, in my example i need to get : tuesday
Ideas ? Thanks
Result: Wed
Result: Wednesday
code
mydate is the input date. The variable weekDayName get the name of the day. Here the output is
Output
Wednesday
With moment you can parse the date string you have:
That's for UTC, you'll have to convert the time zone from that point if you so desire.
Then you can get the day of the week: