MCPcopy Index your code
hub / github.com/perkeep/perkeep / pad

Function pad

server/perkeepd/ui/server_connection.js:822–828  ·  view source on GitHub ↗
(num, length)

Source from the content-addressed store, hash-verified

820function dateToRfc3339String(dateVal) {
821 // Return a string containing |num| zero-padded to |length| digits.
822 var pad = function(num, length) {
823 var numStr = "" + num;
824 while (numStr.length < length) {
825 numStr = "0" + numStr;
826 }
827 return numStr;
828 };
829
830 return goog.string.subs("%s-%s-%sT%s:%s:%sZ",
831 dateVal.getUTCFullYear(), pad(dateVal.getUTCMonth() + 1, 2), pad(dateVal.getUTCDate(), 2),

Callers 1

dateToRfc3339StringFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected