8OY Posted November 12, 2013 Report Posted November 12, 2013 Hi All, Please help me in solving this. @ModelAttribute("lastDayOfMonthsDropDown") private Map<String,String> populateDateDropDown() { Map<String,String> lastDayOfMonths = new LinkedHashMap<String, String>(); SimpleDateFormat format = new SimpleDateFormat("MM/dd/yyyy"); String formattedDate = ""; Calendar cal = Calendar.getInstance(); Date today = new Date(); cal.setTime(today); int month = cal.get(Calendar.MONTH); int year = cal.get(Calendar.YEAR); int date = 1; Calendar calendar = Calendar.getInstance(); for(int i = 0 ; i < 12; i++) { if ( month > 11) { year++; month = 0; } calendar.set(year, month, date); calendar.set(year, month, calendar.getActualMaximum(Calendar.DAY_OF_MONTH)); formattedDate = format.format(calendar.getTime()); lastDayOfMonths.put(formattedDate,formattedDate); month++; } return lastDayOfMonths; } lastDayOfMonthsDropDown -->> dropdown values ipudu one year varaku chupistundi UI lo.. like 11/30/2013, 12/31/2013......10/31/2014 Question: If Current Date is less that Effective Date (01/01/2014)- Display end of current month in Dropdown.If Current Date is greater than Effective Date(01/01/2014)- Display end of current month, next month, and second month after next. ee code ni modify chestu... paina logic use cheyali...can anyone help me???
150bryant Posted November 12, 2013 Report Posted November 12, 2013 code anta help cheyandi....java ppl
Recommended Posts