mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Merge V1.4 to HEAD
- Ignored Enterprise-specific changes svn merge svn://svn.alfresco.com:3691/alfresco/BRANCHES/V1.4@3701 svn://svn.alfresco.com:3691/alfresco/BRANCHES/V1.4@3703 . svn merge svn://svn.alfresco.com:3691/alfresco/BRANCHES/V1.4@3704 svn://svn.alfresco.com:3691/alfresco/BRANCHES/V1.4@3705 . svn merge svn://svn.alfresco.com:3691/alfresco/BRANCHES/V1.4@3707 svn://svn.alfresco.com:3691/alfresco/BRANCHES/V1.4@3876 . svn revert root\projects\web-client\source\web\jsp\admin\admin-console.jsp git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@3879 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -17,6 +17,7 @@
|
||||
package org.alfresco.web.data;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
import java.sql.Timestamp;
|
||||
import java.text.CollationKey;
|
||||
import java.text.Collator;
|
||||
import java.util.ArrayList;
|
||||
@@ -175,6 +176,10 @@ public abstract class Sort
|
||||
{
|
||||
this.comparator = new FloatComparator();
|
||||
}
|
||||
else if (returnType.equals(Timestamp.class))
|
||||
{
|
||||
this.comparator = new TimestampComparator();
|
||||
}
|
||||
else
|
||||
{
|
||||
s_logger.warn("Unsupported sort data type: " + returnType + " defaulting to .toString()");
|
||||
@@ -408,6 +413,20 @@ public abstract class Sort
|
||||
}
|
||||
}
|
||||
|
||||
private static class TimestampComparator implements Comparator
|
||||
{
|
||||
/**
|
||||
* @see org.alfresco.web.data.IDataComparator#compare(java.lang.Object, java.lang.Object)
|
||||
*/
|
||||
public int compare(final Object obj1, final Object obj2)
|
||||
{
|
||||
if (obj1 == null && obj2 == null) return 0;
|
||||
if (obj1 == null) return -1;
|
||||
if (obj2 == null) return 1;
|
||||
return ((Timestamp)obj1).compareTo((Timestamp)obj2);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// ------------------------------------------------------------------------------
|
||||
// Private Data
|
||||
|
Reference in New Issue
Block a user