Created
September 7, 2017 18:22
-
-
Save Prosen-Ghosh/76cc7df3d6ae1f33b011073b4fa42732 to your computer and use it in GitHub Desktop.
Get Day Name In JavaScript
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var getDayName = function(dateFormate){ | |
var days = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'], | |
date = new Date(dateFormate); | |
return days[date.getDay()]; | |
} | |
getDayName("08/01/2017"); // MM/DD/YYYY | |
// "Tuesday" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment