Java Week Day getPreviousMonday(Date date, int days)

Here you can find the source of getPreviousMonday(Date date, int days)

Description

get Previous Monday

License

Apache License

Declaration

public static String getPreviousMonday(Date date, int days) 

Method Source Code

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

import java.text.DateFormat;

import java.util.Date;
import java.util.GregorianCalendar;

public class Main {
    public static String getPreviousMonday(Date date, int days) {
        int weeks = -1;
        GregorianCalendar currentDate = new GregorianCalendar();
        currentDate.setTime(date);/*from  w ww  .j a  va2s .  c o m*/
        currentDate.add(GregorianCalendar.DATE, days + 7 * weeks);
        Date monday = currentDate.getTime();
        DateFormat df = DateFormat.getDateInstance();
        String preMonday = df.format(monday);
        return preMonday;
    }
}

Related

  1. getMondayOfThisWeek()
  2. getNextDayOfweek()
  3. getPreDay()
  4. getPreviousDay(long date, int startOfWeek)
  5. getPreviousFriday(String date)
  6. getPreviousOrNextDay(String time, int dayNum)
  7. getPreWeekLastDay()
  8. getShortWeekday(int dayOfWeek)
  9. getShortWeekday(String day)