padToTwo() works on negative numbers

This commit is contained in:
iou1name 2018-10-01 07:59:18 -04:00
parent 93e0b80128
commit edf5ef62b7

View File

@ -177,7 +177,11 @@ function submitWritein(post_id) {
/* Helpers */
function padToTwo(number) {
if (number<=99) { number = ("0"+number).slice(-2); }
if (number >= 0) {
if (number < 10) { number = "0" + number; }
} else {
if (number > -10) { number = "-0" + -1*number; }
}
return number;
}
function strftime(date) {