|
|
@ -316,7 +316,7 @@ sub is_positive_int{ |
|
|
|
return 'OK'; |
|
|
|
return 'OK'; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
# Take a string representing a date, must be YYY-MM-DD format, and in the future, or an empty string |
|
|
|
# Take a string representing a date, must be YYY-MM-DD format, and in the future (including today), or an empty string |
|
|
|
sub is_future_date_or_empty { |
|
|
|
sub is_future_date_or_empty { |
|
|
|
my ($self, $date_string) = @_; |
|
|
|
my ($self, $date_string) = @_; |
|
|
|
return 'OK' if ($date_string eq ''); |
|
|
|
return 'OK' if ($date_string eq ''); |
|
|
@ -330,7 +330,7 @@ sub is_future_date_or_empty { |
|
|
|
}; |
|
|
|
}; |
|
|
|
return $self->localise('DATE_FORMAT_INVALID') unless ($date); |
|
|
|
return $self->localise('DATE_FORMAT_INVALID') unless ($date); |
|
|
|
my $now = DateTime->now; |
|
|
|
my $now = DateTime->now; |
|
|
|
return $self->localise('DATE_IS_PASSED') unless ($date > $now); |
|
|
|
return $self->localise('DATE_IS_PASSED') unless ($date >= $now); |
|
|
|
return 'OK'; |
|
|
|
return 'OK'; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|