Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

javascript get date of last monday

let prevMonday = new Date();
prevMonday = new Date(prevMonday.setDate(prevMonday.getDate() - (prevMonday.getDay() + 6) % 7));
// sets the date object to last Monday, if the current day is Monday,
// set it to the current date

prevMonday = new Date(prevMonday.setHours(0,0,0)); // sets hours, mins, secs to 0
Comment

PREVIOUS NEXT
Code Example
Javascript :: chart.js reduce doughnut tickness 
Javascript :: javascript reference file two folders up 
Javascript :: vue js footer copyright date automatically 
Javascript :: tailwind nextjs 
Javascript :: load jquery in the browser code 
Javascript :: js how to check typeof boolean 
Javascript :: sleep sort 
Javascript :: javascript to integer 
Javascript :: sass node sass loder 
Javascript :: p5.js boilerplate 
Javascript :: pdf darkmode 
Javascript :: adding font awesome to npm or react 
Javascript :: jquery validate if field exists 
Javascript :: js document ready 
Javascript :: preg_replace javascript 
Javascript :: javascript enable a button once an input text filled 
Javascript :: disable input angular 
Javascript :: nx serve 2 applications 
Javascript :: requirenativecomponent rnsscreen was not found in the uimanager 
Javascript :: javascript determine array type 
Javascript :: get age by birthday js 
Javascript :: vue prop array default 
Javascript :: Playing sound in Vue.js 
Javascript :: js get all select options 
Javascript :: fibonacci js code 
Javascript :: jquery redirect to another webpage 
Javascript :: return early pattern for functions javascript 
Javascript :: javascript csv string with commas in fields 
Javascript :: javascript degree to radians 
Javascript :: js replace space with plus 
ADD CONTENT
Topic
Content
Source link
Name
1+1 =