Hi
The above posted code is really nice. The only one import line in this code which you have to go through.
Code:
nd = nd.replace(/(\d{2})\/(\d{2})\/(\d{4})/, "$2/$1/$3");
I am posting the code it is a simple example. Hope it may help you.
Code:
function cDate(nd)
{
//this is the symbol that separates months, days and years and you can set it to anything, just pick your separator
var separator = "/";
//puts mm, dd and yyyy into an array
var ndarr = nd.split(separator);
//saves each argument of the array into a string starting with the day
nd = ndarr[1] + separator + ndarr[0] + separator + ndarr[2];
return nd;
}
Bookmarks