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

Function formatDate

scripts/web_timer_main.js:483–488  ·  view source on GitHub ↗
(date)

Source from the content-addressed store, hash-verified

481}
482
483function formatDate(date) {
484 let year = date.getFullYear();
485 let month = padZero(date.getMonth() + 1);
486 let day = padZero(date.getDate());
487 return `${year}-${month}-${day}`;
488}
489
490function padZero(num) {
491 return num.toString().padStart(2, "0");

Callers 3

initFunction · 0.70
openDatePickerFunction · 0.70
getDataFunction · 0.70

Calls 1

padZeroFunction · 0.70

Tested by

no test coverage detected