Skip to content

Commit

Permalink
remove icon route
Browse files Browse the repository at this point in the history
fix time formatter for negative values
  • Loading branch information
patrickweh committed Oct 20, 2024
1 parent 457a637 commit 9e9ac79
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
6 changes: 5 additions & 1 deletion resources/js/tall-datatables.js
Original file line number Diff line number Diff line change
Expand Up @@ -690,6 +690,10 @@ window.formatters = {
return value;
}

let inputValue = value;
// make the value absolute
value = Math.abs(value);

let seconds = Math.floor(value / 1000);
let minutes = Math.floor(seconds / 60);
seconds = seconds % 60;
Expand All @@ -700,7 +704,7 @@ window.formatters = {
minutes = minutes.toString().padStart(2, '0');
seconds = seconds.toString().padStart(2, '0');

return `${hours}:${minutes}:${seconds}`;
return (inputValue < value ? '-' : '') + `${hours}:${minutes}:${seconds}`;
},
float(value) {
if (isNaN(parseFloat(value))) {
Expand Down
1 change: 0 additions & 1 deletion routes/web.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

use Illuminate\Support\Facades\Route;
use TeamNiftyGmbH\DataTable\Controllers\AssetController;
use TeamNiftyGmbH\DataTable\Controllers\IconController;

Route::name('tall-datatables.')->prefix('/tall-datatables')->group(function () {
Route::get('/assets/scripts', [AssetController::class, 'scripts'])->name('assets.scripts');
Expand Down
1 change: 0 additions & 1 deletion src/Helpers/ModelInfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ public static function forModel(string|Model|ReflectionClass $model): BaseModelI
$relations = RelationFinder::forModel($model);
} catch (\Throwable $e) {
throw $e;
$relations = collect();
}

try {
Expand Down

0 comments on commit 9e9ac79

Please sign in to comment.