mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-08-14 02:26:55 -07:00
properly account for future/past dates when humanizing with moment
This commit is contained in:
parent
7059fe0419
commit
4c82f4d821
2 changed files with 8 additions and 2 deletions
|
@ -8,6 +8,12 @@
|
|||
return s;
|
||||
}
|
||||
|
||||
function Humanize(date) {
|
||||
var mNow = moment();
|
||||
var mDate = moment(date).local();
|
||||
return moment.duration(mNow - mDate).humanize() + (mNow.isBefore(mDate) ? ' from now' : ' ago');
|
||||
}
|
||||
|
||||
function generateNotify(message, type) {
|
||||
// type = danger, warning, info, successs
|
||||
$.notify({
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue