-
Notifications
You must be signed in to change notification settings - Fork 7
Open
Description
here is my codes:
public function getSearchFields()
{
$fields = ($this->fields) ? $this->fields : singleton($this->modelClass)->scaffoldSearchFields();
if ($fields) {
$dates = array();
foreach ($fields as $f) {
/* $type = singleton($this->modelClass)->obj($f->getName())->class;
echo $type . '..'. $f->getName(). '.. '. $f->class.'<br/>';
if ($type == "Date" || $type == "SS_Datetime") {
$dates[] = $f;
}*/
$type = $f->class ;
if($type =='DateField' || $type =='DatetimeField'){
$dates[] = $f;
}
}
foreach ($dates as $d) {
$fields->removeByName($d->getName());
$fields->push($a = new DateField( str_replace(']', '_min]', $d->getName() ), $d->Title() . " (" . _t('DateRange.START', 'start') . ")"));
$fields->push($b = new DateField( str_replace(']', '_max]', $d->getName() ), $d->Title() . " (" . _t('DateRange.END', 'end') . ")"));
$a->setConfig('showcalendar', true);
$b->setConfig('showcalendar', true);
$a->setConfig('dateformat', 'yyyy-MM-dd');
$b->setConfig('dateformat', 'yyyy-MM-dd');
}
}
return $fields;
}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels