Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

how to get the day name from date in javascript

var days = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'];
var d = new Date(dateString);
var dayName = days[d.getDay()];
Comment

day name date js

new Date(dateString).toLocaleString('en-us', {weekday:'long'})
Comment

get day name from date javascript

const dayIndex = new Date().getDay();
const getDayName = (dayIndex) =>{
	const days = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'];
	return days[dayIndex];
}
const dayName = getDayName(dayIndex)
Comment

get name of day javascript

var today = new Date();

console.log(today.getDay()); // sunday = 0, monday = 1, etc..
Comment

js get day name from date

function getDayName(dateStr, locale)
{
    var date = new Date(dateStr);
    return date.toLocaleDateString(locale, { weekday: 'long' });        
}

var dateStr = '05/23/2014';
var day = getDayName(dateStr, "nl-NL"); // Gives back 'Vrijdag' which is Dutch for Friday.
Comment

PREVIOUS NEXT
Code Example
Javascript :: how select start from id in jquery 
Javascript :: Selector All Element querySelector Method 
Javascript :: discord.js get all members with role 
Javascript :: regex to check the phone number javascript 
Javascript :: get value of checked radio button jquery 
Javascript :: import axios 
Javascript :: protractor right click on element 
Javascript :: jquery validation plugin 
Javascript :: Ready check failed: NOAUTH Authentication required. 
Javascript :: detect touch react 
Javascript :: js replace all spaces 
Javascript :: javascript escape quote method 
Javascript :: jquery trigger link click 
Javascript :: how to format multiline string in javascript 
Javascript :: tailwind confirm 
Javascript :: js redirect page 
Javascript :: redirect with javascript to another page 
Javascript :: math format comma separated in javascript 
Javascript :: js remove zeros after decimal 
Javascript :: install json-server 
Javascript :: select tag onchange 
Javascript :: javascript ip 
Javascript :: random array javascript 
Javascript :: new line in js 
Javascript :: sum two objects javascript 
Javascript :: js stop redirect 
Javascript :: javascript rupiah format 
Javascript :: jquery clear form values 
Javascript :: what is niceScroll 
Javascript :: insertbefore jquery 
ADD CONTENT
Topic
Content
Source link
Name
5+7 =