Skip to content

Date column should have ignoreTimezone=true by default. #1327

@mjauvin

Description

@mjauvin

Winter CMS Build

dev-develop

PHP Version

8.3

Database engine

MySQL/MariaDB

Plugins installed

No response

Issue description

When using a date column, since the time portion of the column value is most likely not set or set to an unknown value, we need to ignore the timezone in order to show the correct date.

The problem will show if the time portion in your db column is set to 00:00:00 or to a time smaller that the time difference from your timezone with UTC.

Steps to replicate

  • create a date column with type: date in your model
  • create a migration with $table->date('date') for that column
  • set your cms.backendTimezone to 'America/Toronto' (UTC -4 during summer)

When you display the column, it will show the previous day.

Workaround

Manually set ignoreTimezone: true in your column definition.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions