org.sakaiproject.jsf.model
Class DateModel

java.lang.Object
  extended byorg.sakaiproject.jsf.model.DateModel
All Implemented Interfaces:
Serializable

public class DateModel
extends Object
implements Serializable

Models Locale specific date chanracteristics.

Includes localized slect lists.

Copyright: Copyright Sakai (c) 2005

Version:
$Id: DateModel.java 597 2005-07-13 20:26:17Z janderse@umich.edu $
Author:
Ed Smiley
See Also:
Serialized Form

Constructor Summary
DateModel()
           
DateModel(Locale locale)
           
 
Method Summary
 List get12HourSelectItems()
          Select list for range of hours on 12 hour clock.
 List get24HourSelectItems()
          Select list for range of hours on 24 hour clock.
 String[] getAmPm()
          (Should be) Localized array of {AM, PM}
 List getAmPmSelectItems()
          Localized AM/PM select list
 String[] getDayNames()
          Localized array of day strings
 Integer[] getDays()
          Array of day of month Integers, starting from 1
 List getDaySelectItems()
          Select list for range of days
 String[] getDayShortNames()
          Localized array of short day strings
 Integer[] getHours()
          Array of hour Integers, starting from 1
 Integer[] getHours(boolean twentyFourHour)
          Array of hour Integers, starting from 1
 Integer[] getMinutes()
          Array of minute Integers, starting from 0
 List getMinuteSelectItems()
          Select list for range of hours on 12 hour clock.
 String[] getMonthNames()
          Localized array of month names
 Integer[] getMonths()
          Array of month Itegers, starting from 1
 List getMonthSelectItems()
          Select list for range of months
 String[] getMonthShortNames()
          Localized array of short month strings
 Integer[] getSeconds()
          Array of seconds Integers, starting from 0
 List getSecondsSelectItems()
          Select list for range of hours on 12 hour clock.
 Integer[] getYears(int rangeBefore, int rangeAfter)
          Array of year Integers starting from now - rangeBefore to now + rangeAfter
 List getYearSelectItems(int rangeBefore, int rangeAfter)
          Select list for range of years
static void main(String[] args)
          unit test
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DateModel

public DateModel()

DateModel

public DateModel(Locale locale)
Method Detail

getYears

public Integer[] getYears(int rangeBefore,
                          int rangeAfter)
Array of year Integers starting from now - rangeBefore to now + rangeAfter

Parameters:
rangeBefore - int
rangeAfter - int
Returns:
Integer[]

getMonthNames

public String[] getMonthNames()
Localized array of month names

Returns:
String[]

getMonthShortNames

public String[] getMonthShortNames()
Localized array of short month strings

Returns:
String[]

getDayNames

public String[] getDayNames()
Localized array of day strings

Returns:
String[]

getDayShortNames

public String[] getDayShortNames()
Localized array of short day strings

Returns:
String[]

getAmPm

public String[] getAmPm()
(Should be) Localized array of {AM, PM}

Returns:
String[]

getMonths

public Integer[] getMonths()
Array of month Itegers, starting from 1

Returns:
Integer[]

getDays

public Integer[] getDays()
Array of day of month Integers, starting from 1

Returns:
Integer[]

getHours

public Integer[] getHours()
Array of hour Integers, starting from 1

Returns:
Integer[]

getHours

public Integer[] getHours(boolean twentyFourHour)
Array of hour Integers, starting from 1

Returns:
Integer[]

getMinutes

public Integer[] getMinutes()
Array of minute Integers, starting from 0

Returns:
Integer[]

getSeconds

public Integer[] getSeconds()
Array of seconds Integers, starting from 0

Returns:
Integer[]

main

public static void main(String[] args)
unit test

Parameters:
args - String[]

getYearSelectItems

public List getYearSelectItems(int rangeBefore,
                               int rangeAfter)
Select list for range of years

Parameters:
rangeBefore - int
rangeAfter - int
Returns:
List of SelectItems

getMonthSelectItems

public List getMonthSelectItems()
Select list for range of months

Returns:
List of SelectItems

getDaySelectItems

public List getDaySelectItems()
Select list for range of days

Returns:
List of SelectItems

get24HourSelectItems

public List get24HourSelectItems()
Select list for range of hours on 24 hour clock.

Returns:
List of SelectItems

get12HourSelectItems

public List get12HourSelectItems()
Select list for range of hours on 12 hour clock. Used in conjunction with AM/PM.

Returns:
List of SelectItem

getAmPmSelectItems

public List getAmPmSelectItems()
Localized AM/PM select list

Returns:
the List of SelectItems

getMinuteSelectItems

public List getMinuteSelectItems()
Select list for range of hours on 12 hour clock. Used in conjunction with AM/PM.

Returns:
List

getSecondsSelectItems

public List getSecondsSelectItems()
Select list for range of hours on 12 hour clock. Used in conjunction with AM/PM.

Returns:
List