com.retek.commons.util
Class RDateUtility

java.lang.Object
  extended bycom.retek.commons.util.RDateUtility

public class RDateUtility
extends java.lang.Object

This utility is used by many of the GUI elements of the call center app to deal with RDate information, however, other aspects of the systme may use it as well.


Field Summary
static java.lang.String DATE_MILITARY_TIME_FORMAT_STRING
           
static java.lang.String INVALID_DATE
           
 
Constructor Summary
RDateUtility()
           
 
Method Summary
static boolean datesEqualAllowsNull(RDate date1, RDate date2)
          Checks if the two dates are equal.
static RDate getDate(java.util.Date date)
          Retrieves an Rdate object for a date object.
static RDate getDate(java.lang.String date)
          Retrieves an RDate object for a date string.
static RDate getDate(java.lang.String date, java.lang.String time)
          Retrieves an RDate for a a date and time string.
static java.lang.String getDateOnlyString(RDate date)
          Retrieves the date only portion of the date string.
static java.lang.String getExpirationDateWithLastDayOfMonth(java.lang.String originalDate)
          Retrieves an expiration date in the format YYYYMM as YYYYMMDD where DD is the last day of the month.
static java.lang.String getString(RDate date)
          Retrieves a formatted date string for an RDate object.
static java.lang.String getTimeOnlyString(RDate date)
          Retrieves the time only portion of the date string.
static java.lang.String getTimeZoneString(RDate date)
          Retrieves a formatted date and time zone string for an RDate object.
static java.lang.String getTimeZoneStringWithSeconds(RDate date)
          Retrieves a formatted date and time zone with seconds string for an RDate object.
static java.util.Date getUtilDate(RDate date)
          Converts an RDate to a standard util.Date.
static void setTimeZones(java.util.TimeZone newLocalZone, java.util.TimeZone newServerZone)
          Sets the time zones used by the date utility.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INVALID_DATE

public static final java.lang.String INVALID_DATE
See Also:
Constant Field Values

DATE_MILITARY_TIME_FORMAT_STRING

public static final java.lang.String DATE_MILITARY_TIME_FORMAT_STRING
See Also:
Constant Field Values
Constructor Detail

RDateUtility

public RDateUtility()
Method Detail

setTimeZones

public static void setTimeZones(java.util.TimeZone newLocalZone,
                                java.util.TimeZone newServerZone)
Sets the time zones used by the date utility.

Parameters:
newLocalZone - The timezone of the local client application. Null becomes default.
newServerZone - The timezone of the server application.

getDate

public static RDate getDate(java.lang.String date)
                     throws com.retek.swing11.util.UIException
Retrieves an RDate object for a date string. If the string is null or empty, null is returned.

Parameters:
date - A string representing a date.
Returns:
The RDate object for the string.
Throws:
com.retek.swing11.util.UIException

getDate

public static RDate getDate(java.util.Date date)
Retrieves an Rdate object for a date object. If the date is null, then null is returned.

Parameters:
date - A date object.
Returns:
An RDate object.

getDate

public static RDate getDate(java.lang.String date,
                            java.lang.String time)
                     throws com.retek.swing11.util.UIException
Retrieves an RDate for a a date and time string. The time string must be in the format [hh:mmAM]. A UIException is thrown if the text is not in the valid format.

Parameters:
date - The date string.
time - The time string.
Throws:
com.retek.swing11.util.UIException

getString

public static java.lang.String getString(RDate date)
Retrieves a formatted date string for an RDate object. If the date is null, an empty string is returned.


getTimeZoneString

public static java.lang.String getTimeZoneString(RDate date)
Retrieves a formatted date and time zone string for an RDate object. If the date is null, an empty string is returned.


getTimeZoneStringWithSeconds

public static java.lang.String getTimeZoneStringWithSeconds(RDate date)
Retrieves a formatted date and time zone with seconds string for an RDate object. If the date is null, an empty string is returned.


datesEqualAllowsNull

public static boolean datesEqualAllowsNull(RDate date1,
                                           RDate date2)
Checks if the two dates are equal. If both are null, true is returned.


getDateOnlyString

public static java.lang.String getDateOnlyString(RDate date)
Retrieves the date only portion of the date string. This is identical to getString().


getTimeOnlyString

public static java.lang.String getTimeOnlyString(RDate date)
Retrieves the time only portion of the date string. This is identical to getString().


getUtilDate

public static java.util.Date getUtilDate(RDate date)
Converts an RDate to a standard util.Date. A null value produces a null value.


getExpirationDateWithLastDayOfMonth

public static java.lang.String getExpirationDateWithLastDayOfMonth(java.lang.String originalDate)
Retrieves an expiration date in the format YYYYMM as YYYYMMDD where DD is the last day of the month.



Copyright © 2005 Retek Inc. All Rights Reserved. - Generated at Fri, 01/21/2005 14:25