twitter-style outputs year for some same-year timestamps
hossameldeen opened this issue · comments
Hossam El-Deen commented
import TimeAgo from 'javascript-time-ago';
import en from 'javascript-time-ago/locale/en';
TimeAgo.addLocale(en);
const jsTimeAgo = new TimeAgo('en-US');
console.log(jsTimeAgo.format(1555549347000, 'twitter'));
Expected: Apr 18.
Actual: Apr 18, 2019.
Note: It doesn't shows the year for all same-year dates, though. For example, it correctly doesn't show the year for Oct 18
and Oct 18
.
Version: 2.0.1
Nikolay commented
Released javascript-time-ago@2.0.3
.
Hossam El-Deen commented
Thank you 👍
Haven't tried it yet, but will tell you if there's a problem.