FIX Datetime format for MySQL and Postgres, add widgets to Travis builds

This commit is contained in:
Robbie Averill 2017-09-27 13:16:38 +13:00
parent dae2ba0e5f
commit 427abee8b0
2 changed files with 2 additions and 2 deletions

View File

@ -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

View File

@ -117,7 +117,7 @@ class BlogArchiveWidget extends Widget
$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();