com.ideo.sweetdevria.util
Class DateUtils

java.lang.Object
  extended by com.ideo.sweetdevria.util.DateUtils

public class DateUtils
extends java.lang.Object

Utility class for Date conversion.


Method Summary
static java.util.Date getDateFromCalendar(java.lang.String calendarValue, javax.servlet.http.HttpServletRequest request)
          Get date from a calendar field.
static java.util.Date getDateFromCalendar(java.lang.String yearValue, java.lang.String monthValue, java.lang.String dayValue)
          Get date from a calendar field.
static java.util.Date[] getDatesFromCalendar(java.lang.String calendarValue, javax.servlet.http.HttpServletRequest request)
          Get dates from a calendar field.
static java.util.Date[] parse(java.lang.String[] datesToParse, javax.servlet.http.HttpServletRequest request)
          Parse dates, according to date format from configuration file.
static java.lang.String[] split(java.lang.String preselect, javax.servlet.http.HttpServletRequest request)
          Split an array of date, according to multi-date-separator from configuration file.
static java.lang.String[] toString(java.util.Date[] dates, javax.servlet.http.HttpServletRequest request)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

split

public static java.lang.String[] split(java.lang.String preselect,
                                       javax.servlet.http.HttpServletRequest request)
Split an array of date, according to multi-date-separator from configuration file.

Parameters:
preselect - Dates, split by multi-date-separator.
request - An HTTP Servlet request to get internalization from.
Returns:
Array of string representing dates.

parse

public static java.util.Date[] parse(java.lang.String[] datesToParse,
                                     javax.servlet.http.HttpServletRequest request)
                              throws java.text.ParseException
Parse dates, according to date format from configuration file.

Parameters:
datesToParse - Dates String representation.
request - An HTTP Servlet request to get internalization from.
Returns:
Sorted array of dates.
Throws:
java.text.ParseException

toString

public static java.lang.String[] toString(java.util.Date[] dates,
                                          javax.servlet.http.HttpServletRequest request)

getDateFromCalendar

public static java.util.Date getDateFromCalendar(java.lang.String calendarValue,
                                                 javax.servlet.http.HttpServletRequest request)
                                          throws java.text.ParseException
Get date from a calendar field.

Parameters:
calendarValue - Date String representation.
request - An HTTP Servlet request to get internalization from.
Returns:
The selected Date.
Throws:
java.text.ParseException

getDateFromCalendar

public static java.util.Date getDateFromCalendar(java.lang.String yearValue,
                                                 java.lang.String monthValue,
                                                 java.lang.String dayValue)
                                          throws java.text.ParseException
Get date from a calendar field.

Parameters:
yearValue - Year.
monthValue - Month.
dayValue - Day.
Returns:
The selected Date.
Throws:
java.text.ParseException

getDatesFromCalendar

public static java.util.Date[] getDatesFromCalendar(java.lang.String calendarValue,
                                                    javax.servlet.http.HttpServletRequest request)
                                             throws java.text.ParseException
Get dates from a calendar field.

Parameters:
calendarValue - Dates String representations.
request - An HTTP Servlet request to get internalization from.
Returns:
Array of selected dates.
Throws:
java.text.ParseException


Copyright © 2010 Ideo Technologies. All Rights Reserved.