Monday, 15 May 2017

How to highlight Responsive Calendar Start Day?

I am using express handlebars as templating engine in node js. i have written helpers for handlebars in app.js. How can i pass parameters to these helpers from hbs file.

   helpers: {
    ifCondition : function (value, value2) {
        if(value == value2){
            return "selected";
        }else{
            return value + '/ '+ value2;
        }
    },
    formatNumber : function (number, limit){
        var formattedNum = number.toString().replace(/[^0-9.]/g, "");
        formattedNum = formattedNum.replace(/(\r\n|\n|\r)/gm," ");
        formattedNum = formattedNum.replace(/\s+/g," ");

        if(formattedNum){
            return formattedNum = '00971'+ formattedNum.substring(formattedNum.length-limit, formattedNum.length);
        }else{
            return '---';
        }
    }

},



via Awais Nawaz

No comments:

Post a Comment