mirror of
https://github.com/scratchfoundation/jquery-timeago.git
synced 2024-11-23 15:57:54 -05:00
17 lines
543 B
JavaScript
17 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)));
|
||
|
});
|