Package org.bedework.calfacade.util
Class BwDateTimeUtil
java.lang.Object
org.bedework.calfacade.util.BwDateTimeUtil
Date and time utilities
- Version:
- 1.0
- Author:
- Mike Douglass douglm - bedework.edu
-
Method Summary
Modifier and TypeMethodDescriptionstatic DategetDate(BwDateTime val) Get a java.util.Date object from the value XXX - this will neeed to be supplied with a tz repositorystatic DategetDate(BwDateTime val, net.fortuna.ical4j.model.TimeZoneRegistry tzreg) Get a java.util.Date object from the valuestatic BwDateTimegetDateTime(String date, boolean dateOnly, boolean floating, String tzid) Get a date object representing the given date and flagsstatic BwDateTimegetDateTime(Date date) Get a date/time object representing the given date and timestatic BwDateTimegetDateTimeUTC(String date) Get a date object representing the given String UTC date/timestatic BwTimeRangeGet a date/time range given by the rfc formatted parameters and limited to the given max range
-
Method Details
-
getDate
Get a java.util.Date object from the value XXX - this will neeed to be supplied with a tz repository- Parameters:
val- bw date time object- Returns:
- Date object representing the date
- Throws:
CalFacadeBadDateException- on bad date
-
getDate
public static Date getDate(BwDateTime val, net.fortuna.ical4j.model.TimeZoneRegistry tzreg) throws CalFacadeBadDateException Get a java.util.Date object from the value- Parameters:
val- bw date time objecttzreg- registry- Returns:
- Date object representing the date
- Throws:
CalFacadeBadDateException- on bad date
-
getDateTime
Get a date/time object representing the given date and time- Parameters:
date- Java Date object- Returns:
- BwDateTime object representing the date
-
getDateTime
Get a date object representing the given date and flags- Parameters:
date- String iso date or date/timedateOnly- true for date-only valuefloating- boolean true if this is a floating timetzid- - String tzid or null for default, UTC or floating.- Returns:
- Date object representing the date
- Throws:
RuntimeException- on timezone error or bad date
-
getDateTimeUTC
Get a date object representing the given String UTC date/time- Parameters:
date- UTC date time value- Returns:
- BwDateTime object representing the date
-
getPeriod
public static BwTimeRange getPeriod(String start, String end, int defaultField, int defaultVal, int maxField, int maxVal) throws CalFacadeException Get a date/time range given by the rfc formatted parameters and limited to the given max range- Parameters:
start- date or date/timeend- date or date/timedefaultField- Calendar field iddefaultVal- value for fieldmaxField- Calendar field idmaxVal- - 0 for no max- Returns:
- TimeRange or null for bad request
- Throws:
CalFacadeException- on bad date
-