when working with date object in JavaScript,
Moment.js[
^] would be your best friend ...
here is the example
JsFiddle[
^]
var dateString = "25/7/2014";
var date = moment(dateString, "DD/M/YYYY");
dateString = date.format("DD/MM/YYYY");
alert(dateString);