Here you can find the source of getDayOfWeek(Calendar cal)
Parameter | Description |
---|---|
cal | Calendar |
private static int getDayOfWeek(Calendar cal)
//package com.java2s; /*//from w w w.j a va 2s .c o m * Copyright 2000-2011 Enonic AS * http://www.enonic.com/license */ import java.util.Calendar; public class Main { /** * Quick hack to get day of week. Can't get Calendar.get(Calendar.DAY_OF_WEEK) to work... * * @param cal Calendar * @return int */ private static int getDayOfWeek(Calendar cal) { if (cal.get(Calendar.DAY_OF_WEEK) > 1) { return cal.get(Calendar.DAY_OF_WEEK) - 1; } // sunday is last day of week return 7; } }