Skip to content
This repository has been archived by the owner on May 20, 2024. It is now read-only.

Commit

Permalink
Fixes usage of dashboard with different backend timezone config
Browse files Browse the repository at this point in the history
  • Loading branch information
nunomaduro committed Sep 18, 2020
1 parent 0e4b13e commit 3d7d269
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 14 deletions.
2 changes: 1 addition & 1 deletion public/app.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion public/mix-manifest.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"/app.js": "/app.js?id=ac38bd55e57dcc3a94bf",
"/app.js": "/app.js?id=4cd65553f3baa40505e0",
"/app.css": "/app.css?id=ac312744bf7a06265c21"
}
2 changes: 1 addition & 1 deletion resources/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ if (token) {

Vue.use(VueRouter);

moment.tz.setDefault(App.timezone);
moment.tz.setDefault('utc');

const router = new VueRouter({
routes: Routes,
Expand Down
10 changes: 9 additions & 1 deletion resources/js/mixins/interactsWithMetrics.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,15 @@ export default {
* Formats the given label to a tooltip title.
*/
formatTooltipTitle([{ label }]) {
return label + ' - ' + moment(label, 'LT').add(1, 'hours').format('LT');
return (
label +
' - ' +
moment(label, 'LT')
.add(1, 'hours')
.local(true)
.format('LT')
.replace(/:[0-9]{2}/, '')
);
},

/**
Expand Down
5 changes: 0 additions & 5 deletions resources/views/layout.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,11 +115,6 @@ class="group flex items-center px-2 py-2 text-sm leading-5 font-medium text-gray
<router-view></router-view>
</div>

<!-- Global App Object -->
<script>
window.App = @json($appVars);
</script>

<script src="{{ asset(mix('app.js', 'vendor/vapor-ui')) }}"></script>
</body>
</html>
6 changes: 1 addition & 5 deletions src/Http/Controllers/HomeController.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@ class HomeController
*/
public function __invoke()
{
return view('vapor-ui::layout', [
'appVars' => [
'timezone' => config('app.timezone'),
],
]);
return view('vapor-ui::layout');
}
}

0 comments on commit 3d7d269

Please sign in to comment.