padToTwo() works on negative numbers
This commit is contained in:
parent
93e0b80128
commit
edf5ef62b7
|
@ -177,7 +177,11 @@ function submitWritein(post_id) {
|
||||||
|
|
||||||
/* Helpers */
|
/* Helpers */
|
||||||
function padToTwo(number) {
|
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;
|
return number;
|
||||||
}
|
}
|
||||||
function strftime(date) {
|
function strftime(date) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user