Answers for "react get current date minus 7 days"

0

react get current date minus 7 days

let today = new Date();
today.setDate(today.getDate() - 7);
let date = new Date(today).toLocaleDateString("de");

// e.g. today = 3.02.2021
// date will be "27.01.2021"
Posted by: Guest on February-22-2021

Code answers related to "react get current date minus 7 days"

Code answers related to "Javascript"

Browse Popular Code Answers by Language