FileDocCategorySizeDatePackage
DateAction.javaAPI DocApache Struts 2.0.9 Apps2618Mon Jul 23 13:43:26 BST 2007org.apache.struts2.showcase

DateAction

public class DateAction extends com.opensymphony.xwork2.ActionSupport
DateAction

Fields Summary
private static DateFormat
DF
private Date
now
private Date
past
private Date
future
private Date
after
private Date
before
Constructors Summary
Methods Summary
public java.lang.Stringbrowse()

        Calendar cal = GregorianCalendar.getInstance();
        now = cal.getTime();
        cal.roll(Calendar.DATE, -1);
        cal.roll(Calendar.HOUR, -3);
        past = cal.getTime();
        cal.roll(Calendar.DATE, 2);
        future = cal.getTime();

        cal.roll(Calendar.YEAR, -1);
        before = cal.getTime();

        cal.roll(Calendar.YEAR, 2);
        after = cal.getTime();
        return SUCCESS;
    
public java.util.DategetAfter()

return
Returns the after date.

        return after;
    
public java.util.DategetBefore()

return
Returns the before date.

        return before;
    
public java.lang.StringgetDate()



       
        return DF.format(new Date());
    
public java.util.DategetFuture()

return
Returns the future.

        return future;
    
public java.util.DategetNow()

return
Returns the now.

        return now;
    
public java.util.DategetPast()

return
Returns the past.

        return past;