Skip to content

Instantly share code, notes, and snippets.

View MohiuddinSumon's full-sized avatar

Mohiuddin Sumon MohiuddinSumon

View GitHub Profile
@MohiuddinSumon
MohiuddinSumon / dateToDay.js
Created July 22, 2019 17:15
Get Day From Date with Javascript
// https://www.quora.com/How-do-I-calculate-the-day-from-dates
// implemented algo from Aayush-Chaudhry
const DAYS = ['Sunday','Monday','Tuesday','Wednesday','Thursday','Friday'];
function getDate(date)
{
var brokenDate = date.split(" ");
var givenDate = parseInt(brokenDate[0]);
var givenMonth = brokenDate[1].toLowerCase();