Java Week Day getFirstDayOfWeek(String week)

Here you can find the source of getFirstDayOfWeek(String week)

Description

get First Day Of Week

License

Apache License

Declaration

public static String getFirstDayOfWeek(String week) 

Method Source Code


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

import java.text.ParseException;
import java.text.SimpleDateFormat;

public class Main {

    public static String getFirstDayOfWeek(String week) {
        try {//from   w w  w  .j  a va2 s  .c o  m
            return getDefaultDateFormat().format(getDefaultWeekFormat().parse(week));
        } catch (ParseException e) {
            return "ERROR_DAY";
        }
    }

    public static SimpleDateFormat getDefaultDateFormat() {
        return new SimpleDateFormat("yyyyMMdd");
    }

    public static SimpleDateFormat getDefaultWeekFormat() {
        return new SimpleDateFormat("yyyyww");
    }
}

Related

  1. getFirstDayOfWeek(Date date)
  2. getFirstDayOfWeek(Date date)
  3. getFirstDayOfWeek(final Date date)
  4. getFirstDayOfWeek(String format)
  5. getFirstDayOfWeek(String str, int week)
  6. getFirstDayOfWeek(String week)
  7. getFriday(Date date)
  8. getLastDayOfCurrWeek()
  9. getLastDayOfWeek(int year, int month)