RM-1532, fixed submission date comparison for some dates on edit metadata of completed pictures

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@75196 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Mark Hibbins
2014-06-30 09:29:27 +00:00
parent 238a63e255
commit e72231f8a5

View File

@@ -562,8 +562,17 @@ public class RecordServiceImpl extends BaseBehaviourBean
boolean propertyUnchanged = false;
if (beforeValue instanceof Date && afterValue instanceof Date)
{
// deal with date values
propertyUnchanged = (((Date)beforeValue).compareTo((Date)afterValue) == 0);
// deal with date values, remove the seconds and milliseconds for the
// comparison as they are removed from the submitted for data
Calendar beforeCal = Calendar.getInstance();
beforeCal.setTime((Date)beforeValue);
Calendar afterCal = Calendar.getInstance();
afterCal.setTime((Date)afterValue);
beforeCal.set(Calendar.SECOND, 0);
beforeCal.set(Calendar.MILLISECOND, 0);
afterCal.set(Calendar.SECOND, 0);
afterCal.set(Calendar.MILLISECOND, 0);
propertyUnchanged = (beforeCal.compareTo(afterCal) == 0);
}
else if ((afterValue instanceof Boolean) && (beforeValue == null) && (afterValue == Boolean.FALSE))
{