Skip to content

Commit 2555a72

Browse files
[6.x] Improved Timezone Handling (#11409)
Co-authored-by: Jason Varga <[email protected]>
1 parent cdf62b5 commit 2555a72

File tree

32 files changed

+1794
-231
lines changed

32 files changed

+1794
-231
lines changed

config/system.php

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,35 @@
7474

7575
'date_format' => 'F jS, Y',
7676

77+
/*
78+
|--------------------------------------------------------------------------
79+
| Timezone
80+
|--------------------------------------------------------------------------
81+
|
82+
| Statamic will use this timezone when displaying dates on the front-end.
83+
| You can use any timezone supported by PHP. When set to null it will
84+
| fall back to the timezone defined in your `app.php` config file.
85+
|
86+
| https://www.php.net/manual/en/timezones.php
87+
|
88+
*/
89+
90+
'display_timezone' => null,
91+
92+
/*
93+
|--------------------------------------------------------------------------
94+
| Localize Dates in Modifiers
95+
|--------------------------------------------------------------------------
96+
|
97+
| When using date-related modifiers, Carbon instances will be in UTC.
98+
| Enabling this setting will ensure that dates get localized into
99+
| the timezone defined in `display_timezone`. Otherwise you'll
100+
| need to manually localize dates in all of your templates.
101+
|
102+
*/
103+
104+
'localize_dates_in_modifiers' => false,
105+
77106
/*
78107
|--------------------------------------------------------------------------
79108
| Default Character Set

package-lock.json

Lines changed: 19 additions & 18 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
"knip": "knip"
1616
},
1717
"dependencies": {
18+
"@angelblanco/v-calendar": "^3.1.2",
1819
"@floating-ui/dom": "^1.2.5",
1920
"@he-tree/vue": "^2.8.2",
2021
"@hoppscotch/vue-toasted": "^0.1.0",
@@ -85,7 +86,6 @@
8586
"tiny-emitter": "^2.1.0",
8687
"uniqid": "^5.2.0",
8788
"upload": "^1.3.2",
88-
"v-calendar": "^3.1.2",
8989
"validator": "^13.7.0",
9090
"vite-svg-loader": "^5.1.0",
9191
"vue": "^3.4.27",

resources/js/bootstrap/fieldtypes.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import Routes from '../components/collections/Routes.vue';
2020
import TitleFormats from '../components/collections/TitleFormats.vue';
2121
import ColorFieldtype from '../components/fieldtypes/ColorFieldtype.vue';
2222
import DateFieldtype from '../components/fieldtypes/DateFieldtype.vue';
23+
import DateIndexFieldtype from '../components/fieldtypes/DateIndexFieldtype.vue';
2324
import DictionaryFieldtype from '../components/fieldtypes/DictionaryFieldtype.vue';
2425
import DictionaryIndexFieldtype from '../components/fieldtypes/DictionaryIndexFieldtype.vue';
2526
import DictionaryFields from '../components/fieldtypes/DictionaryFields.vue';
@@ -92,6 +93,7 @@ export default function registerFieldtypes(app) {
9293
app.component('collection_title_formats-fieldtype', TitleFormats);
9394
app.component('color-fieldtype', ColorFieldtype);
9495
app.component('date-fieldtype', DateFieldtype);
96+
app.component('date-fieldtype-index', DateIndexFieldtype);
9597
app.component('dictionary-fieldtype', DictionaryFieldtype);
9698
app.component('dictionary-fieldtype-index', DictionaryIndexFieldtype);
9799
app.component('dictionary_fields-fieldtype', DictionaryFields);

resources/js/bootstrap/statamic.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ import useDirtyState from '../composables/dirty-state';
1313
import VueClickAway from 'vue3-click-away';
1414
import FloatingVue from 'floating-vue';
1515
import 'floating-vue/dist/style.css';
16-
import VCalendar from 'v-calendar';
17-
import 'v-calendar/style.css';
16+
import VCalendar from '@angelblanco/v-calendar';
17+
import '@angelblanco/v-calendar/style.css';
1818
import Toasts from '../components/Toasts';
1919
import PortalVue from 'portal-vue';
2020
import Keys from '../components/keys/Keys';

0 commit comments

Comments
 (0)