Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get the day of the week from a date using Jquery? [duplicate]

I now it has been aswer before, the problem is that I get the date from an input is not the current date.

I need to get the day of the week. Currently I get the date with this format :

11/09/2013

But I want it like:

Saturday/02/2013. 

I'm using datepicker to show the calendar, so it could be some solution that would help me using the same plugin.

like image 856
GioBot Avatar asked Nov 09 '13 20:11

GioBot


Video Answer


1 Answers

var date = new Date();
var weekdays = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"];

var weekday = weekdays[date.getDay()];
var month = date.getMonth() + 1;
var year = date.getYear();
like image 181
Hello World Avatar answered Oct 03 '22 15:10

Hello World