VRFS-450 format timestamp in sidebar
This commit is contained in:
parent
514e91315d
commit
470b5e8455
|
|
@ -112,7 +112,7 @@
|
|||
notificationId: val.notification_id,
|
||||
avatar_url: context.JK.resolveAvatarUrl(val.photo_url),
|
||||
text: val.formatted_msg,
|
||||
date: val.created_at
|
||||
date: context.JK.formatDate(val.created_at)
|
||||
});
|
||||
|
||||
$('#sidebar-notification-list').append(notificationHtml);
|
||||
|
|
@ -309,7 +309,7 @@
|
|||
"id": payload.notification_id,
|
||||
"photo_url": payload.photo_url,
|
||||
"formatted_msg": payload.msg,
|
||||
"created_at": payload.created_at
|
||||
"created_at": context.JK.formatDate(payload.created_at)
|
||||
};
|
||||
|
||||
incrementNotificationCount();
|
||||
|
|
@ -319,7 +319,7 @@
|
|||
notificationId: payload.notification_id,
|
||||
avatar_url: context.JK.resolveAvatarUrl(payload.photo_url),
|
||||
text: payload.msg,
|
||||
date: payload.created_at
|
||||
date: context.JK.formatDate(payload.created_at)
|
||||
});
|
||||
|
||||
$('#sidebar-notification-list').prepend(notificationHtml);
|
||||
|
|
|
|||
|
|
@ -146,6 +146,20 @@
|
|||
});
|
||||
}
|
||||
|
||||
context.JK.padString = function(str, max) {
|
||||
var retVal = '' + str;
|
||||
while (retVal.length < max) {
|
||||
retVal = '0' + retVal;
|
||||
}
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
context.JK.formatDate = function(dateString) {
|
||||
var date = new Date(dateString);
|
||||
return date.getFullYear() + "-" + context.JK.padString(date.getMonth(), 2) + "-" + context.JK.padString(date.getDate(), 2) + " @ " + date.toLocaleTimeString();
|
||||
}
|
||||
|
||||
context.JK.search = function(query, app, callback) {
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
|
|
|
|||
Loading…
Reference in New Issue