Skip to content

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.

Notifications You must be signed in to change notification settings

piotrmoskala/JTimeAgo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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);

About

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.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages