Skip to content

Commit

Permalink
FIX Datetime format for MySQL and Postgres, add widgets to Travis builds
Browse files Browse the repository at this point in the history
  • Loading branch information
robbieaverill committed Sep 27, 2017
1 parent dae2ba0 commit 427abee
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Expand Up @@ -23,7 +23,7 @@ before_script:

# Install composer dependencies
- composer install --prefer-dist
- composer require --prefer-dist --no-update silverstripe/installer:4.0.x-dev
- composer require --prefer-dist --no-update silverstripe/installer:4.0.x-dev silverstripe/widgets:2.x-dev
- if [[ $DB == PGSQL ]]; then composer require --prefer-dist --no-update silverstripe/postgresql:2.0.x-dev; fi
- composer update

Expand Down
2 changes: 1 addition & 1 deletion src/Widgets/BlogArchiveWidget.php
Expand Up @@ -117,7 +117,7 @@ public function getArchive()
$query = SQLSelect::create($fields, '"BlogPost' . $suffix . '"')
->addGroupBy($publishDate)
->addOrderBy('"PublishDate" DESC')
->addWhere(['"PublishDate" < ?' => DBDatetime::now()->getISOFormat()]);
->addWhere(['"PublishDate" < ?' => DBDatetime::now()->Format(DBDatetime::ISO_DATETIME)]);

$posts = $query->execute();
$result = ArrayList::create();
Expand Down

0 comments on commit 427abee

Please sign in to comment.