Package com.webmethods.caf.faces.context
Class DateUtils
java.lang.Object
com.webmethods.caf.faces.context.DateUtils
Time and date utilities.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic String
getFormattedDate
(FacesContext context, Date date, String datePattern) Format the given date with the specified formatstatic String
getFormattedTime
(FacesContext context, Date date, String timePattern, String timezoneID) Format the given date with the specified formatstatic TimeZone
getTimeZone
(FacesContext context, UIComponent component) Time-zone to display date.static Calendar
getUserCalendar
(FacesContext context) Current user's preferred calendar.static DateFormat
getUserCustomFormat
(FacesContext context, String pattern) Current user's preferred locale & time-zone aware format for custom date-time pattern.static DateFormat
getUserDateFormat
(FacesContext context) Current user's preferred date format.static DateFormat
getUserDateTimeFormat
(FacesContext context) Current user's preferred date-time format.static DateFormat
getUserInputDateFormat
(FacesContext context) Current user's preferred format for inputing date.static String
getUserInputDatePattern
(FacesContext context) Current user's preferred pattern for inputing date.static DateFormat
getUserInputDateTimeFormat
(FacesContext context) Current user's preferred format for inputing date-time.static String
getUserInputDateTimePattern
(FacesContext context) Current user's preferred pattern for inputing date-time.static DateFormat
getUserInputTimeFormat
(FacesContext context) Current user's preferred format for inputing time.static String
getUserInputTimePattern
(FacesContext context) Current user's preferred pattern for inputing time.static Locale
getUserLocale
(FacesContext context) Current user's preferred locale if it matches one of the installed language packs.static DateFormat
getUserTimeFormat
(FacesContext context) Current user's preferred time format.static TimeZone
getUserTimeZone
(FacesContext context) Current user's preferred time-zone.static void
shutdown()
-
Field Details
-
DEFAULT_DATE_FORMAT_EXPRESSION
- See Also:
-
DEFAULT_TIME_FORMAT_EXPRESSION
- See Also:
-
DEFAULT_TIME_ZONE_EXPRESSION
- See Also:
-
-
Constructor Details
-
DateUtils
public DateUtils()
-
-
Method Details
-
shutdown
public static void shutdown() -
getUserLocale
Current user's preferred locale if it matches one of the installed language packs. Otherwise, returns the default locale. -
getUserTimeZone
Current user's preferred time-zone. -
getUserCalendar
Current user's preferred calendar. -
getUserDateTimeFormat
Current user's preferred date-time format. -
getUserDateFormat
Current user's preferred date format. -
getUserTimeFormat
Current user's preferred time format. -
getUserInputDateTimeFormat
Current user's preferred format for inputing date-time. -
getUserInputDateFormat
Current user's preferred format for inputing date. -
getUserInputTimeFormat
Current user's preferred format for inputing time. -
getUserCustomFormat
Current user's preferred locale & time-zone aware format for custom date-time pattern. -
getUserInputDateTimePattern
Current user's preferred pattern for inputing date-time. -
getUserInputDatePattern
Current user's preferred pattern for inputing date. -
getUserInputTimePattern
Current user's preferred pattern for inputing time. -
getFormattedDate
Format the given date with the specified format -
getFormattedTime
public static String getFormattedTime(FacesContext context, Date date, String timePattern, String timezoneID) Format the given date with the specified format -
getTimeZone
Time-zone to display date.
-