fix: made js more robust
This commit is contained in:
parent
9fe0905092
commit
c5fe34aebf
1 changed files with 2 additions and 7 deletions
|
|
@ -3,13 +3,8 @@ var AgeModule = (function () {
|
|||
return {
|
||||
age: function(prevdate, now, show_short_version, show_suffix, short_format) {
|
||||
|
||||
var prevdate = moment(prevdate);
|
||||
var now = now || moment().utc();
|
||||
|
||||
if (prevdate.isUTC() || now.isUTC()) {
|
||||
prevdate = prevdate.clone().utc();
|
||||
now = now.clone().utc();
|
||||
}
|
||||
var prevdate = moment(prevdate).utc();
|
||||
var now = now ? moment(now).utc() : moment().utc();
|
||||
|
||||
var show_short_version = show_short_version || false;
|
||||
var show_suffix = show_suffix || true;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue