Bug 1346812 - Use standard pad functions in aboutTelemetry.js
MozReview-Commit-ID: 7S3tUVvoKsv
--- a/toolkit/content/aboutTelemetry.js
+++ b/toolkit/content/aboutTelemetry.js
@@ -170,17 +170,17 @@ function removeAllChildNodes(node) {
node.removeChild(node.lastChild);
}
}
/**
* Pad a number to two digits with leading "0".
*/
function padToTwoDigits(n) {
- return (n > 9) ? n : "0" + n;
+ return new String(n).padStart(2, "0");
}
/**
* Return yesterdays date with the same time.
*/
function yesterday(date) {
let d = new Date(date);
d.setDate(d.getDate() - 1);