Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: use $db->dateFormat in Model #8538

Merged
merged 2 commits into from
Feb 17, 2024

Conversation

kenjis
Copy link
Member

@kenjis kenjis commented Feb 12, 2024

Description
For #7177
See #8525

How it works

If you set the date/time formats in your DB config,

        'dateFormat'   => [
            'date'     => 'Y-m-d',
            'datetime' => 'Y-m-d H:i:s',
        ],

the formats will be used when a Model converts a Time instance to a string.

Checklist:

  • Securely signed commits
  • Component(s) with PHPDoc blocks, only if necessary or adds value
  • Unit testing, with >80% coverage
  • User guide updated
  • Conforms to style guide

@kenjis kenjis added enhancement PRs that improve existing functionalities 4.5 database Issues or pull requests that affect the database layer labels Feb 12, 2024
@kenjis kenjis force-pushed the feat-model-uses-db-dateFormat branch from 4dc1711 to d38f1f2 Compare February 13, 2024 01:15
@kenjis
Copy link
Member Author

kenjis commented Feb 13, 2024

Added docs.

kenjis added a commit to kenjis/codeigniter-shield that referenced this pull request Feb 14, 2024
@kenjis kenjis merged commit 17381a0 into codeigniter4:4.5 Feb 17, 2024
47 checks passed
@kenjis kenjis deleted the feat-model-uses-db-dateFormat branch February 17, 2024 02:05
@kenjis
Copy link
Member Author

kenjis commented Apr 8, 2024

This change is not sufficient. See codeigniter4/shield#1086 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4.5 database Issues or pull requests that affect the database layer enhancement PRs that improve existing functionalities
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants