mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
ALF-10243: form-service date-control now allows configuring only to send date-component of "date-only" formfields (timezone and time-component is reset server-side to prevent unnecesairy timezone-issues)
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@36623 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -23,11 +23,13 @@ import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.TimeZone;
|
||||
|
||||
import org.alfresco.repo.forms.FormException;
|
||||
import org.alfresco.service.cmr.dictionary.DataTypeDefinition;
|
||||
import org.alfresco.service.cmr.dictionary.PropertyDefinition;
|
||||
import org.alfresco.service.cmr.repository.datatype.DefaultTypeConverter;
|
||||
import org.alfresco.util.ISO8601DateFormat;
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONException;
|
||||
import org.springframework.extensions.surf.util.I18NUtil;
|
||||
@@ -64,6 +66,11 @@ public class TypedPropertyValueGetter
|
||||
{
|
||||
return processLocaleValue(value);
|
||||
}
|
||||
else if(isDateProperty(propDef) && value instanceof String && !ISO8601DateFormat.isTimeComponentDefined((String) value))
|
||||
{
|
||||
// Special handling for day-only date storage (ALF-10243)
|
||||
return ISO8601DateFormat.parseDayOnly((String) value, TimeZone.getDefault());
|
||||
}
|
||||
else if (value instanceof String)
|
||||
{
|
||||
String valStr = (String) value;
|
||||
@@ -120,6 +127,11 @@ public class TypedPropertyValueGetter
|
||||
return propDef.getDataType().getName().equals(DataTypeDefinition.BOOLEAN);
|
||||
}
|
||||
|
||||
private boolean isDateProperty(PropertyDefinition propDef)
|
||||
{
|
||||
return propDef.getDataType().getName().equals(DataTypeDefinition.DATE);
|
||||
}
|
||||
|
||||
private Serializable processLocaleValue(Object value)
|
||||
{
|
||||
if (value instanceof String)
|
||||
|
Reference in New Issue
Block a user