Skip to content

Unexpected result using {{ date }} and setting 'localize_dates_in_modifiers' => false #13869

Description

@helloDanuk

Bug description

I am not sure if this is a bug, but it confused me. 'localize_dates_in_modifiers' => false, behaves differently for {{ date }} depending on how the variable is used in the template.

Use case:

{{ date }} => variable from dated collection
{{ second_date }} => just an other date fieldtype

Image

How to reproduce

Now, for {{ date }} it depends on whether the following template is used with or without the underlined first line of text:

display_timezone is set to: 'display_timezone' => 'Europe/Zurich',

Image

With first text line

'localize_dates_in_modifiers' => false

Why not 18:25? …as described here

Image

'localize_dates_in_modifiers' => true

Expected behaviour

Image

Without first text line

'localize_dates_in_modifiers' => false

Expected behaviour

Image

'localize_dates_in_modifiers' => true

Expected behaviour

Image

Logs

Environment

EnvironmentApplication Name: StatamicLaravel Version: 12.50.0PHP Version: 8.3.30Composer Version: 2.9.3Environment: localDebug Mode: ENABLEDURL: date-test.testMaintenance Mode: OFFTimezone: UTCLocale: de_CHCacheConfig: NOT CACHEDEvents: NOT CACHEDRoutes: NOT CACHEDViews: CACHEDDriversBroadcasting: logCache: fileDatabase: sqliteLogs: stack / singleMail: logQueue: syncSession: fileStoragepublic/storage: NOT LINKEDStatamicAddons: 0Sites: 1Stache Watcher: Enabled (auto)Static Caching: DisabledVersion: 6.2.4 PRO

Installation

Fresh statamic/statamic site via CLI

Additional details

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions