enonic/app-rss

Better handling of timezone config on dateTime for publishDate field

Closed this issue · 5 comments

When adding the pubDate node in RSS we don't handle timezones in a good way. This is needed for 1.0 release. It should detect datetime format and act accordingly.

To work with dateTime on all solutions that I'm inserted, I'm using moment.js and moment-timezone. This is a huge-spread lib that many javascript developers like. As it's very stable, I think it should be a good one to use on this app. I'm making some tests with the rss feed and soon I'll commit my changes to you check if it's ok for the v1.0 :)

A new field on the RSS Page content type could be added to use user-seted timezone (with UTC+0 as default). That way, if my application rss serves from Oslo for example, I could use "Europe/Oslo". A full list of timezones could be added to the main documentation to help users how to find the correct one for the app.
Ref: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones

I've merged current things for 0.12.0, not released yet. I don't see why this setting is needed, nor why moment is added manually (we have a lib for it on Market). After hearing back from you I can fix final things and release new version. Other changes are merged and they work very well, thx! =)

Conclusion here (from another thread) is to do this (I can do this during the week):

  • Remove lib-context
  • Remove local moment.js
  • Evaluate if timezone moment is needed
  • Add (and use) lib-moment from Market
  • Remove setting on site/cty for timezone (always read selected content type's timezone instead)
  • Test any remaining code, especially for timezone on/off in different content types
  • Tag and Release 0.12.0

This is now working properly