fixed: DataForm acknowledgement screen shows incorrect value for Date/Time fields

This commit is contained in:
Graham Knop 2008-08-14 17:23:14 +00:00
parent 7f095970c6
commit 7be08540c1
4 changed files with 5 additions and 6 deletions

View file

@ -447,7 +447,7 @@ Returns the value rendered suitably in HTML. This is useful for forms that are r
sub getValueAsHtml {
my $self = shift;
return $self->getDefaultValue(@_);
return $self->getOriginalValue(@_);
}
#-------------------------------------------------------------------

View file

@ -178,10 +178,8 @@ Return the date in a human readable format.
sub getValueAsHtml {
my ($self) = @_;
# This should probably be rewritten as a cascading ternary
if (!$self->get("defaultValue")
|| $self->get("defaultValue") =~ m/^\d+$/
|| !$self->get("value")
|| $self->get("value") =~ m/^\d+$/) {
my $formatValue = $self->getDefaultValue || $self->getOriginalValue;
if (!$formatValue || $formatValue =~ m/^\d+$/) {
return $self->session->datetime->epochToHuman($self->getOriginalValue,"%z %Z");
}
else {