MCPcopy Create free account
hub / github.com/Useful-Scripts-Extension/useful-script / formatDate

Function formatDate

scripts/web_timer.js:476–481  ·  view source on GitHub ↗
(date)

Source from the content-addressed store, hash-verified

474 }
475
476 function formatDate(date) {
477 let year = date.getFullYear();
478 let month = padZero(date.getMonth() + 1);
479 let day = padZero(date.getDate());
480 return `${year}-${month}-${day}`;
481 }
482
483 function padZero(num) {
484 return num.toString().padStart(2, "0");

Callers 1

getTodayFunction · 0.70

Calls 1

padZeroFunction · 0.70

Tested by

no test coverage detected