You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you change the direction to down and suffix to "from now" like mentioned on the website. This doesn't change any suffix at all. Becuase in plugin js file you are getting the suffix information from the "options.lang.suffix"
but this will cause another problem because the extend you use in plugin is not recursive. You also have to change this and pass true as first argument.
Hi
Ways mentioned in the documentation/website are wrong to set default options. Because if you do this
$.fn.timeago.defaults = {
selector: 'time.timeago',
attr: 'datetime',
dir: 'up',
suffix: 'ago'
};
this will replace whole default options written in the pluggin.js file.
You have to manually change single item like
$.fn.timeago.defaults.selector = 'abbr.timeago';
$.fn.timeago.defaults.attr = 'title';
This will do the trick.
Secondly
If you change the direction to down and suffix to "from now" like mentioned on the website. This doesn't change any suffix at all. Becuase in plugin js file you are getting the suffix information from the "options.lang.suffix"
To fix this either pass the suffix like
element.timeago({
dir: 'down',
lang : {
suffix: 'from now'
}
});
but this will cause another problem because the extend you use in plugin is not recursive. You also have to change this and pass true as first argument.
TimeAgo.prototype.init = function(element, options) {$.extend(true, {}, $ .fn.timeago.defaults, options);
this.$element = $(element);
this.options =
this.updateTime();
return this.startTimer();
};
Or you can change the plugin to change the location of suffix. Instead of taking this from lang you can place it outside lang.
Or you can add a separate prefix for future tense
The text was updated successfully, but these errors were encountered: