Skip to content

Commit

Permalink
Item14311: empty date2 formfields are empty
Browse files Browse the repository at this point in the history
... not 01 Jan 1970
  • Loading branch information
MichaelDaum committed Jan 27, 2017
1 parent 8fb199a commit 5d332da
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
1 change: 1 addition & 0 deletions data/System/MoreFormfieldsPlugin.txt
Expand Up @@ -205,6 +205,7 @@ A user reference using JQSelect2Contrib for autocompletion.

---++ Change History
%TABLE{columnwidths="7em" tablewidth="100%"}%
| 27 Jan 2017: | render empty =date2= formfields as an empty string, not 01 Jan 1970 |
| 25 Jan 2017: | fixed =topic= formfield to properly store web dot topic values |
| 16 Jan 2017: | replace <nop>MoreFormfieldsAjaxHelper with a template solution to be able to override it when required; \
fixes in =id= and =autofill= formfields; \
Expand Down
6 changes: 5 additions & 1 deletion lib/Foswiki/Form/Date2.pm
Expand Up @@ -28,7 +28,11 @@ sub renderForDisplay {

my $epoch = Foswiki::Time::parseTime($value);
$epoch = 0 unless defined $epoch;
$value = Foswiki::Time::formatTime($epoch, $Foswiki::cfg{DefaultDateFormat} || '$year/$mo/$day', 'gmtime');
if ($epoch) {
$value = Foswiki::Time::formatTime($epoch, $Foswiki::cfg{DefaultDateFormat} || '$year/$mo/$day', 'gmtime');
} else {
$value = '';
}

return $this->SUPER::renderForDisplay($format, $value, $attrs);
}
Expand Down
4 changes: 2 additions & 2 deletions lib/Foswiki/Plugins/MoreFormfieldsPlugin.pm
Expand Up @@ -25,8 +25,8 @@ use Foswiki::Plugins ();

use Error qw(:try);

our $VERSION = '3.01';
our $RELEASE = '25 Jan 2017';
our $VERSION = '3.02';
our $RELEASE = '27 Jan 2017';
our $SHORTDESCRIPTION = 'Additional formfield types for %SYSTEMWEB%.DataForms';
our $NO_PREFS_IN_TOPIC = 1;

Expand Down

0 comments on commit 5d332da

Please sign in to comment.