mirror of
https://github.com/scratchfoundation/jquery-timeago.git
synced 2024-12-03 20:41:05 -05:00
16 lines
543 B
JavaScript
16 lines
543 B
JavaScript
var zeropad = function (num) {
|
|
return ((num < 10) ? '0' : '') + num;
|
|
};
|
|
var iso8601 = function (date) {
|
|
return date.getUTCFullYear()
|
|
+ "-" + zeropad(date.getUTCMonth()+1)
|
|
+ "-" + zeropad(date.getUTCDate())
|
|
+ "T" + zeropad(date.getUTCHours())
|
|
+ ":" + zeropad(date.getUTCMinutes())
|
|
+ ":" + zeropad(date.getUTCSeconds()) + "Z";
|
|
};
|
|
|
|
jQuery(document).ready(function($) {
|
|
$('abbr[class*=loaded]').attr("title", iso8601(new Date()));
|
|
$('abbr[class*=modified]').attr("title", iso8601(new Date(document.lastModified)));
|
|
});
|