Closed uwaheed88 closed 4 years ago
It is not a good idea to split the time string each time we need to use it in the UI, what we should do is to update common.tag_to_dict
logic, and modify how we create the created
field ('created': tag.created.isoformat(),
) so it can be directly used in CKAN's render_datetime
helper.
Can you move the fix to tag_to_dict
logic?
I have reviewed a little bit @uwaheed88 and this seems also like a buggy behaviour in CKAN due that helpers.render_datetime
says it expects a ISO format string so I'm not sure why passing a date_time.isoformat()
returns None
. Maybe it is worth to explore a little bit what's happening.
@pdelboca in CKAN core helpers.py the render_datetime()
is expecting an ISO format date but without the tzinfo. If there is the tzinfo present in the string this line returns a None value
because this function _datestamp_to_datetime() generates an ValueError exception.
due to this
Also, I found out that CKAN function _datestamp_to_datetime itself setting a timezone (UTC)
Okay! It's good to understand the context. Then move the logic to the common.tag_to_dict
to return what CKAN expects.
Issue :IVT-2717
current_version.created
date by splitting the extra part inread.html
.h.render_datetime
function inversions_list.html
for showing the date_time of the version in thePublished
column instead of an unimplemented snippet.