Just get "Days Ago"
Closed this issue · 3 comments
HermanKayy commented
Is there a way to just get back "Days Ago"? For example if it's 7 days instead of it giving me back "1 week" ago it'll give me back 7 days ago. Instead of 1 month ago it'll give me back 30 days ago, etc.
lincolnthree commented
@HermanKayy Yes, you need to manually pass only the Day
time unit to the PrettyTime
configuration, after removing all others:
PrettyTime p = new PrettyTime();
p.clearUnits();
Day day = new Day();
p.registerUnit(day, new ResourcesTimeFormat(day));
p.format(new Date());
lincolnthree commented
Working on an easier API for this in Version 5.
lincolnthree commented
New API here: 0889435