Commit f634ac3e authored by Nicolas Wavrant's avatar Nicolas Wavrant

erp5_web_renderjs_ui: show timezone even if non-editable mode

IN non-editable mode the timezone was never shown even if the field was configured to display it.
parent 30ffec4e
...@@ -257,13 +257,6 @@ ...@@ -257,13 +257,6 @@
offset_time_zone; offset_time_zone;
if (gadget.state.value) { if (gadget.state.value) {
state_date = new Date(gadget.state.value); state_date = new Date(gadget.state.value);
if (gadget.state.timezone_style) {
text_content = state_date.toLocaleDateString(language);
if (!gadget.state.date_only) {
text_content += " " +
formatDateToLocaleFormatString(state_date, language);
}
} else {
//get timezone difference between server and local browser //get timezone difference between server and local browser
offset_time_zone = timezone + offset_time_zone = timezone +
(state_date.getTimezoneOffset() / 60); (state_date.getTimezoneOffset() / 60);
...@@ -275,6 +268,10 @@ ...@@ -275,6 +268,10 @@
text_content += " " + text_content += " " +
formatDateToLocaleFormatString(state_date, language); formatDateToLocaleFormatString(state_date, language);
} }
if (gadget.state.timezone_style) {
if (!gadget.state.date_only) {
text_content += " " + ZONE_LIST[timezone + 12][0];
}
} }
} }
p_state.text_content = text_content; p_state.text_content = text_content;
......
...@@ -228,7 +228,7 @@ ...@@ -228,7 +228,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>983.16851.20471.25753</string> </value> <value> <string>983.56055.11203.16827</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -246,8 +246,8 @@ ...@@ -246,8 +246,8 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1587092369.15</float> <float>1589358221.58</float>
<string>UTC</string> <string>GMT+0</string>
</tuple> </tuple>
</state> </state>
</object> </object>
......
...@@ -83,10 +83,9 @@ ...@@ -83,10 +83,9 @@
</tr> </tr>
<tr> <tr>
<td>assertElementPresent</td> <td>assertText</td>
<!-- Known bug, in non-editable mode the dates are translated to the client timezone as the timezone selector is not shown --> <td>//div[@data-gadget-scope='field_my_stop_date']//div[@data-gadget-scope='field']//p</td>
<td>//div[@data-gadget-scope='field_my_stop_date']//div[@data-gadget-scope='field']//p[contains(text(), '7:00')]</td> <td>glob:*12:00*GMT+5</td>
<td></td>
</tr> </tr>
<tr> <tr>
......
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