Android examples for java.util:Week
get Week Index from Calendar
//package com.java2s; import java.util.Calendar; public class Main { /**/* w ww . j a va2s .c o m*/ * * @param weekIndex * @param calendar * @return */ public static int getWeekIndex(int weekIndex, Calendar calendar) { int firstDayWeekPosition = calendar.getFirstDayOfWeek(); if (firstDayWeekPosition == 1) { return weekIndex; } else { if (weekIndex == 1) { return 7; } else { return weekIndex - 1; } } } }