WIP: erp5_web_renderjs_ui: Change date separator from a dash to a slash before sending query to Zope
Zope DateTime uses local timezone automatically if date seperator was a slash like 2020/02/08, but if it was a dash like 2020-02-08, Zope DateTime ignores local timezone and timezone become GMT+0. Then if server is not located in GMT+0 zone, date search does not work. Since HTML5 date input field uses dash as a separator, it must be changed to slash before sending query to Zope.
# Server timezone is GMT+9.
>> print DateTime('2020-02-18')
2020/02/18 00:00:00 GMT+0
>> print DateTime('2020/02/18')
2020/02/18 00:00:00 GMT+9
#
# Server timezone is GMT+9
# context.portal_catalog(effective_date='2020-02-18', src__=1)
#
SELECT DISTINCT
catalog.path, catalog.uid
FROM
(
catalog AS `catalog`
INNER JOIN
versioning AS `versioning`
ON
`versioning`.`uid` = `catalog`.`uid`
)
WHERE
1 = 1
AND ((`versioning`.`effective_date` >= "2020-02-18 00:00:00"
AND `versioning`.`effective_date` < "2020-02-19 00:00:00")
AND (`catalog`.`viewable_owner` = 'zope'
OR `catalog`.`security_uid` IN (17, 20, 23, 24, 25, 28, 29, 30, 31, 32, 33, 34, 35, 36, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51)))
#
# Server timezone is GMT+9
# context.portal_catalog(effective_date='2020/02/18', src__=1)
#
SELECT DISTINCT
catalog.path, catalog.uid
FROM
(
catalog AS `catalog`
INNER JOIN
versioning AS `versioning`
ON
`versioning`.`uid` = `catalog`.`uid`
)
WHERE
1 = 1
AND ((`versioning`.`effective_date` >= "2020-02-17 15:00:00"
AND `versioning`.`effective_date` < "2020-02-18 15:00:00")
AND (`catalog`.`viewable_owner` = 'zope'
OR `catalog`.`security_uid` IN (17, 20, 23, 24, 25, 28, 29, 30, 31, 32, 33, 34, 35, 36, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51)))
@romain Could you review this MR?