Java Calendar Week getFirstDayOfWeek(Calendar calendar)

Here you can find the source of getFirstDayOfWeek(Calendar calendar)

Description

get First Day Of Week

License

LGPL

Declaration

public static Calendar getFirstDayOfWeek(Calendar calendar) 

Method Source Code

//package com.java2s;
//License from project: LGPL 

import java.util.Calendar;

public class Main {
    public static Calendar getFirstDayOfWeek(Calendar calendar) {
        Calendar ret = (Calendar) calendar.clone();
        ret.add(Calendar.DAY_OF_MONTH, -((ret.get(Calendar.DAY_OF_WEEK) + 5) % 7));
        return ret;
    }/*  w w w.j av a2  s. c o m*/
}

Related

  1. getDayOfWeekNumber(Calendar cal)
  2. getDayOfWeekString1(Calendar currentDate)
  3. getEndOfWeek(Calendar calendar, Date date, int dayStartOfWeek)
  4. getFirstDateInMonthForDayOfWeek(Calendar cal, final int dayOfWeek)
  5. getFirstDayOfWeek(Calendar cal)
  6. getFirstOfMonthDayOfWeek(GregorianCalendar aCalendar)
  7. getImmediateDayOfWeek(Calendar current, int dayOfWeek)
  8. getLastDayOfWeek(Calendar cal)
  9. getLastDayOfWeek(Calendar cal)