Skip to content

Commit

Permalink
No need to use DbHelper::prepareDateForDb()
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonkelly authored Aug 15, 2018
1 parent bdd29ca commit c91397c
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions docs/dev/element-queries/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,10 +124,9 @@ For example, if you want to load entries with a custom `eventDate` field set wit
```
```php{7}
use craft\elements\Entry;
use craft\helpers\Db;
$start = Db::prepareDateForDb(new \DateTime('first day of next month'));
$end = Db::prepareDateForDb(new \DateTime('last day of next month'));
$start = new \DateTime('first day of next month')->format(\DateTime::ATOM);
$end = new \DateTime('last day of next month')->format(\DateTime::ATOM);
$entries = Entry::find()
->section('events')
->eventDate(['and', ">= {$start}", "<= {$end}"])
Expand Down

0 comments on commit c91397c

Please sign in to comment.