1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.ole.pdp.businessobject.options;
17
18 import java.sql.Timestamp;
19 import java.util.Calendar;
20 import java.util.Date;
21 import java.util.GregorianCalendar;
22
23 import org.kuali.ole.sys.context.SpringContext;
24 import org.kuali.rice.core.api.datetime.DateTimeService;
25 import org.kuali.rice.krad.valuefinder.ValueFinder;
26
27 public class PaymentProcessTimestampFinder implements ValueFinder {
28
29
30
31
32
33 public String getValue() {
34
35 DateTimeService dateTimeService = SpringContext.getBean(DateTimeService.class);
36 GregorianCalendar calendarFourMonthsAgo = new GregorianCalendar();
37 calendarFourMonthsAgo.setTime(new Date());
38 calendarFourMonthsAgo.add(Calendar.MONTH, -4);
39
40
41
42 GregorianCalendar calendarNow = new GregorianCalendar();
43 calendarNow.setTime(new Date());
44 calendarNow.add(Calendar.DATE, +1);
45 String now = dateTimeService.toDateString(new Timestamp(calendarNow.getTimeInMillis()));
46 String fourMonthsAgo = dateTimeService.toDateString(new Timestamp(calendarFourMonthsAgo.getTimeInMillis()));
47
48 String processTimestampValue = fourMonthsAgo + ".." + now;
49 return processTimestampValue;
50 }
51
52 }