Tags:
create new tag
, view all tags

DateTimePluginDev Discussion: Page for developer collaboration, enhancement requests, patches and improved versions on DateTimePlugin contributed by the TWikiCommunity.
• Please let us know what you think of this extension.
• For support, check the existing questions, or ask a new support question in the Support web!
• Please report bugs below

Development discussion for DateTimePlugin

Hi, Finally I put it here. (on TWiki.org)
If you know how we can inc months (not more 30 days), you will give a great help!

-- AurelioAHeckert - 29 Mar 2005

Try the CPAN module Date::Calc. Incidentally, there has recently been some discussion in CalendarPlugin and SpreadSheetPlugin about formatting of date and time values. This is another variant. I'd like to see these converge rather than diverge.

-- DavidBright - 29 Mar 2005

Hey Aurelio, thanks for sharing this Plugin and the LinkOptionsPlugin smile

Plugins add lots of values to the TWiki platform and make it more flexible. Overloading a functionality of the TWiki core to enhance it is the right thing to do, as we have seen with TablePlugin, RenderListPlugin and MailerContrib. This is in line with the TWikiMission.

How about measuring and documenting the PluginBenchmarks?

-- PeterThoeny - 30 Mar 2005

Thanks David! Thanks Peter!

The Benchmark is done. I will try the CPAN Date::Calc!

-- AurelioAHeckert - 30 Mar 2005

Is CPAN:Date::Calc the right way to go? IMHO there should be one central component handling all the Date and Time issues consistently from within the Core and is shared by the Extensions. So I'm completely with David.

-- FranzJosefSilli - 31 Mar 2005

Yea. You are right. So, I propose we set the default names in the topic ConvergeDateTimeFormattingModels and new ideas will have a place to be showed.

-- AurelioAHeckert - 31 Mar 2005

checked .zip into CVS

-- WillNorris - 19 Jul 2005

The ActionTrackerPlugin (program actionnotify) was producing the following error:

"my" variable $month masks earlier declaration in same scope at /home/site/twiki3/lib/TWiki/Plugins/DateTimePlugin.pm line 154.

I "fixed" this with the following patch:

[root@hive twiki3]# diff lib/TWiki/Plugins/DateTimePlugin.pm lib/TWiki/Plugins/DateTimePlugin.pm.original
144c144
<    my ($sec, $min, $hour, $day, $monthn, $year, $wday, $yday) = gmtime( time() + $inc );
---
>    my ($sec, $min, $hour, $day, $month, $year, $wday, $yday) = gmtime( time() + $inc );
149,150c149,150
<    my $mo = ( ($monthn < 10)? '0' : '' ) . $monthn;
<    my $numMonth = $monthn;
---
>    my $mo = ( ($month < 10)? '0' : '' ) . $month;
>    my $numMonth = $month;

-- BruceDawson - 02 Sep 2005

I ran into some problems with this plugin today, specifically regarding the use of $mo. It appears to be indexed from 0, rather than 1 (which I expected). Thus,

   * %GMTIME{"$day $month, $year - $hour:$min:$sec"}%
   * %GMTIME{"$day $mo, $year - $hour:$min:$sec"}%

   * %DATETIME{"$year $month $day2"}%
   * %DATETIME{"$year $mo $day2"}%

produces

    * 01 Mar, 2007 - 11:41:50
    * 01 03, 2007 - 11:41:50

    * 2007 Mar 01
    * 2007 02 01

GMTIME handles this by incrementing the month value on substitution; it also handles the '0' prefix here using sprintf(). I've attached a patch to DateTimePlugin.pm which mimics this behaviour and allows for much more useful results of $mo. I guess a new code could be used if the 0-indexed value is still required.

-- BobbyJack - 01 Mar 2007

I have taken over the plugin development from AurelioAHeckert. Update 1.0 should fix the bugs mentioned above. Warning: the new version will not work on Cairo.

-- ArthurClemens - 28 Feb 2008

I've just started using it on my 4.1.2 installation. I was a bit worried since it's not tested on 4.1 according to DateTimePlugin page. But it's working just fine.

-- HideyoImazu - 10 Jul 2008

It would be useful if this could also take a week number (provided by $week) and convert it into a date. I suppose SpreadSheetPlugin can do this.

-- MartinCleaver - 03 Aug 2008

Edit | Attach | Watch | Print version | History: r14 < r13 < r12 < r11 < r10 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r14 - 2008-08-03 - MartinCleaver
 
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2017 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.