package test.dwr;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.GregorianCalendar;
import java.util.HashMap;
import java.util.Locale;
import java.util.Map;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
public class DayFromDate
{
private Log log = LogFactory.getLog(DayFromDate.class);
public Map<String, Integer> getDay(String aDate) throws Exception
{
Calendar calendar = new GregorianCalendar(Locale.ENGLISH);
Map<String, Integer> aMap = new HashMap<String, Integer>();
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
formatter.setCalendar(calendar);
calendar.setTime(formatter.parse(aDate));
log.info("Date processed is: " + calendar.getTime());
aMap.put(aDate, calendar.get(Calendar.DAY_OF_WEEK));
return aMap;
}
}