Java Week Day isFirseDayOfCurrentWeek(Date date)

Here you can find the source of isFirseDayOfCurrentWeek(Date date)

Description

is Firse Day Of Current Week

License

Open Source License

Declaration

public static boolean isFirseDayOfCurrentWeek(Date date) 

Method Source Code

//package com.java2s;

import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;

public class Main {

    public static boolean isFirseDayOfCurrentWeek(Date date) {
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
        Calendar calendar = Calendar.getInstance();
        calendar.set(Calendar.DAY_OF_WEEK, 2);
        Date firstDate = calendar.getTime();
        return sdf.format(date).equals(sdf.format(firstDate));
    }/* ww w.ja va 2s.c  o  m*/
}

Related

  1. getWeekDayStr(int dayInWeek)
  2. getWeekendDays(Locale locale)
  3. getWeekFirstDay(Date date)
  4. isDayOfWeek(int day)
  5. isDayOfWeek(String str, int dayOfWeek)
  6. isoDayOfWeek(int javaDayOfWeek)
  7. isWeekday(String dateStr, String format)
  8. isWeekendDay(String strDay, DateFormat dateFormatter)
  9. isWeekendToday()