Model Admin Plus looks through your GridFields
and finds any DBDate
fields. It then
automatically converts those dates to a Nice
format (while retaining sorting).
If you do not want ModelAdminPlus
to automatically convert DBDate
/DBDateTime
fields
to a formatted column (default to DBDate.Nice
), you can disable this via SilverStripe
config, using:
ilateral\SilverStripe\ModelAdminPlus.auto_convert_dates
If you want to change how ModelAdminPlus formats dates (without effecting the Nice method),
you can do this via the helper class GridFieldDateFinder
. You can configure this either
globally, or per instance called.
You can change all instances of date re-format by setting the following SilverStripe config variable:
ilateral\SilverStripe\ModelAdminPlus.default_date_type
You can change specific instances of the date format every time you call the GridFieldDateFinder class, by using the following method:
ilateral\SilverStripe\ModelAdminPlus::setDateType("newDateType")