It works as intended here:
Note that datepicker
is extension trough jQuery UI and as such you have to include it to work:
//code.jquery.com/ui/1.10.4/jquery-ui.js
Note that in example the var dateFormat
is renamed, so to not re-declare existing.
$(document).ready(function () {
$('span.date').each(function() {
var value = $(this).text(),
date = $.datepicker.formatDate(
'MM dd, yy', new Date(value)
);
$(this).html(date + "<br>");
});
});
Or you could say:
$(this).html(
$.datepicker.formatDate(
'MM dd, yy', new Date($(this).text())
) + "<br>"
);
Edit in regards to date format:
Ref. ECMA
Format can be
YYYY-MM-DD
but not
DD-MM-YYYY
Also read this.
Errors:
Running you page, it show's this error:
Uncaught TypeError: Object [object Object] has no method 'player' (index):343
By source that would be:
$(document).ready(function() {
var settings = {
progressbarWidth: '200px',
progressbarHeight: '5px',
progressbarColor: '#22ccff',
progressbarBGColor: '#eeeeee',
defaultVolume: 0.8
};
$(".player").player(settings); // <<--- Error line
});
This is a possible source of halting the script at load or the like.
It also gives, (This could be some Facebook issue):
Given URL is not allowed by the Application configuration.: One or more of the given URLs is not allowed by the App's settings. It must match the Website URL or Canvas URL, or the domain must be a subdomain of one of the App's domains.
The:
event.returnValue is deprecated. Please use the standard event.preventDefault() instead.
you can ignore as it is a jQuery "thing" and IE fix/hack.