public class PacUtilsDateTime extends Object
Modifier and Type | Class and Description |
---|---|
static class |
PacUtilsDateTime.PacDateTimeInputException
Validation errors on input to
weekdayRange() ,
timeRange() and dateRange() . |
Modifier and Type | Field and Description |
---|---|
static List<String> |
MONTH_NAMES
List of valid month names as used in the Netscape specification.
|
static List<String> |
WEEKDAY_NAMES
List of valid weekday names as used in the Netscape specification.
|
Constructor and Description |
---|
PacUtilsDateTime() |
Modifier and Type | Method and Description |
---|---|
static int |
getNoOfParams(Object... objs)
Gets the number of true arguments passed to a JavaScript
function.
|
static boolean |
isInDateRange(Date now,
Object... args)
Evaluates if now is within a date range.
|
static boolean |
isInTimeRange(Date now,
Object... args)
Evaluates if now is within a time range.
|
static boolean |
isInWeekdayRange(Date now,
Object... args)
Evaluates if now is within a weekday range.
|
static boolean |
usesGMT(Object... args)
Evaluates if the last parameter of a parameter array is "GMT".
|
public static final List<String> WEEKDAY_NAMES
Content: SUN MON TUE WED THU FRI SAT
public static boolean isInWeekdayRange(Date now, Object... args) throws PacUtilsDateTime.PacDateTimeInputException
PacHelperMethodsNetscape.weekdayRange(Object...)
now
- args
- PacUtilsDateTime.PacDateTimeInputException
- if arguments were invalidpublic static boolean isInTimeRange(Date now, Object... args) throws PacUtilsDateTime.PacDateTimeInputException
PacHelperMethodsNetscape.timeRange(Object...)
now
- args
- PacUtilsDateTime.PacDateTimeInputException
- if arguments were invalidpublic static boolean isInDateRange(Date now, Object... args) throws PacUtilsDateTime.PacDateTimeInputException
PacHelperMethodsNetscape.dateRange(Object...)
now
- args
- argumentsPacUtilsDateTime.PacDateTimeInputException
- if arguments were invalidpublic static int getNoOfParams(Object... objs)
Number
or CharSequence
.
This is a convenience method useful when implementing
dateRange()
,
timeRange()
or
weekdayRange()
Note: In some engines, JavaScript function arguments that are not used in the
call will have a type of Undefined
.
objs
- public static boolean usesGMT(Object... args)
args
- parameters