com.itmill.toolkit.terminal.gwt.client
Class DateTimeService

java.lang.Object
  extended by com.itmill.toolkit.terminal.gwt.client.DateTimeService

public class DateTimeService
extends Object

This class provides date/time parsing services to all components on the client side.

Author:
IT Mill Ltd.

Field Summary
static int RESOLUTION_DAY
           
static int RESOLUTION_HOUR
           
static int RESOLUTION_MIN
           
static int RESOLUTION_MONTH
           
static int RESOLUTION_MSEC
           
static int RESOLUTION_SEC
           
static int RESOLUTION_YEAR
           
 
Constructor Summary
DateTimeService()
          Creates a new date time service with the application default locale.
DateTimeService(String locale)
          Creates a new date time service with a given locale.
 
Method Summary
 String[] getAmPmStrings()
           
 String getClockDelimeter()
           
 String getDay(int day)
           
 int getFirstDayOfWeek()
           
 String getLocale()
           
 String getMonth(int month)
           
static int getNumberOfDaysInMonth(Date date)
           
 String getShortDay(int day)
           
 String getShortMonth(int month)
           
 int getStartWeekDay(Date date)
           
static boolean isInRange(Date date, Date rangeStart, Date rangeEnd, int resolution)
           
static boolean isLeapYear(Date date)
           
static boolean isSameDay(Date d1, Date d2)
           
 boolean isTwelveHourClock()
           
 void setLocale(String locale)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RESOLUTION_YEAR

public static int RESOLUTION_YEAR

RESOLUTION_MONTH

public static int RESOLUTION_MONTH

RESOLUTION_DAY

public static int RESOLUTION_DAY

RESOLUTION_HOUR

public static int RESOLUTION_HOUR

RESOLUTION_MIN

public static int RESOLUTION_MIN

RESOLUTION_SEC

public static int RESOLUTION_SEC

RESOLUTION_MSEC

public static int RESOLUTION_MSEC
Constructor Detail

DateTimeService

public DateTimeService()
Creates a new date time service with the application default locale.


DateTimeService

public DateTimeService(String locale)
                throws LocaleNotLoadedException
Creates a new date time service with a given locale.

Parameters:
locale - e.g. fi, en etc.
Throws:
LocaleNotLoadedException
Method Detail

setLocale

public void setLocale(String locale)
               throws LocaleNotLoadedException
Throws:
LocaleNotLoadedException

getLocale

public String getLocale()

getMonth

public String getMonth(int month)

getShortMonth

public String getShortMonth(int month)

getDay

public String getDay(int day)

getShortDay

public String getShortDay(int day)

getFirstDayOfWeek

public int getFirstDayOfWeek()

isTwelveHourClock

public boolean isTwelveHourClock()

getClockDelimeter

public String getClockDelimeter()

getAmPmStrings

public String[] getAmPmStrings()

getStartWeekDay

public int getStartWeekDay(Date date)

getNumberOfDaysInMonth

public static int getNumberOfDaysInMonth(Date date)

isLeapYear

public static boolean isLeapYear(Date date)

isSameDay

public static boolean isSameDay(Date d1,
                                Date d2)

isInRange

public static boolean isInRange(Date date,
                                Date rangeStart,
                                Date rangeEnd,
                                int resolution)


Copyright © 2000-2009 IT Mill Ltd. All Rights Reserved.