Java Code Examples for java.text.DateFormatSymbols#setShortWeekdays()

The following examples show how to use java.text.DateFormatSymbols#setShortWeekdays() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: CalendarPickerView.java    From DateRangePicker with Apache License 2.0 5 votes vote down vote up
@SuppressLint("SimpleDateFormat")
public FluentInitializer setShortWeekdays(String[] newShortWeekdays) {
    DateFormatSymbols symbols = new DateFormatSymbols(locale);
    symbols.setShortWeekdays(newShortWeekdays);
    weekdayNameFormat =
            new SimpleDateFormat("E", symbols);
    return this;
}
 
Example 2
Source File: CalendarPickerView.java    From android-times-square with Apache License 2.0 5 votes vote down vote up
@SuppressLint("SimpleDateFormat")
public FluentInitializer setShortWeekdays(String[] newShortWeekdays) {
  DateFormatSymbols symbols = new DateFormatSymbols(locale);
  symbols.setShortWeekdays(newShortWeekdays);
  weekdayNameFormat =
      new SimpleDateFormat(getContext().getString(R.string.day_name_format), symbols);
  return this;
}
 
Example 3
Source File: SakaiDateFormatSymbolsProvider.java    From sakai with Educational Community License v2.0 4 votes vote down vote up
/**
 * {@inheritDoc}
 */
@Override
public DateFormatSymbols getInstance(final Locale locale) throws IllegalArgumentException, NullPointerException {
	if (locale == null) {
		throw new NullPointerException("locale:null");
	} else if (!SakaiLocaleServiceProviderUtil.isAvailableLocale(locale)) {
		throw new IllegalArgumentException("locale:" + locale.toString());
	}

	DateFormatSymbols symbols = new DateFormatSymbols();
	symbols.setEras(new String[] {
			SakaiLocaleServiceProviderUtil.getString("Eras.BC", locale),
			SakaiLocaleServiceProviderUtil.getString("Eras.AD", locale) });
	symbols.setMonths(new String[] {
			SakaiLocaleServiceProviderUtil.getString("Months.JAN", locale),
			SakaiLocaleServiceProviderUtil.getString("Months.FEB", locale),
			SakaiLocaleServiceProviderUtil.getString("Months.MAR", locale),
			SakaiLocaleServiceProviderUtil.getString("Months.APR", locale),
			SakaiLocaleServiceProviderUtil.getString("Months.MAY", locale),
			SakaiLocaleServiceProviderUtil.getString("Months.JUN", locale),
			SakaiLocaleServiceProviderUtil.getString("Months.JUL", locale),
			SakaiLocaleServiceProviderUtil.getString("Months.AUG", locale),
			SakaiLocaleServiceProviderUtil.getString("Months.SEP", locale),
			SakaiLocaleServiceProviderUtil.getString("Months.OCT", locale),
			SakaiLocaleServiceProviderUtil.getString("Months.NOV", locale),
			SakaiLocaleServiceProviderUtil.getString("Months.DEC", locale) });
	symbols.setShortMonths(new String[] {
			SakaiLocaleServiceProviderUtil.getString("ShortMonths.JAN", locale),
			SakaiLocaleServiceProviderUtil.getString("ShortMonths.FEB", locale),
			SakaiLocaleServiceProviderUtil.getString("ShortMonths.MAR", locale),
			SakaiLocaleServiceProviderUtil.getString("ShortMonths.APR", locale),
			SakaiLocaleServiceProviderUtil.getString("ShortMonths.MAY", locale),
			SakaiLocaleServiceProviderUtil.getString("ShortMonths.JUN", locale),
			SakaiLocaleServiceProviderUtil.getString("ShortMonths.JUL", locale),
			SakaiLocaleServiceProviderUtil.getString("ShortMonths.AUG", locale),
			SakaiLocaleServiceProviderUtil.getString("ShortMonths.SEP", locale),
			SakaiLocaleServiceProviderUtil.getString("ShortMonths.OCT", locale),
			SakaiLocaleServiceProviderUtil.getString("ShortMonths.NOV", locale),
			SakaiLocaleServiceProviderUtil.getString("ShortMonths.DEC", locale) });
	symbols.setWeekdays(new String[] {"",
			SakaiLocaleServiceProviderUtil.getString("Weekdays.SUN", locale),
			SakaiLocaleServiceProviderUtil.getString("Weekdays.MON", locale),
			SakaiLocaleServiceProviderUtil.getString("Weekdays.TUE", locale),
			SakaiLocaleServiceProviderUtil.getString("Weekdays.WED", locale),
			SakaiLocaleServiceProviderUtil.getString("Weekdays.THU", locale),
			SakaiLocaleServiceProviderUtil.getString("Weekdays.FRI", locale),
			SakaiLocaleServiceProviderUtil.getString("Weekdays.SAT", locale) });
	symbols.setShortWeekdays(new String[] {"",
			SakaiLocaleServiceProviderUtil.getString("ShortWeekdays.SUN", locale),
			SakaiLocaleServiceProviderUtil.getString("ShortWeekdays.MON", locale),
			SakaiLocaleServiceProviderUtil.getString("ShortWeekdays.TUE", locale),
			SakaiLocaleServiceProviderUtil.getString("ShortWeekdays.WED", locale),
			SakaiLocaleServiceProviderUtil.getString("ShortWeekdays.THU", locale),
			SakaiLocaleServiceProviderUtil.getString("ShortWeekdays.FRI", locale),
			SakaiLocaleServiceProviderUtil.getString("ShortWeekdays.SAT", locale) });
	symbols.setAmPmStrings(new String[] {
			SakaiLocaleServiceProviderUtil.getString("AmPmStrings.AM", locale),
			SakaiLocaleServiceProviderUtil.getString("AmPmStrings.PM", locale) });
	symbols.setLocalPatternChars(SakaiLocaleServiceProviderUtil.getString(
			"LocalPatternChars", locale));

	// Not support Zone Strings

	return symbols;
}
 
Example 4
Source File: SakaiDateFormatSymbolsProvider.java    From sakai with Educational Community License v2.0 4 votes vote down vote up
/**
 * {@inheritDoc}
 */
@Override
public DateFormatSymbols getInstance(final Locale locale) throws IllegalArgumentException, NullPointerException {
	if (locale == null) {
		throw new NullPointerException("locale:null");
	} else if (!SakaiLocaleServiceProviderUtil.isAvailableLocale(locale)) {
		throw new IllegalArgumentException("locale:" + locale.toString());
	}

	DateFormatSymbols symbols = new DateFormatSymbols();
	symbols.setEras(new String[] {
			SakaiLocaleServiceProviderUtil.getString("Eras.BC", locale),
			SakaiLocaleServiceProviderUtil.getString("Eras.AD", locale) });
	symbols.setMonths(new String[] {
			SakaiLocaleServiceProviderUtil.getString("Months.JAN", locale),
			SakaiLocaleServiceProviderUtil.getString("Months.FEB", locale),
			SakaiLocaleServiceProviderUtil.getString("Months.MAR", locale),
			SakaiLocaleServiceProviderUtil.getString("Months.APR", locale),
			SakaiLocaleServiceProviderUtil.getString("Months.MAY", locale),
			SakaiLocaleServiceProviderUtil.getString("Months.JUN", locale),
			SakaiLocaleServiceProviderUtil.getString("Months.JUL", locale),
			SakaiLocaleServiceProviderUtil.getString("Months.AUG", locale),
			SakaiLocaleServiceProviderUtil.getString("Months.SEP", locale),
			SakaiLocaleServiceProviderUtil.getString("Months.OCT", locale),
			SakaiLocaleServiceProviderUtil.getString("Months.NOV", locale),
			SakaiLocaleServiceProviderUtil.getString("Months.DEC", locale) });
	symbols.setShortMonths(new String[] {
			SakaiLocaleServiceProviderUtil.getString("ShortMonths.JAN", locale),
			SakaiLocaleServiceProviderUtil.getString("ShortMonths.FEB", locale),
			SakaiLocaleServiceProviderUtil.getString("ShortMonths.MAR", locale),
			SakaiLocaleServiceProviderUtil.getString("ShortMonths.APR", locale),
			SakaiLocaleServiceProviderUtil.getString("ShortMonths.MAY", locale),
			SakaiLocaleServiceProviderUtil.getString("ShortMonths.JUN", locale),
			SakaiLocaleServiceProviderUtil.getString("ShortMonths.JUL", locale),
			SakaiLocaleServiceProviderUtil.getString("ShortMonths.AUG", locale),
			SakaiLocaleServiceProviderUtil.getString("ShortMonths.SEP", locale),
			SakaiLocaleServiceProviderUtil.getString("ShortMonths.OCT", locale),
			SakaiLocaleServiceProviderUtil.getString("ShortMonths.NOV", locale),
			SakaiLocaleServiceProviderUtil.getString("ShortMonths.DEC", locale) });
	symbols.setWeekdays(new String[] {"",
			SakaiLocaleServiceProviderUtil.getString("Weekdays.SUN", locale),
			SakaiLocaleServiceProviderUtil.getString("Weekdays.MON", locale),
			SakaiLocaleServiceProviderUtil.getString("Weekdays.TUE", locale),
			SakaiLocaleServiceProviderUtil.getString("Weekdays.WED", locale),
			SakaiLocaleServiceProviderUtil.getString("Weekdays.THU", locale),
			SakaiLocaleServiceProviderUtil.getString("Weekdays.FRI", locale),
			SakaiLocaleServiceProviderUtil.getString("Weekdays.SAT", locale) });
	symbols.setShortWeekdays(new String[] {"",
			SakaiLocaleServiceProviderUtil.getString("ShortWeekdays.SUN", locale),
			SakaiLocaleServiceProviderUtil.getString("ShortWeekdays.MON", locale),
			SakaiLocaleServiceProviderUtil.getString("ShortWeekdays.TUE", locale),
			SakaiLocaleServiceProviderUtil.getString("ShortWeekdays.WED", locale),
			SakaiLocaleServiceProviderUtil.getString("ShortWeekdays.THU", locale),
			SakaiLocaleServiceProviderUtil.getString("ShortWeekdays.FRI", locale),
			SakaiLocaleServiceProviderUtil.getString("ShortWeekdays.SAT", locale) });
	symbols.setAmPmStrings(new String[] {
			SakaiLocaleServiceProviderUtil.getString("AmPmStrings.AM", locale),
			SakaiLocaleServiceProviderUtil.getString("AmPmStrings.PM", locale) });
	symbols.setLocalPatternChars(SakaiLocaleServiceProviderUtil.getString(
			"LocalPatternChars", locale));

	// Not support Zone Strings

	return symbols;
}