regex - Changing date strings with jQuery and Regexp -


what kind of code should use jquery looks every yyyy-mm-dd formatted (plain text) string on page , replaces dd-mm-yyyy?

thanks lot!

that might work:

$(document.body).contents().each(function(i,e) {     $(e).text(function(i,text) {         return text.replace(/(\d+)-(\d+)-(\d+)/g, function($full, $year, $month, $day) {             return [$day, $month, $year].join('-');         });     }); }); 

example: http://www.jsfiddle.net/jm2uq/


Comments

Popular posts from this blog

android - Spacing between the stars of a rating bar? -

aspxgridview - Devexpress grid - header filter does not work if column is initially hidden -

c# - How to execute a particular part of code asynchronously in a class -