jalali-moment.js
function leftZeroFill(number, targetLength) {
    var output = number + "";
    while (output.length < targetLength){
        output = "0" + output;
    }
    return output;
}
function leftZeroFill(number, targetLength) {
    var output = number + "";
    while (output.length < targetLength){
        output = "0" + output;
    }
    return output;
}
function leftZeroFill ( number , targetLength ) { var output = number + "" ; while ( output . length < targetLength ) { output = "0" + output ; } return output ; }
return a string which length is as much as you need
@param {number} number input
@param {number} targetLength expected length
@example leftZeroFill(5,2) => 05
return a string which length is as much as you need