mirror of
https://github.com/scratchfoundation/jquery-timeago.git
synced 2025-02-19 19:04:37 -05:00
Added support for $.timeago to accept a millisecond UNIX epoch value
#78
This commit is contained in:
parent
e9aff9d663
commit
c3fca2db92
1 changed files with 2 additions and 0 deletions
|
@ -19,6 +19,8 @@
|
||||||
return inWords(timestamp);
|
return inWords(timestamp);
|
||||||
} else if (typeof timestamp === "string") {
|
} else if (typeof timestamp === "string") {
|
||||||
return inWords($.timeago.parse(timestamp));
|
return inWords($.timeago.parse(timestamp));
|
||||||
|
} else if (typeof timestamp === "number") {
|
||||||
|
return inWords(new Date(timestamp));
|
||||||
} else {
|
} else {
|
||||||
return inWords($.timeago.datetime(timestamp));
|
return inWords($.timeago.datetime(timestamp));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue