Need an exposed filter field as select box with values like "Last x days" etc I'm trying to filter my nodes on the basis of last 7 days &amp; last 30 days but the below code is not working for me when I tried this in my custom module, its working as a conversion for text-field to select but not working as a filter

function dreamzen_form_views_exposed_form_alter(&amp;$form, &amp;$form_state, $form_id) {
    $fromdate = &amp;$form['created'];
    $fromdate['#type'] = 'select';
    $fromdate['#options'] = array(
      'All' =&gt; 'All',
      'Last 7 days' =&gt; '-7 days',
      'Last months' =&gt; '-30 days',
    );
    $fromdate['#default_value'] = '';
    $fromdate['#size'] = 1;
}
are you checking, value is equal to '-7 days', it must match to the value of select box. 

Hope this may help full.