Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/piotrmoskala/JTimeAgo
Library extends java.util.Date and provide methods to return "time ago"/"minutes ago"/"hours ago" date strings based on current date and date provided to JTimeAgo object. Work everywhere where Java ( Java, Scala, Android ) is available.
https://github.com/piotrmoskala/JTimeAgo
Last synced: 20 days ago
JSON representation
Library extends java.util.Date and provide methods to return "time ago"/"minutes ago"/"hours ago" date strings based on current date and date provided to JTimeAgo object. Work everywhere where Java ( Java, Scala, Android ) is available.
- Host: GitHub
- URL: https://github.com/piotrmoskala/JTimeAgo
- Owner: piotrmoskala
- Created: 2014-07-01T17:05:49.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2014-07-02T13:54:57.000Z (over 10 years ago)
- Last Synced: 2024-07-30T15:18:13.385Z (4 months ago)
- Language: Java
- Homepage:
- Size: 131 KB
- Stars: 17
- Watchers: 2
- Forks: 6
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## JTimeAgo - description
Java library based on Objective-clibrary
https://github.com/kevinlawler/NSDate-TimeAgo
It can be used everywhere where java is available.
## Sample usage
JTimeAgo extends java.util.Date class.
if you got date stored in Data object You can simply wrap it :
Date date = Calendar.getInstance().getTime();
JTimeAgo jTimeAgo = new JTimeAgo(date);and thats all you need, then you have to call a following method:
String time = jTimeAgo.getTimeAgo();
## Language support
For now English and Polish are only supported languages.
English is set as default
If you want to change language you can do it using provided constructor:JTimeAgo jTimeAgo = new JTimeAgo(LanguageType.EN);
JTimeAgo jTimeAgo = new JTimeAgo(new Date(), LanguageType.EN);or by calling
jTimeAgo.setLanguage(LanguageType.EN);