pranathi27
asked on
Added 2 digits year and adding slashes
hi
i need code which converts 2 digits years to 4 digit years and also add slashes to that date using java script.
i need code which converts 2 digits years to 4 digit years and also add slashes to that date using java script.
ASKER
this is the function i have which adds slashes to 4 digit year.but i need to add some code to this function so that it will convert 2 digit year to 4 digits and also slashes.
function abcd(dd)
{
if (dd.value != "")
{
var md = dd.value;
if ((md.length == 8) && (md.indexOf("/") == -1) && (md.indexOf("-") == -1))
{
dd.value = md.substring(0,2) + "/" + md.substring(2,4) + "/" + md.substring(4,8);
}
}
please help
function abcd(dd)
{
if (dd.value != "")
{
var md = dd.value;
if ((md.length == 8) && (md.indexOf("/") == -1) && (md.indexOf("-") == -1))
{
dd.value = md.substring(0,2) + "/" + md.substring(2,4) + "/" + md.substring(4,8);
}
}
please help
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
thanks alot Jester!!!!
glad i could help
thanks for the points
thanks for the points
https://www.experts-exchange.com/questions/21899771/convert-2-digit-year-to-4-digit.html