|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.vaadin.terminal.gwt.client.DateTimeService
public class DateTimeService
This class provides date/time parsing services to all components on the client side.
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 |
formatDate(Date date,
String formatStr)
Check if format contains the month name. |
String[] |
getAmPmStrings()
|
String |
getClockDelimeter()
|
String |
getDay(int day)
|
int |
getFirstDayOfWeek()
|
static int |
getISOWeekNumber(Date date)
Returns the ISO-8601 week number of the given date. |
String |
getLocale()
|
static int |
getMilliseconds(Date date)
|
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()
|
Date |
parseDate(String dateString,
String formatString,
boolean lenient)
Parses the given date string using the given format string and the locale set in this DateTimeService instance. |
void |
setLocale(String locale)
|
static void |
setMilliseconds(Date date,
int ms)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DateTimeService()
public DateTimeService(String locale) throws LocaleNotLoadedException
locale
- e.g. fi, en etc.
LocaleNotLoadedException
Method Detail |
---|
public void setLocale(String locale) throws LocaleNotLoadedException
LocaleNotLoadedException
public String getLocale()
public String getMonth(int month)
public String getShortMonth(int month)
public String getDay(int day)
public String getShortDay(int day)
public int getFirstDayOfWeek()
public boolean isTwelveHourClock()
public String getClockDelimeter()
public String[] getAmPmStrings()
public int getStartWeekDay(Date date)
public static void setMilliseconds(Date date, int ms)
public static int getMilliseconds(Date date)
public static int getNumberOfDaysInMonth(Date date)
public static boolean isLeapYear(Date date)
public static boolean isSameDay(Date d1, Date d2)
public static boolean isInRange(Date date, Date rangeStart, Date rangeEnd, int resolution)
public static int getISOWeekNumber(Date date)
date
- The date for which the week number should be resolved
public String formatDate(Date date, String formatStr)
date
- The date to convertformatStr
- The format string that might contain MMM or MMMMdateTimeService
- Reference to the Vaadin DateTimeService
public Date parseDate(String dateString, String formatString, boolean lenient) throws IllegalArgumentException
dateString
- Date string e.g. "1 February 2010"formatString
- Format string e.g. "d MMMM yyyy"lenient
- true to use lenient parsing, false to use strict parsing
IllegalArgumentException
- if the parsing fails
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |