Commit dbc1c341 authored by Xiaowu Zhang's avatar Xiaowu Zhang

erp5_web_renderjs_ui: return empty data if datetimefield has no value

parent 6295d6c8
...@@ -284,6 +284,15 @@ ...@@ -284,6 +284,15 @@
select = this.element.querySelector("select");\n select = this.element.querySelector("select");\n
result[field_json.subfield_timezone_key] = select.options[select.selectedIndex].value;\n result[field_json.subfield_timezone_key] = select.options[select.selectedIndex].value;\n
}\n }\n
} else {\n
//if no value, return empty data\n
if (field_json.date_only === 0) {\n
result[field_json.subfield_hour_key] = "";\n
result[field_json.subfield_minute_key] = "";\n
}\n
result[field_json.subfield_year_key] = "";\n
result[field_json.subfield_month_key] = "";\n
result[field_json.subfield_day_key] = "";\n
}\n }\n
return result;\n return result;\n
})\n })\n
...@@ -493,7 +502,7 @@ ...@@ -493,7 +502,7 @@
</item> </item>
<item> <item>
<key> <string>actor</string> </key> <key> <string>actor</string> </key>
<value> <string>zope</string> </value> <value> <string>xiaowu</string> </value>
</item> </item>
<item> <item>
<key> <string>comment</string> </key> <key> <string>comment</string> </key>
...@@ -507,7 +516,7 @@ ...@@ -507,7 +516,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>941.29666.30820.17834</string> </value> <value> <string>943.415.21085.47820</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -525,7 +534,7 @@ ...@@ -525,7 +534,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1425561983.22</float> <float>1433234446.35</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
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