Example usage for com.google.gwt.i18n.shared TimeZone getID

List of usage examples for com.google.gwt.i18n.shared TimeZone getID

Introduction

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

Prototype

String getID();

Source Link

Document

Returns time zone id for this time zone.

Usage

From source file:com.rnb.plategka.shared.DateTimeFormat.java

License:Apache License

/**
 * Formats a single field according to pattern specified.
 * /*from  ww  w  . j  a  va2 s  .co  m*/
 * @param ch
 *            pattern character for this field
 * @param count
 *            number of time pattern char repeats; this controls how a field
 *            should be formatted
 * @param date
 *            the date object to be formatted
 * @param adjustedDate
 *            holds the time zone adjusted date fields
 * @param adjustedTime
 *            holds the time zone adjusted time fields
 * 
 * @return <code>true</code> if pattern valid, otherwise <code>false</code>
 * 
 */
private boolean subFormat(StringBuffer buf, char ch, int count, Date date, Date adjustedDate, Date adjustedTime,
        TimeZone timezone) {
    switch (ch) {
    case 'G':
        formatEra(buf, count, adjustedDate);
        break;
    case 'y':
        formatYear(buf, count, adjustedDate);
        break;
    case 'M':
        formatMonth(buf, count, adjustedDate);
        break;
    case 'k':
        format24Hours(buf, count, adjustedTime);
        break;
    case 'S':
        formatFractionalSeconds(buf, count, adjustedTime);
        break;
    case 'E':
        formatDayOfWeek(buf, count, adjustedDate);
        break;
    case 'a':
        formatAmPm(buf, adjustedTime);
        break;
    case 'h':
        format1To12Hours(buf, count, adjustedTime);
        break;
    case 'K':
        format0To11Hours(buf, count, adjustedTime);
        break;
    case 'H':
        format0To23Hours(buf, count, adjustedTime);
        break;
    case 'c':
        formatStandaloneDay(buf, count, adjustedDate);
        break;
    case 'L':
        formatStandaloneMonth(buf, count, adjustedDate);
        break;
    case 'Q':
        formatQuarter(buf, count, adjustedDate);
        break;
    case 'd':
        formatDate(buf, count, adjustedDate);
        break;
    case 'm':
        formatMinutes(buf, count, adjustedTime);
        break;
    case 's':
        formatSeconds(buf, count, adjustedTime);
        break;
    case 'z':
        formatTimeZone(buf, count, date, timezone);
        break;
    case 'v':
        buf.append(timezone.getID());
        break;
    case 'Z':
        formatTimeZoneRFC(buf, count, date, timezone);
        break;
    default:
        return false;
    }
    return true;
}

From source file:org.ssgwt.share.i18n.DateTimeFormat.java

License:Apache License

/**
 * Formats a single field according to pattern specified.
 *
 * @param ch pattern character for this field
 * @param count number of time pattern char repeats; this controls how a field
 *          should be formatted//  ww w  . j av a 2s.  c om
 * @param date the date object to be formatted
 * @param adjustedDate holds the time zone adjusted date fields
 * @param adjustedTime holds the time zone adjusted time fields
 *
 * @return <code>true</code> if pattern valid, otherwise <code>false</code>
 *
 */
private boolean subFormat(StringBuffer buf, char ch, int count, SSDate date, SSDate adjustedDate,
        SSDate adjustedTime, TimeZone timezone) {
    switch (ch) {
    case 'G':
        formatEra(buf, count, adjustedDate);
        break;
    case 'y':
        formatYear(buf, count, adjustedDate);
        break;
    case 'M':
        formatMonth(buf, count, adjustedDate);
        break;
    case 'k':
        format24Hours(buf, count, adjustedTime);
        break;
    case 'S':
        formatFractionalSeconds(buf, count, adjustedTime);
        break;
    case 'E':
        formatDayOfWeek(buf, count, adjustedDate);
        break;
    case 'a':
        formatAmPm(buf, adjustedTime);
        break;
    case 'h':
        format1To12Hours(buf, count, adjustedTime);
        break;
    case 'K':
        format0To11Hours(buf, count, adjustedTime);
        break;
    case 'H':
        format0To23Hours(buf, count, adjustedTime);
        break;
    case 'c':
        formatStandaloneDay(buf, count, adjustedDate);
        break;
    case 'L':
        formatStandaloneMonth(buf, count, adjustedDate);
        break;
    case 'Q':
        formatQuarter(buf, count, adjustedDate);
        break;
    case 'd':
        formatDate(buf, count, adjustedDate);
        break;
    case 'm':
        formatMinutes(buf, count, adjustedTime);
        break;
    case 's':
        formatSeconds(buf, count, adjustedTime);
        break;
    case 'z':
        formatTimeZone(buf, count, date, timezone);
        break;
    case 'v':
        buf.append(timezone.getID());
        break;
    case 'Z':
        formatTimeZoneRFC(buf, count, date, timezone);
        break;
    default:
        return false;
    }
    return true;
}