Here you can find the source of isWeekEnd(Calendar c)
public static boolean isWeekEnd(Calendar c)
//package com.java2s; import java.util.Calendar; public class Main { public static boolean isWeekEnd(Calendar c) { int day = c.get(Calendar.DAY_OF_WEEK); if (day == Calendar.SUNDAY || day == Calendar.SATURDAY) { return true; }/*from ww w . ja v a 2 s .c o m*/ return false; } public static boolean isWeekEnd(String date) { return isWeekEnd(parseCalendar(date)); } public static Calendar parseCalendar(String s) { Calendar c = Calendar.getInstance(); try { int d = Integer.parseInt(s); int year = d / 10000; int month = (d % 10000) / 100; int day = d % 100; c.set(year, month - 1, day); } catch (Exception e) { return null; } return c; } }