| 1 6 7 package com.quikj.application.communicator.admin.controller; 8 9 import java.util.*; 10 11 import org.apache.struts.action.*; 12 import javax.servlet.http.HttpServletRequest ; 13 import java.text.SimpleDateFormat ; 14 18 public class LogDeleteForm extends ActionForm 19 { 20 21 22 private String priorToInput; 23 24 25 private Date priorToDate; 26 27 28 public LogDeleteForm() 29 { 30 reset(); 31 } 32 33 public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) 34 { 35 ActionErrors errors = new ActionErrors(); 36 37 Date date = DateUtility.processInputDate(priorToInput); 38 if (date == null) 39 { 40 errors.add("priorToInput", new ActionError("error.date.invalid", "")); 41 } 42 else 43 { 44 priorToDate = date; 45 } 46 47 48 return errors; 49 } 50 51 public void reset() 52 { 53 Calendar cal = Calendar.getInstance(); 54 cal.add(Calendar.MONTH, -1); 55 56 SimpleDateFormat formatter = new SimpleDateFormat ("MM/dd/yyyy"); 57 58 priorToInput = formatter.format(cal.getTime()); 59 priorToDate = null; 60 } 61 62 66 public String getPriorToInput() 67 { 68 return this.priorToInput; 69 } 70 71 75 public void setPriorToInput(String priorToInput) 76 { 77 this.priorToInput = priorToInput; 78 } 79 80 84 public Date getPriorToDate() 85 { 86 return this.priorToDate; 87 } 88 89 93 public void setPriorToDate(Date priorToDate) 94 { 95 this.priorToDate = priorToDate; 96 } 97 98 } 99 | Popular Tags |