If bare numbers are entered, they are interpreted as a number of
seconds. The most likely intent is minutes, so we force that unit.
Additionally, this commit sets a hard floor of 10 minutes on appointment
granularity.
Signed-off-by: Mike Rylander <mrylander@gmail.com>
Signed-off-by: Michele Morgan <mmorgan@noblenet.org>
Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>
return $conn->respond_complete unless ($start_obj);
my $gran = $U->ou_ancestor_setting_value($org, 'circ.curbside.granularity') || '15 minutes';
+ $gran .= ' minutes' if ($gran =~ /^\s*\d+\s*$/); # Assume minutes for bare numbers (maybe surrounded by spaces)
+
my $gran_seconds = interval_to_seconds($gran);
+ $gran_seconds = 600 if ($gran_seconds < 600); # No smaller than 10 minute intervals
my $max = $U->ou_ancestor_setting_value($org, 'circ.curbside.max_concurrent') || 10;