Hi all,
i need a hand on geting only the working days for a certain month. eny ideas on haw it could be done?
basicaly, i have a web service from witch i get a xml message that contains a date.
in an action , i have a hashtable thas has as keys the only the working days for that month , starting fom the day of month that is given to me by the xml , and as value a list of quantities that i have to calculate.
untill now, i've done this :
String xmlDate = ipeList.get(a).getCOTList().get(b).getRCList().get(c).getCPList().get(d).getDQList().get(e).getDay().toString(); Hashtable<String, List<String>> dqHt = new Hashtable<String, List<String>>(); dqHt.put(xmlDate, qtyList); String[] elementiData = xmlDate.split("/"); Calendar calendar = new GregorianCalendar(); calendar.add(Calendar.MONTH, Integer.parseInt(elementiData[1])+1); calendar.set(GregorianCalendar.DAY_OF_MONTH, Integer.parseInt(elementiData[0])); while(calendar.get(GregorianCalendar.MONTH) == Integer.parseInt(elementiData[1])){ calendar.add(GregorianCalendar.DAY_OF_MONTH,1); List<String> listaVuota = new ArrayList<String>(); listaVuota.add("0"); listaVuota.add("0"); listaVuota.add("0"); dqHt.put(String.valueOf(calendar.get(Calendar.DAY_OF_MONTH)) + "/" + elementiData[1] +"/" + elementiData[2], listaVuota); }
the problem with the code above is that it gives me all the dates ,starting width the day fom the xml, but without making the difference betwen worhing and non-working days .
how could i get only the working days?