Se invece vuoi usare i metodi delle istanze di Date per scegliere il formato puoi fare qualcosa del genere. In questo esempio ho usato toLocaleDateString()…
codice:<!doctype html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title>Esempio</title> <script type="text/javascript"> onload = function () { for ( var aDate, nIdx = 0, aLabels = document.querySelectorAll("label.data"); nIdx < aLabels.length; aLabels[nIdx].innerHTML = (new (Function.prototype.bind.apply(Date, [null].concat(aLabels[nIdx++].innerHTML.split("-"))))()).toLocaleDateString() ); }; </script> </head> <body> <form method="get" action="gestione"> <input type="radio" name="gruppo" id="data1" value="1" /> <label for="data1" class="data">2013-02-13</label> </p> <input type="radio" name="gruppo" id="data2" value="2" /> <label for="data2" class="data">2013-03-30</label> </p> <input type="submit" name="Submit" value="Visualizza" /></p> </form> </body> </html>![]()

Rispondi quotando