org.jbpm.console.ng.ht.client.util
Constructor and Description |
---|
DateUtils() |
Modifier and Type | Method and Description |
---|---|
static boolean |
areDatesEqual(Date firstDate,
Date secondDate)
Determines if two dates are equal based only on day, month and year.
|
static int |
compareDates(Date firstDate,
Date secondDate)
Compares two dates based only on day, month and year.
|
static Date |
createDate(String dateString)
Creates new
Date object using default format - "yyyy-MM-dd" (e.g. 2013-04-25). |
static Date |
createDate(String dateString,
String dateFormat)
Creates new
Date object from specified date string and date format. |
static DateRange |
getMonthDateRange(Date date)
Returns a
DateRange starting on first day of month in which the specified date is and ending on last day of that
month. |
static Date |
getSameOrClosestDateInNextMonth(Date date) |
static Date |
getSameOrClosestDateInPreviousMonth(Date date) |
static DateRange |
getWeekDateRange(Date date) |
static DateRange |
getWorkWeekDateRange(Date date)
Returns a
DateRange starting on first working day of week in which the specified date is and ending on last
working day (Friday) of that week. |
static boolean |
isDateInRange(Date date,
DateRange dateRange)
Determines if the specified date is within the specified range.
|
public static Date createDate(String dateString)
Date
object using default format - "yyyy-MM-dd" (e.g. 2013-04-25).dateString
- string representation of dateDate
create from string representationpublic static Date createDate(String dateString, String dateFormat)
Date
object from specified date string and date format.dateString
- string representationdateFormat
- format of the dateDate
create from string representationpublic static DateRange getWorkWeekDateRange(Date date)
DateRange
starting on first working day of week in which the specified date is and ending on last
working day (Friday) of that week. Total of 5 days are returned.date
- date from which to get the week date rangeDateRange
representing the week in which the specified date ispublic static DateRange getMonthDateRange(Date date)
DateRange
starting on first day of month in which the specified date is and ending on last day of that
month.date
- date from which to get the month date rangeDateRange
representing the month in which the specified date ispublic static boolean isDateInRange(Date date, DateRange dateRange)
date
- the date to testdateRange
- date range to be tested withpublic static int compareDates(Date firstDate, Date secondDate)
firstDate
- first datesecondDate
- second datepublic static boolean areDatesEqual(Date firstDate, Date secondDate)
firstDate
- first datesecondDate
- second datepublic static Date getSameOrClosestDateInPreviousMonth(Date date)
Copyright © 2001-2013 JBoss by Red Hat. All Rights Reserved.