Example usage for com.google.gwt.i18n.shared.impl DateRecord setDayOfWeek

List of usage examples for com.google.gwt.i18n.shared.impl DateRecord setDayOfWeek

Introduction

In this page you can find the example usage for com.google.gwt.i18n.shared.impl DateRecord setDayOfWeek.

Prototype

public void setDayOfWeek(int dayOfWeek) 

Source Link

Document

Set dayOfWeek field.

Usage

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

License:Apache License

/**
 * Method subParseDayOfWeek parses day of the week field.
 * //from  w ww  . j  a  v a 2 s. co  m
 * @param text
 *            the time text to be parsed
 * @param pos
 *            Parse position
 * @param start
 *            from where parse start
 * @param cal
 *            DateRecord object that holds parsed value
 * 
 * @return <code>true</code> if parsing successful, otherwise
 *         <code>false</code>
 */
private boolean subParseDayOfWeek(String text, int[] pos, int start, DateRecord cal) {
    int value;
    // 'E' - DAY_OF_WEEK
    // Want to be able to parse both short and long forms.
    // Try count == 4 (DDDD) first:
    value = matchString(text, start, dateTimeFormatInfo.weekdaysFull(), pos);
    if (value < 0) {
        value = matchString(text, start, dateTimeFormatInfo.weekdaysShort(), pos);
    }
    if (value < 0) {
        return false;
    }
    cal.setDayOfWeek(value);
    return true;
}

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

License:Apache License

/**
 * Parses standalone day of the week field.
 * //from  w w  w  . j  ava 2s .c  o  m
 * @param text
 *            the time text to be parsed
 * @param pos
 *            Parse position
 * @param start
 *            from where parse start
 * @param cal
 *            DateRecord object that holds parsed value
 * 
 * @return <code>true</code> if parsing successful, otherwise
 *         <code>false</code>
 */
private boolean subParseStandaloneDay(String text, int[] pos, int start, DateRecord cal) {
    int value;
    // 'c' - DAY_OF_WEEK
    // Want to be able to parse both short and long forms.
    // Try count == 4 (cccc) first:
    value = matchString(text, start, dateTimeFormatInfo.weekdaysFullStandalone(), pos);
    if (value < 0) {
        value = matchString(text, start, dateTimeFormatInfo.weekdaysShortStandalone(), pos);
    }
    if (value < 0) {
        return false;
    }
    cal.setDayOfWeek(value);
    return true;
}