Java Day Name getDayName(String code)

Here you can find the source of getDayName(String code)

Description

get Day Name

License

Apache License

Declaration

public static String getDayName(String code) 

Method Source Code


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

import java.util.Calendar;

public class Main {
    private static String OTHER = "UNDEFINED";

    public static String getDayName(String code) { // Good for Sorting
        int day = Integer.parseInt(code);
        switch (day) {
        case Calendar.SUNDAY:
            return "Sun";
        case Calendar.MONDAY:
            return "Mon";
        case Calendar.TUESDAY:
            return "Tue";
        case Calendar.WEDNESDAY:
            return "Wed";
        case Calendar.THURSDAY:
            return "Thu";
        case Calendar.FRIDAY:
            return "Fri";
        case Calendar.SATURDAY:
            return "Sat";
        default:/*from   w  w w . jav a  2s  . c  o m*/
            return OTHER;
        }
    }
}

Related

  1. dayName(String dayNumber)
  2. dayName(String dayNumber)
  3. getCurrentDayName()
  4. getDayName()
  5. getDayName(int i)
  6. getDayOfWeekName(int dayOfWeek)
  7. parseDayName(String twoLetterDayName)