Set locale on datefields from current user

This commit is contained in:
Aaron Carlino 2018-09-06 09:41:52 +12:00
parent 2fbeda1564
commit 0f00de78ad

View File

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