diff --git a/src/Commands/Delete.php b/src/Commands/Delete.php index a74934c..ca3ff36 100644 --- a/src/Commands/Delete.php +++ b/src/Commands/Delete.php @@ -57,7 +57,7 @@ protected function execute(InputInterface $input, OutputInterface $output) { $question = new ConfirmationQuestion('Are you sure?', false); $confirm = NULL; - if (($slot = $this->repository->slot($slot_id)) && ($confirm = ($input->hasOption('confirm') || $helper->ask($input, $output, $question))) && $this->repository->delete($slot_id)) { + if (($slot = $this->repository->slot($slot_id)) && ($confirm = ($input->getOption('confirm') || $helper->ask($input, $output, $question))) && $this->repository->delete($slot_id)) { $deleted = $this->connector->ticketDetails($slot->tid); $output->writeln(sprintf('Deleted slot %d against ticket %d: %s, duration %s', $slot->id, diff --git a/src/Reviewer.php b/src/Reviewer.php index 21f8328..fa04fb2 100644 --- a/src/Reviewer.php +++ b/src/Reviewer.php @@ -84,8 +84,8 @@ public function getSummary($date = 19780101, $check = FALSE, $exact = FALSE) { $duration, ]; if ($exact) { - $row[] = Formatter::formatDuration($record->end - $record->start); - $exact_total += ($record->end - $record->start); + $row[] = Formatter::formatDuration(($record->end ?: time()) - $record->start); + $exact_total += (($record->end ?: time()) - $record->start); } $row = array_merge($row, [ substr($details->getTitle(), 0, 25) . '...',