Merge pull request #2253 from open-sausages/pulls/4/date-languish

Set locale on datefields from current user
This commit is contained in:
Robbie Averill 2018-09-10 16:05:18 +02:00 committed by GitHub
commit 6bdf9a8ccc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -922,11 +922,11 @@ class CMSMain extends LeftAndMain implements CurrentPageIdentifier, PermissionPr
$dateFrom = DateField::create(
'LastEditedFrom',
_t('SilverStripe\\CMS\\Search\\SearchForm.FILTERDATEFROM', 'From')
);
)->setLocale(Security::getCurrentUser()->Locale);
$dateTo = DateField::create(
'LastEditedTo',
_t('SilverStripe\\CMS\\Search\\SearchForm.FILTERDATETO', 'To')
);
)->setLocale(Security::getCurrentUser()->Locale);
$filters = CMSSiteTreeFilter::get_all_filters();
// Remove 'All pages' as we set that to empty/default value
unset($filters[CMSSiteTreeFilter_Search::class]);