MCPcopy Create free account
hub / github.com/PageLeay/celestial-runtime / zpad

Function zpad

lib.esm/_admin/utils/date.js:10–16  ·  view source on GitHub ↗
(value, length)

Source from the content-addressed store, hash-verified

8 return c.substring(0, length);
9}
10function zpad(value, length) {
11 if (length == null) {
12 length = 2;
13 }
14 const str = String(value);
15 return repeat("0", length - str.length) + str;
16}
17function getDate(date) {
18 return [
19 date.getFullYear(),

Callers 2

getDateFunction · 0.70
getDateTimeFunction · 0.70

Calls 1

repeatFunction · 0.70

Tested by

no test coverage detected