Item14734: make DateManipPlugin a swiss army date time parsing and formatting solution

pencil
Priority: Enhancement
Current State: Closed
Released In: n/a
Target Release:
Applies To: Extension
Component: DBCacheContrib, DBCachePlugin, DateManipPlugin, MoreFormfieldsPlugin
Branches: master
Reported By: MichaelDaum
Waiting For:
Last Change By: MichaelDaum
Replace the standard date time parser of Foswiki by monkey patching

  • Foswiki::Time::parseTime
  • Foswiki::Time::formatTime
  • =Foswiki::Time::formatDelta=
  • Foswiki::Func::formatTime

This lets us have multilingual dates as well as overcome the shortcomings of Foswiki's homegrown date time parser. Single drawback is that CPAN:Date::Manip is quite slow. Which means statistics runs a lot slower. A slow statistics cron job does in effect block the rest of the site from being accessible as reported in Item14732. For this single case will DateManipPlugin fall back to the original Foswiki::Time::parseTime() implementation, as date times in event.log are iso dates anyway, so there is no real need to use Date::Manip in this single case.

There are a lot of plugins that require a more versatile date time parser and thus use CPAN:Time::ParseDate, yet another CPAN solution. Instead, parsing date times will then be performed the standard way via Foswiki::Time::parseTime() and then rerouted to DateManipPlugin which covers all features of Time::ParseDate ... and have even more.

-- MichaelDaum - 20 Jun 2018

 
Topic revision: r2 - 10 Jan 2019, MichaelDaum
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy