mirror of
https://github.com/itflow-org/itflow
synced 2026-08-19 14:05:12 +00:00
Replace Function roundToNearest15() with roundToNearest15Min()
This commit is contained in:
@@ -272,7 +272,7 @@ ob_start();
|
|||||||
<div class="input-group-prepend">
|
<div class="input-group-prepend">
|
||||||
<span class="input-group-text"><i class="fa fa-fw fa-balance-scale"></i></span>
|
<span class="input-group-text"><i class="fa fa-fw fa-balance-scale"></i></span>
|
||||||
</div>
|
</div>
|
||||||
<input type="text" class="form-control" inputmode="decimal" pattern="-?[0-9]*\.?[0-9]{0,2}" name="qty" value="<?php echo roundToNearest15($ticket_total_reply_time); ?>" required>
|
<input type="text" class="form-control" inputmode="decimal" pattern="-?[0-9]*\.?[0-9]{0,2}" name="qty" value="<?php echo roundToNearest15Min($ticket_total_reply_time); ?>" required>
|
||||||
</div>
|
</div>
|
||||||
<small class="form-text text-muted">
|
<small class="form-text text-muted">
|
||||||
Based off Ticket time spent <strong><?= $ticket_total_reply_time ?></strong> in 15 Min Increments rounded up.
|
Based off Ticket time spent <strong><?= $ticket_total_reply_time ?></strong> in 15 Min Increments rounded up.
|
||||||
|
|||||||
@@ -278,7 +278,7 @@ function roundUpToNearestMultiple($n, $increment = 1000)
|
|||||||
return (int) ($increment * ceil($n / $increment));
|
return (int) ($increment * ceil($n / $increment));
|
||||||
}
|
}
|
||||||
|
|
||||||
function roundToNearest15($time)
|
function roundToNearest15Min($time)
|
||||||
{
|
{
|
||||||
// Validate the input time format
|
// Validate the input time format
|
||||||
if (!preg_match('/^(\d{2}):(\d{2}):(\d{2})$/', $time, $matches)) {
|
if (!preg_match('/^(\d{2}):(\d{2}):(\d{2})$/', $time, $matches)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user