| java.lang.Object org.jdesktop.swing.calendar.DateUtils
DateUtils | public class DateUtils (Code) | | author: Scott Violet version: $Revision: 1.1 $ |
Method Summary | |
public static long | addDays(long time, int amount) Adds amount days to time and returns
the resulting time. | public static Date | endOfDay(Date date) Returns the last millisecond of the specified date. | public static long | endOfDayInMillis(long date) Returns the last millisecond of the specified date. | public static int | getDayOfWeek(long date) Returns the day of the week. | public static int | getDaysDiff(long t1, long t2, boolean checkOverflow) Returns the number of days difference between t1 and
t2 . | public static int | getDaysDiff(long t1, long t2) Returns the number of days difference between t1 and
t2 . | public static long | getEndOfMonth(long date) Returns the date corresponding to the end of the month. | public static long | getNextDay(long date, int startOfWeek) Returns the first day after date that has the
day of week matching startOfWeek . | public static long | getNextMonth(long date) Returns the next month. | public static long | getPreviousDay(long date, int startOfWeek) Returns the first day before date that has the
day of week matching startOfWeek . | public static long | getPreviousMonth(long date) Returns the previous month. | public static long | getStartOfMonth(long date) Returns the date corresponding to the start of the month. | public static boolean | isFirstOfMonth(long date) | public static boolean | isFirstOfYear(long date) | public static Date | nextDay(Date date) Returns the day after date . | public static long | nextDay(long date) Returns the day after date . | public static long | nextWeek(long date) Returns the week after date . | public static long | previousDay(long date) Returns the day before date . | public static long | previousWeek(long date) Returns the week before date . | public static Date | startOfDay(Date date) Returns a new Date with the hours, milliseconds, seconds and minutes
set to 0. | public static long | startOfDayInMillis(long date) Returns day in millis with the hours, milliseconds, seconds and minutes
set to 0. |
addDays | public static long addDays(long time, int amount)(Code) | | Adds amount days to time and returns
the resulting time.
Parameters: time - Base time Parameters: amount - Amount of increment. |
endOfDay | public static Date endOfDay(Date date)(Code) | | Returns the last millisecond of the specified date.
Parameters: date - Date to calculate end of day from Last millisecond of date |
endOfDayInMillis | public static long endOfDayInMillis(long date)(Code) | | Returns the last millisecond of the specified date.
Parameters: date - long to calculate end of day from Last millisecond of date |
getDayOfWeek | public static int getDayOfWeek(long date)(Code) | | Returns the day of the week.
Parameters: date - date day of week. |
getDaysDiff | public static int getDaysDiff(long t1, long t2, boolean checkOverflow)(Code) | | Returns the number of days difference between t1 and
t2 .
Parameters: t1 - Time 1 Parameters: t2 - Time 2 Parameters: checkOverflow - indicates whether to check for overflow Number of days between start and end |
getDaysDiff | public static int getDaysDiff(long t1, long t2)(Code) | | Returns the number of days difference between t1 and
t2 .
Parameters: t1 - Time 1 Parameters: t2 - Time 2 Number of days between start and end |
getEndOfMonth | public static long getEndOfMonth(long date)(Code) | | Returns the date corresponding to the end of the month.
Parameters: date - Base date End of month. |
getNextDay | public static long getNextDay(long date, int startOfWeek)(Code) | | Returns the first day after date that has the
day of week matching startOfWeek . For example, if you
want to find the next monday relative to date you
would call getPreviousDay(date, Calendar.MONDAY) .
Parameters: date - Base date Parameters: startOfWeek - Calendar constant correspoding to start of week. start of week, return value will have 0 hours, 0 minutes,0 seconds and 0 ms. |
getNextMonth | public static long getNextMonth(long date)(Code) | | Returns the next month.
Parameters: date - Base date next month |
getPreviousDay | public static long getPreviousDay(long date, int startOfWeek)(Code) | | Returns the first day before date that has the
day of week matching startOfWeek . For example, if you
want to find the previous monday relative to date you
would call getPreviousDay(date, Calendar.MONDAY) .
Parameters: date - Base date Parameters: startOfWeek - Calendar constant correspoding to start of week. start of week, return value will have 0 hours, 0 minutes,0 seconds and 0 ms. |
getPreviousMonth | public static long getPreviousMonth(long date)(Code) | | Returns the previous month.
Parameters: date - Base date previous month |
getStartOfMonth | public static long getStartOfMonth(long date)(Code) | | Returns the date corresponding to the start of the month.
Parameters: date - Base date Start of month. |
isFirstOfMonth | public static boolean isFirstOfMonth(long date)(Code) | | |
isFirstOfYear | public static boolean isFirstOfYear(long date)(Code) | | |
nextDay | public static Date nextDay(Date date)(Code) | | Returns the day after date .
Parameters: date - Date used in calculating next day Day after date . |
nextDay | public static long nextDay(long date)(Code) | | Returns the day after date .
Parameters: date - Date used in calculating next day Day after date . |
nextWeek | public static long nextWeek(long date)(Code) | | Returns the week after date .
Parameters: date - Date used in calculating next week week after date . |
previousDay | public static long previousDay(long date)(Code) | | Returns the day before date .
Parameters: date - Date used in calculating previous day Day before date . |
previousWeek | public static long previousWeek(long date)(Code) | | Returns the week before date .
Parameters: date - Date used in calculating previous week week before date . |
startOfDay | public static Date startOfDay(Date date)(Code) | | Returns a new Date with the hours, milliseconds, seconds and minutes
set to 0.
Parameters: date - Date used in calculating start of day Start of date |
startOfDayInMillis | public static long startOfDayInMillis(long date)(Code) | | Returns day in millis with the hours, milliseconds, seconds and minutes
set to 0.
Parameters: date - long used in calculating start of day Start of date |
|
|