|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectfr.paris.lutece.plugins.calendar.service.Utils
public final class Utils
This class provides utils features to manipulate and convert calendars, date as string, ...
Constructor Summary | |
---|---|
Utils()
|
Method Summary | |
---|---|
static java.lang.String |
getDate(java.util.Calendar calendar)
Constructs a 8 digits date string YYYYMMDD |
static java.lang.String |
getDate(int nYear,
int nMonth,
int nDay)
Constructs a 8 digits date string code YYYYMMDD |
static java.lang.String |
getDateToday()
Returns a the date code of today |
static int |
getDay(java.lang.String strDate)
Returns the day of month from a date code |
static java.lang.String |
getDayLabel(java.lang.String strDate,
java.util.Locale locale)
Returns the day as an international formatted string corresponding to the date code |
static java.util.Calendar |
getFirstDayOfWeek(java.lang.String strDate)
Returns the first monday of a week as a formatted string corresponding to the date code |
static int |
getMonth(java.lang.String strDate)
Returns the month from a date code |
static java.lang.String |
getMonthLabel(java.lang.String strDate,
java.util.Locale locale)
Returns the month as a formatted string corresponding to the date code |
static java.lang.String |
getNextDay(java.lang.String strDate)
Returns a date code corresponding to a calendar roll of one day forward |
static java.lang.String |
getNextMonth(java.lang.String strDate)
Returns a date code corresponding to a calendar roll of one month |
static java.lang.String |
getNextWeek(java.lang.String strDate)
Returns a date code corresponding to a calendar roll of one week forward |
static java.lang.String |
getPreviousDay(java.lang.String strDate)
Returns a date code corresponding to a calendar roll of one day backward |
static java.lang.String |
getPreviousMonth(java.lang.String strDate)
Returns a date code corresponding to a calendar roll of one month backward |
static java.lang.String |
getPreviousWeek(java.lang.String strDate)
Returns a date code corresponding to a calendar roll of one week backward |
static java.lang.String |
getWeekDayLabel(java.lang.String strDate,
java.util.Locale locale)
Returns the day as an international formatted string corresponding to the date code |
static java.lang.String |
getWeekLabel(java.lang.String strDate,
java.util.Locale locale)
Returns the Week as a formatted string corresponding to the date code |
static int |
getYear(java.lang.String strDate)
Returns the year from a date code |
static boolean |
isDayOff(java.util.Calendar calendar)
Checks if the day if Off (ie: Sunday) or not |
static boolean |
isValid(java.lang.String strDate)
Checks a date code |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Utils()
Method Detail |
---|
public static java.lang.String getDate(int nYear, int nMonth, int nDay)
nYear
- The YearnMonth
- The month index (0-11)nDay
- The day of the month (1-31)
public static java.lang.String getDate(java.util.Calendar calendar)
calendar
- A calendar positionned on the date
public static java.lang.String getDateToday()
public static int getYear(java.lang.String strDate)
strDate
- The date code
public static int getMonth(java.lang.String strDate)
strDate
- The date code
public static int getDay(java.lang.String strDate)
strDate
- The date code
public static java.lang.String getMonthLabel(java.lang.String strDate, java.util.Locale locale)
strDate
- The date code
public static java.lang.String getWeekLabel(java.lang.String strDate, java.util.Locale locale)
strDate
- The date code
public static java.util.Calendar getFirstDayOfWeek(java.lang.String strDate)
strDate
- The date code
public static java.lang.String getDayLabel(java.lang.String strDate, java.util.Locale locale)
strDate
- The date code
public static java.lang.String getWeekDayLabel(java.lang.String strDate, java.util.Locale locale)
strDate
- The date code
public static java.lang.String getNextMonth(java.lang.String strDate)
strDate
- The date code
public static java.lang.String getPreviousMonth(java.lang.String strDate)
strDate
- The date code
public static java.lang.String getPreviousWeek(java.lang.String strDate)
strDate
- The date code
public static java.lang.String getNextWeek(java.lang.String strDate)
strDate
- The date code
public static java.lang.String getNextDay(java.lang.String strDate)
strDate
- The date code
public static java.lang.String getPreviousDay(java.lang.String strDate)
strDate
- The date code
public static boolean isValid(java.lang.String strDate)
strDate
- The date code
public static boolean isDayOff(java.util.Calendar calendar)
calendar
- A calendar object positionned on the day to check
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |