Date formatting with jQuery UI

If you're developing for a legacy CMS, you'll most likely need to change the way dates are formatted on the page. Using jQuery UI males this possible and here's how to do it!


<span class="date">06-Aug-2012</span>
<span class="date">2012/06/Aug</span>
<span class="date">Monday, August 06, 2012</span>


$(document).ready(function () {
$('').each(function() {
var dateFormat = $(this).text()
var dateFormat = $.datepicker.formatDate('MM dd, yy', new Date(dateFormat));
$(this).html(dateFormat + "<br>");

Date Formatting options: