diff --git a/app/Facades/Formatter.php b/app/Facades/Formatter.php new file mode 100644 index 0000000..ed43178 --- /dev/null +++ b/app/Facades/Formatter.php @@ -0,0 +1,13 @@ +app->singleton(Formatter::class, function ($app) { + return new Formatter(); + }); + } +} diff --git a/app/Utilities/Formatter.php b/app/Utilities/Formatter.php new file mode 100644 index 0000000..bb87a61 --- /dev/null +++ b/app/Utilities/Formatter.php @@ -0,0 +1,19 @@ + Illuminate\Support\Facades\Validator::class, 'View' => Illuminate\Support\Facades\View::class, + 'Formatter' => App\Facades\Formatter::class, ], ]; diff --git a/resources/views/home.blade.php b/resources/views/home.blade.php index dcea823..e8b45e8 100644 --- a/resources/views/home.blade.php +++ b/resources/views/home.blade.php @@ -31,10 +31,10 @@ @if (isset($summary) && $summary[0]->total_checkins > 0)
assessment概況
-平均記録: {{ $summary[0]->average }}
-最長記録: {{ $summary[0]->longest }}
-最短記録: {{ $summary[0]->shortest }}
-合計時間: {{ $summary[0]->total_times }}
+平均記録: {{ Formatter::formatInterval($summary[0]->average) }}
+最長記録: {{ Formatter::formatInterval($summary[0]->longest) }}
+最短記録: {{ Formatter::formatInterval($summary[0]->shortest) }}
+合計時間: {{ Formatter::formatInterval($summary[0]->total_times) }}
通算回数: {{ $summary[0]->total_checkins }}回
@endif diff --git a/resources/views/user/profile.blade.php b/resources/views/user/profile.blade.php index 3c9bf4e..521aa4a 100644 --- a/resources/views/user/profile.blade.php +++ b/resources/views/user/profile.blade.php @@ -39,10 +39,10 @@ @if (isset($summary) && $summary[0]->total_checkins > 0)assessment概況
-平均記録: {{ $summary[0]->average }}
-最長記録: {{ $summary[0]->longest }}
-最短記録: {{ $summary[0]->shortest }}
-合計時間: {{ $summary[0]->total_times }}
+平均記録: {{ Formatter::formatInterval($summary[0]->average) }}
+最長記録: {{ Formatter::formatInterval($summary[0]->longest) }}
+最短記録: {{ Formatter::formatInterval($summary[0]->shortest) }}
+合計時間: {{ Formatter::formatInterval($summary[0]->total_times) }}
通算回数: {{ $summary[0]->total_checkins }}回
@endif