public class MockDateTimeService extends Object implements DateTimeService
DateTimeService
implementation for supporting UIF unit tests.Constructor and Description |
---|
MockDateTimeService() |
Modifier and Type | Method and Description |
---|---|
Date |
convertToDate(String dateString) |
Date |
convertToDateTime(String dateTimeString) |
Date |
convertToSqlDate(String dateString)
Converts a date using the format string MM/dd/yy.
|
Date |
convertToSqlDate(Timestamp timestamp) |
Date |
convertToSqlDateUpperBound(String dateString) |
Time |
convertToSqlTime(String timeString) |
Timestamp |
convertToSqlTimestamp(String timeString) |
int |
dateDiff(Date date1,
Date date2,
boolean inclusive) |
Calendar |
getCalendar(Date date) |
Calendar |
getCurrentCalendar() |
Date |
getCurrentDate() |
Date |
getCurrentSqlDate() |
Date |
getCurrentSqlDateMidnight() |
Timestamp |
getCurrentTimestamp() |
String |
toDateString(Date date) |
String |
toDateStringForFilename(Date date) |
String |
toDateTimeString(Date date) |
String |
toDateTimeStringForFilename(Date date) |
String |
toString(Date date,
String pattern) |
String |
toTimeString(Time time) |
public MockDateTimeService()
public String toDateString(Date date)
toDateString
in interface DateTimeService
public String toTimeString(Time time)
toTimeString
in interface DateTimeService
public String toDateTimeString(Date date)
toDateTimeString
in interface DateTimeService
public String toString(Date date, String pattern)
toString
in interface DateTimeService
public Date getCurrentDate()
getCurrentDate
in interface DateTimeService
public Timestamp getCurrentTimestamp()
getCurrentTimestamp
in interface DateTimeService
public Date getCurrentSqlDate()
getCurrentSqlDate
in interface DateTimeService
public Date getCurrentSqlDateMidnight()
getCurrentSqlDateMidnight
in interface DateTimeService
public Calendar getCurrentCalendar()
getCurrentCalendar
in interface DateTimeService
public Calendar getCalendar(Date date)
getCalendar
in interface DateTimeService
public Date convertToDate(String dateString) throws ParseException
convertToDate
in interface DateTimeService
ParseException
public Date convertToDateTime(String dateTimeString) throws ParseException
convertToDateTime
in interface DateTimeService
ParseException
public Timestamp convertToSqlTimestamp(String timeString) throws ParseException
convertToSqlTimestamp
in interface DateTimeService
ParseException
public Date convertToSqlDate(String dateString) throws ParseException
convertToSqlDate
in interface DateTimeService
ParseException
public Date convertToSqlDateUpperBound(String dateString) throws ParseException
convertToSqlDateUpperBound
in interface DateTimeService
ParseException
public Time convertToSqlTime(String timeString) throws ParseException
convertToSqlTime
in interface DateTimeService
ParseException
public Date convertToSqlDate(Timestamp timestamp) throws ParseException
convertToSqlDate
in interface DateTimeService
ParseException
public int dateDiff(Date date1, Date date2, boolean inclusive)
dateDiff
in interface DateTimeService
public String toDateStringForFilename(Date date)
toDateStringForFilename
in interface DateTimeService
public String toDateTimeStringForFilename(Date date)
toDateTimeStringForFilename
in interface DateTimeService
Copyright © 2005–2014 The Kuali Foundation. All rights reserved.