Java Week Calculate getEndOfWeek(Calendar cal)

Here you can find the source of getEndOfWeek(Calendar cal)

Description

Moves a calendar to the end of the week

License

Apache License

Return

calendar passed in, moved to the end of the week

Declaration

public static Calendar getEndOfWeek(Calendar cal) 

Method Source Code

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

import java.util.*;

public class Main {
    /**/* www.j  av  a  2  s. c o  m*/
     * Moves a calendar to the end of the week
     *
     * @return calendar passed in, moved to the end of the week
     */
    public static Calendar getEndOfWeek(Calendar cal) {
        cal.add(Calendar.DAY_OF_WEEK, cal.getActualMaximum(Calendar.DAY_OF_WEEK) - cal.get(Calendar.DAY_OF_WEEK));
        return cal;
    }
}

Related

  1. alignWeek(Calendar timestamp)
  2. diffWeeks(Date start, Date end)
  3. getBounceDatesOfWeek(Date date)
  4. getCurrentWeekNum(Date startDate, Date endDate)
  5. getCurrWeek()
  6. getSeqWeek()
  7. getWeek(Date date)
  8. getWeekAbscissa(Class cls)
  9. getWeekNumberFromDate(Date date)