mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-13 13:03:11 +00:00
[DS-643] New testing framework (GSoC 2010)
git-svn-id: http://scm.dspace.org/svn/repo/dspace/trunk@5252 9c30dcfa-912a-0410-8fc2-9e0234be79fd
This commit is contained in:
@@ -148,19 +148,26 @@ public class DCDate
|
||||
public DCDate(Date date)
|
||||
{
|
||||
super();
|
||||
if(date != null)
|
||||
{
|
||||
setTime(date);
|
||||
if (!(calendar.get(Calendar.HOUR_OF_DAY) == 0 &&
|
||||
calendar.get(Calendar.MINUTE) == 0 &&
|
||||
calendar.get(Calendar.SECOND) == 0))
|
||||
{
|
||||
granularity = DateGran.TIME;
|
||||
|
||||
}
|
||||
// if date is 1-jan, assume it's because this was set for year
|
||||
else if (calendar.get(Calendar.DAY_OF_MONTH) == 1 && calendar.get(Calendar.MONTH) == 0)
|
||||
{
|
||||
granularity = DateGran.YEAR;
|
||||
|
||||
}
|
||||
// otherwise day
|
||||
else
|
||||
{
|
||||
granularity = DateGran.DAY;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user