Friday, 3 June 2016

English to marathi date convert


English to marathi date convert javascript

var marathiNumber = ["०","१","२","३","४","५","६","७","८","९"];
    function getMarathiDate(englishDate) {
      var englishDateArray = englishDate.split("");
      var marathiDate = "";
      englishDateArray.forEach(function(el) {
         if (isNaN(el) === false) {
           marathiDate +=  marathiNumber[el];
         } else {
           marathiDate += "-"
         }
      });
      return marathiDate;
    }

No comments:

Post a Comment