wet-boew / wet-boew

Web Experience Toolkit (WET): Open source code library for building innovative websites that are accessible, usable, interoperable, mobile-friendly and multilingual. This collaborative open source project is led by the Government of Canada.
https://wet-boew.github.io/wet-boew/index-en.html
Other
1.6k stars 660 forks source link

Incorrect date display using Feeds plugin #8215

Open mouchetbj opened 6 years ago

mouchetbj commented 6 years ago

We are trying to employ the WET4 Feeds plugin to display our RSS Feeds. The date is picked up however the time stamp does not get parsed and renders as "00:00"

For example, the element in a feed would have a date as such:

2017-11-27T20:33:40.7181162Z

then the Feeds plugin renders the updated date on the screen like this:

[2017-11-25 00:00]

We can rule out this being an issue with the xml as this bug is apparent on the Feeds working examples page: http://wet-boew.github.io/wet-boew/demos/feeds/feeds-en.html

As well, I've tested all versions from 4.0.21 - 4.0.26 with the same result.

nschonni commented 6 years ago

Not sure if it's related, but the current example feed doesn't validate https://validator.w3.org/feed/check.cgi?url=http%3A%2F%2Fwww.tc.gc.ca%2Fmediaroom%2Frss%2Froad.xml

nschonni commented 6 years ago

The timezone information looks like it is getting chopped up when the date is feed to the toDateISO function

duboisp commented 6 years ago

@mouchetbj are you using the GCweb theme? and if so which version?

Since WET 4.0.25, which introduce templating with the HTML 5 <template> element, you may display your feed the way you want. You will only neeed to manually use the Yahoo feed reader API services in order to transform your XML into a JSON file.

See the last working example here: http://wet-boew.github.io/themes-dist/GCWeb/demos/data-json/template-en.html

If you need to format you date before to display it, then you can use a JSON Manager to do it.

mouchetbj commented 6 years ago

@duboisp we are currently using 4.0.25. Ideally we'd like to use the Web Feeds plugin without any customization. While it may be feasible to transform any XML into JSON to make use of the formatting features of