curioustechizen / android-ago

An Android TextView that always displays an auto refreshing relative time span with respect to a reference time

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add support for reference time in future.

Giorgi opened this issue · comments

It would be nice if it supported future reference times as well.

@Giorgi that is already supported (it is in fact a feature of the DateUtils class provided by Android). If you specify a reference time in the future, the text displays stings like "tomorrow", "in 2 mins" etc. These are auto-refreshed only as frequently as needed (just like the case where the timestamp is in the past).

I will update the sample app to reflect this. Meanwhile, if there is anything specific that you tried and had issues with, please let me know.

@curioustechizen Thanks for your answer. As the feature is already supported I'll close the issue. I guess a screenshot would be helpful so that others are not confused either.

@curioustechizen its not showing tomorrow instead shows number of hours, for instance if date in 29/3/2018 at 3:40pm and today is 28/3/2018 2:40pm, the text rendered is "In 23 hrs" instead of tomorrow. Can you please verify this?

@niharikasah If I remember correctly, if the date is more than 24 hours in the future, it shows as "tomorrow". You can see this in the sample.
This is a feature of the DateUtils API that is used by this library.