Java Day of Week dayOfWeekFromInteger(String aDay, boolean longName)

Here you can find the source of dayOfWeekFromInteger(String aDay, boolean longName)

Description

day Of Week From Integer

License

Open Source License

Declaration

public static String dayOfWeekFromInteger(String aDay, boolean longName) 

Method Source Code

//package com.java2s;

public class Main {
    public static String dayOfWeekFromInteger(String aDay, boolean longName) {
        if (aDay == "1") {
            return longName ? "Sunday" : "Sun";
        }/*from   ww  w.  j av a2  s .co m*/
        if (aDay == "2") {
            return longName ? "Monday" : "Mon";
        }
        if (aDay == "3") {
            return longName ? "Tuesday" : "Tue";
        }
        if (aDay == "4") {
            return longName ? "Wednesday" : "Wed";
        }
        if (aDay == "5") {
            return longName ? "Thursday" : "Thur";
        }
        if (aDay == "6") {
            return longName ? "Friday" : "Fri";
        }
        if (aDay == "7") {
            return longName ? "Saturday" : "Sat";
        }
        return null;
    }
}

Related

  1. dayOfWeek(Date inDate, TimeZone timeZone)
  2. dayOfWeek(Date time)
  3. dayOfWeek(int dayMark)
  4. dayOfWeek(int year, int month, int day)
  5. dayOfWeekFromInt(final int theDay)
  6. dayOfWeekNames()
  7. endOfWeek(Date inDate, TimeZone timeZone)
  8. extractDayOfWeek(Date date)
  9. findDayOfWeek(String threeLetters)