Example usage for com.google.gwt.i18n.shared DateTimeFormatInfo timeFormat

List of usage examples for com.google.gwt.i18n.shared DateTimeFormatInfo timeFormat

Introduction

In this page you can find the example usage for com.google.gwt.i18n.shared DateTimeFormatInfo timeFormat.

Prototype

String timeFormat();

Source Link

Document

Returns a safe default time format.

Usage

From source file:org.homedns.mkh.dataservice.client.DateFormatter.java

License:Apache License

/**
 * @param iStyle date/time representation 0 - DATE, 1 - TIME, 2 - TIMESTAMP
 *//*from   ww w. jav  a2s.  c om*/
private DateFormatter(int iStyle) {
    DateTimeFormatInfo fmt = LocaleInfo.getCurrentLocale().getDateTimeFormatInfo();
    if (iStyle == 0) {
        _dateFormatter = DateTimeFormat.getFormat(fmt.dateFormatShort());
    } else if (iStyle == 1) {
        _dateFormatter = DateTimeFormat.getFormat(fmt.timeFormat());
    } else if (iStyle == 2) {
        _dateFormatter = DateTimeFormat.getFormat(fmt.dateFormatShort() + " " + fmt.timeFormat());
    }
}