public class TimeHelper extends Object
Constructor and Description |
---|
TimeHelper() |
Modifier and Type | Method and Description |
---|---|
static boolean |
betweenInDay(Date date,
Date start,
Date end)
check id a date in between two other date, but date in range.
|
static Calendar |
convertEndOfDay(Calendar cal) |
static Calendar |
convertRemoveAfterDay(Calendar cal) |
static Calendar |
convertRemoveAfterHour(Calendar cal) |
static Calendar |
convertRemoveAfterMinutes(Calendar cal) |
static Calendar |
convertRemoveAfterMonth(Calendar cal) |
static String |
exportAgenda(ContentContext ctx,
MenuElement agendaPage,
Date startDate,
Date endDate) |
static int |
getAge(Date born) |
static int |
getDaysDistance(Date date1,
Date date2)
get the distance between 2 dates in day
|
static DateFormat |
getDefaultDateFormat(ContentContext ctx)
return the date format defined in the system, depend of rendering mode,
globalContext config or default java config.
|
static boolean |
isAfterOrEqualForDay(Date date,
Date ref)
check if date is after other date, if the day is the same it is ok.
|
static boolean |
isBeforeForDay(Date date,
Date ref)
check if date is after other date, if the day is the same it is ok.
|
static boolean |
isBeforeOrEqualForDay(Date date,
Date ref)
check if date is after other date, if the day is the same it is ok.
|
static boolean |
isEqualForDay(Date date,
Date ref)
check if date is after other date, if the day is the same it is ok.
|
static Date |
toStartWeek(Date date)
set the date at the first day of the week.
|
public static final Date NO_DATE
public static Date toStartWeek(Date date)
date
- public static boolean isAfterOrEqualForDay(Date date, Date ref)
public static boolean isBeforeOrEqualForDay(Date date, Date ref)
public static boolean isBeforeForDay(Date date, Date ref)
public static boolean isEqualForDay(Date date, Date ref)
public static boolean betweenInDay(Date date, Date start, Date end)
date
- start
- end
- public static DateFormat getDefaultDateFormat(ContentContext ctx) throws FileNotFoundException, IOException
ctx
- current contentIOException
FileNotFoundException
public static String exportAgenda(ContentContext ctx, MenuElement agendaPage, Date startDate, Date endDate) throws Exception
Exception
public static int getDaysDistance(Date date1, Date date2)
date1
- date2
- public static int getAge(Date born)
Copyright © 2012-2018. All Rights Reserved.