Strict model: Set format for date objects #223

Closed
opened 2021-03-09 02:08:36 +00:00 by jamie · 3 comments
jamie commented 2021-03-09 02:08:36 +00:00 (Migrated from git.hazaar.io)

If we have a date field, allow the format of the field to be set using strict model field definitions.

Such as:

[
  'mydate' => [
    'type' => '\Hazaar\Date',
    'format' => 'Y-m-d'
  ]
]

This means that if we convert the date to a string automatically somewhere else, we can set the format here so that no other code needs to be written.

If we have a date field, allow the format of the field to be set using strict model field definitions. Such as: ```php [ 'mydate' => [ 'type' => '\Hazaar\Date', 'format' => 'Y-m-d' ] ] ``` This means that if we convert the date to a string automatically somewhere else, we can set the format here so that no other code needs to be written.
jamie commented 2021-03-09 02:08:39 +00:00 (Migrated from git.hazaar.io)

mentioned in merge request !113

mentioned in merge request !113
jamie commented 2021-03-09 02:08:39 +00:00 (Migrated from git.hazaar.io)

created merge request !113 to address this issue

created merge request !113 to address this issue
jamie commented 2021-03-09 02:21:53 +00:00 (Migrated from git.hazaar.io)

mentioned in commit 4a30155d1a27cfdab9f1e2aab24e7d404fdb1d6f

mentioned in commit 4a30155d1a27cfdab9f1e2aab24e7d404fdb1d6f
jamie (Migrated from git.hazaar.io) closed this issue 2021-03-09 02:21:53 +00:00
jamie self-assigned this 2025-09-04 01:15:28 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: hazaar/framework#223
No description provided.