public class DateService extends Object
| Constructor and Description |
|---|
DateService() |
| Modifier and Type | Method and Description |
|---|---|
int |
getAge(java.time.LocalDateTime birthDate)
Calculate the age.
|
double |
getPercentageBetweenDates(java.time.LocalDateTime start,
java.time.LocalDateTime end)
Calculate the percentage of days passed between the start and end date.
|
boolean |
isPast(java.time.LocalDateTime date)
Check if a date lies in the past.
|
boolean |
isSameDay(java.time.LocalDateTime date1,
java.time.LocalDateTime date2)
Check if two dates represent the same day
|
boolean |
isToday(java.time.LocalDateTime date)
Check if the date is today.
|
@Autowired private Date date
public boolean isSameDay(java.time.LocalDateTime date1,
java.time.LocalDateTime date2)
date1 - date2 - public boolean isToday(java.time.LocalDateTime date)
date - public boolean isPast(java.time.LocalDateTime date)
date - to be checked.public int getAge(java.time.LocalDateTime birthDate)
birthDate - public double getPercentageBetweenDates(java.time.LocalDateTime start,
java.time.LocalDateTime end)
start - dateend - dateCopyright © 2011-2018 Sahits GmbH. All Rights Reserved.