This question about Using an extension: Answered

DateTimePlugin does not process the date= parameter correctly.

The problem is in the way this plugin implements the _isNumber() routine.
sub _isNumber {
    my ($n) = @_;

    eval {
        local $SIG{__WARN__} = sub { die $_[0] };
        $n += 0;
    };
    if   ($@) { return 0; }
    else      { return 1; }

}
This fails in my perl version: "This is perl 5, version 22, subversion 1 (v5.22.1) built for i686-linux-gnu-thread-multi-64int"

A working test would be:
sub _isNumber {
    my ($n) = @_;
if( ($n =~ /^\d+$/) ) { return 1; }
else {  return 0; }

}

But I chose to use DateManipPlugin instead.

Suggest adding a comment in DateTimePlugin documentation to mark its demise.

-- BramVanOosterhout - 02 Jan 2020

 

QuestionForm edit

Subject Using an extension
Extension DateTimePlugin
Version Foswiki 2.1.6
Status Answered
Related Topics
Topic revision: r2 - 02 Jan 2020, 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