public class PeriodDates extends Object implements Serializable
Constructor and Description |
---|
PeriodDates() |
PeriodDates(Calendar fromCalendar,
Calendar thruCalendar) |
PeriodDates(Date fromDate,
Date thruDate) |
Modifier and Type | Method and Description |
---|---|
boolean |
afterBegin(Calendar calendar) |
boolean |
afterBegin(Date date) |
boolean |
afterEnd(Calendar calendar) |
boolean |
afterEnd(Date date) |
boolean |
beforeEnd(Calendar calendar) |
boolean |
beforeEnd(Date date) |
boolean |
between(Calendar calendar) |
boolean |
between(Date date) |
static PeriodDates |
createMonthsPeriodFromToday(int monthAfter)
Create a period from the date of today.
|
List<String> |
getFormatedMonths() |
Date |
getFromDate() |
int |
getFromMonth() |
List<Date> |
getMonths() |
String |
getPattern() |
Date |
getThruDate() |
void |
initDayOfMonthExtremities()
Set first day of month for dateFrom and last day of month for dateThru
|
void |
setFromDate(Date fromDate) |
void |
setPattern(String pattern) |
void |
setThruDate(Date thruDate) |
String |
toString() |
public PeriodDates()
public PeriodDates(Date fromDate, Date thruDate) throws IllegalArgumentException
IllegalArgumentException
public PeriodDates(Calendar fromCalendar, Calendar thruCalendar) throws IllegalArgumentException
IllegalArgumentException
public static PeriodDates createMonthsPeriodFromToday(int monthAfter)
Ex 1 : Today = 12/05/2009 monthAfter = 5 Period = 01/05/2009 to 31/10/2009 Ex 2 : Today = 12/05/2009 monthAfter = -4 Period = 01/01/2009 to 31/05/2009
monthAfter
- the number of month from the current onepublic String getPattern()
public void setPattern(String pattern)
public void initDayOfMonthExtremities()
public void setFromDate(Date fromDate)
public Date getFromDate()
public int getFromMonth()
public void setThruDate(Date thruDate)
public Date getThruDate()
public boolean beforeEnd(Calendar calendar)
public boolean afterEnd(Calendar calendar)
public boolean afterBegin(Calendar calendar)
public boolean between(Calendar calendar)
public boolean beforeEnd(Date date)
public boolean afterEnd(Date date)
public boolean afterBegin(Date date)
public boolean between(Date date)
Copyright © 2004–2020 CodeLutin. All rights reserved.