Java Calendar Add addWorkdays(final Calendar calendar, final int dauer)

Here you can find the source of addWorkdays(final Calendar calendar, final int dauer)

Description

add Workdays

License

Open Source License

Declaration

public static void addWorkdays(final Calendar calendar, final int dauer) 

Method Source Code

//package com.java2s;

import java.util.Calendar;

public class Main {
    public static void addWorkdays(final Calendar calendar, final int dauer) {
        int i = dauer;
        while (i > 0) {
            calendar.add(Calendar.DATE, 1);
            final int day = calendar.get(Calendar.DAY_OF_WEEK);
            if (day != Calendar.SUNDAY && day != Calendar.SATURDAY) {
                i--;//from w  ww.j  a  v  a2 s  .  co m
            }
        }
    }
}

Related

  1. addMonth(Calendar cal, int period)
  2. addMonthDayToCal(Calendar cal, int month, int day)
  3. addSeconds(Calendar calendar, int amount)
  4. addToUTCMilliSeconds(int calendarTime, int actualValue)
  5. addWeekdays(Calendar cal, int days)
  6. appendDate(StringBuffer buf, Calendar cal)
  7. appendDate(StringBuffer dateString, Calendar calendar)
  8. appendDate(StringBuffer sb, Calendar cal)
  9. appendEra(StringBuffer sb, Calendar cal)