Simple java library for displaying dates as relative time ago language.
- 4 days ago
- 15 years ago
- a minute ago
- just now
Gradle:
compile 'com.github.marlonlom:timeago:2.0.0'
Maven:
<dependency>
<groupId>com.github.marlonlom</groupId>
<artifactId>timeago</artifactId>
<version>2.0.0</version>
</dependency>
/** using java.util.Date*/
TimeAgo.from(new java.util.Date().getTime());
/** using java.util.Calendar*/
TimeAgo.from(java.util.Calendar.getInstance().getTime().getTime());
Locale LocaleBylanguageTag = Locale.forLanguageTag("es");
TimeAgoMessages messages = new TimeAgoMessages.Builder().withLocale(LocaleBylanguageTag).build();
TimeAgo.from(new java.util.Date().getTime(), messages);
Check the Demo here.
##Spread the word
If you like this library, please tell others about it ๐๐
- Follow me on Twitter: @Marlonlom
- Contact me on LinkedIn: Marlonlom
###License
Copyright 2016 marlonlom
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.