Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Text format has extra charcters in it #62

Open
latheesh123 opened this issue Aug 17, 2018 · 2 comments
Open

Text format has extra charcters in it #62

latheesh123 opened this issue Aug 17, 2018 · 2 comments

Comments

@latheesh123
Copy link

When text is displaying it is showing 21 hrs. ago instead of 21 hrs ago. Is there a way to get rid of " . "

@curioustechizen
Copy link
Owner

This seems to be a change in the implementation of the underlying DateUtils method in Android. If you see the screenshot I posted in the README, it shows 15 mins ago (I don't remember what API version this was). The same example when I run on API 25 emulator shows 15 min. ago.

I'm guessing Android changed the implementation of DateUtils to add the . after abbreviated words like min and hrs when the flag FORMAT_ABBREV_RELATIVE is used.

If I remove the flag from here, and set it to 0, then I see 15 minutes ago, 3 hours ago etc.

Unfortunately, it is not easy to override the implementation of DateUtils class. I will consider exposing the flags so you can control whether you want to see the abbreviation or not.

For now I don't have any work-around for you, other than to search for hrs. and remove the . manually but this is error-prone.

@latheesh123
Copy link
Author

its occurring for only hrs and min but for days and months its working fine. I am working on emulator with API 27.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants