Commit 72db2000 authored by Jérome Perrin's avatar Jérome Perrin

hal_json_style: implement default_to_now on date time fields

parent 81ba7f58
Pipeline #5587 canceled with stage
......@@ -185,6 +185,8 @@ def renderField(traversed_document, field, form_relative_url, value=None, meta_t
"hidden_day_is_last_day": field.get_value('hidden_day_is_last_day'),
}
date_value = getFieldDefault(traversed_document, field, result["key"], value)
if not date_value and field.get_value('default_now'):
date_value = DateTime()
if same_type(date_value, DateTime()):
# Serialize DateTime
date_value = date_value.rfc822()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment