Android Open Source - CalendarWidget Day Of Week Helper






From Project

Back to project page CalendarWidget.

License

The source code is released under:

MIT License

If you think the Android project CalendarWidget listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package co.sfng.calendarwidget;
/*w  ww .j a  va 2 s.  c o m*/
import android.text.format.DateFormat;

import java.util.ArrayList;
import java.util.Calendar;
import java.util.List;


public class DayOfWeekHelper {

  public static List<String> getDayOfWeek(int weekStartDay) {
    Calendar cal = Calendar.getInstance();
    // September 7th, 2013 is a Saturday.
    // Calendar.SUNDAY = 1, MONDAY = 2, and so forth.
    cal.set(2013, Calendar.SEPTEMBER, 7 + weekStartDay, 0, 0, 0);

    ArrayList<String> list = new ArrayList<String>(7);
    for (int i = 0; i < 7; i++) {
      list.add(DateFormat.format("E", cal).toString());
      cal.add(Calendar.DATE, 1);
    }
    return list;
  }

}




Java Source Code List

co.sfng.calendarwidget.AppWidgetConfigureActivity.java
co.sfng.calendarwidget.CalendarWidgetProvider.java
co.sfng.calendarwidget.DayOfWeekHelper.java
co.sfng.calendarwidget.ResourceHelper.java
co.sfng.calendarwidget.SettingsFragment.java