[#369] fix invalid date in Firefox

This commit is contained in:
Alexander Machehin 2015-02-04 17:44:59 +05:00
parent b245c2a808
commit c93696f269
1 changed files with 3 additions and 3 deletions

View File

@ -56,13 +56,13 @@ $(document).ready(function() {
var clip = new ZeroClipboard($("#copy_to_clipboard")); var clip = new ZeroClipboard($("#copy_to_clipboard"));
$('.datetime_moment').each(function() { $('.datetime_moment').each(function() {
var mtime = moment($(this).attr('origin_datetime')).utc().format('YYYY-MM-DD HH:mm:ss UTC'); var mtime = moment($(this).attr('origin_datetime'), 'YYYY-MM-DD HH:mm Z');
$(this).attr('title', mtime); $(this).attr('title', mtime.utc().format('YYYY-MM-DD HH:mm:ss UTC'));
}); });
window.updateTime = function () { window.updateTime = function () {
$('.datetime_moment').each(function() { $('.datetime_moment').each(function() {
var time = moment($(this).attr('origin_datetime')); var time = moment($(this).attr('origin_datetime'), 'YYYY-MM-DD HH:mm Z');
$(this).html(time.format('D MMM YYYY, HH:mm') + ' (' + time.fromNow() + ')'); $(this).html(time.format('D MMM YYYY, HH:mm') + ' (' + time.fromNow() + ')');
}); });
}; };