I am looking for a way to produce a dropdown filter by year of drupal 'post date'. i was able to produce somewhat of this result with an exposed criteria but that requires updating.
Is there a way i can just make the sort criteria exposed with dropdown of years?
this is what i have so far
if ($form_id == 'views_exposed_form_clone_of_post_by_date_block'){
$year_filter = array();
$years = array();
$counter = 0;
for ($i=date("Y");$i>=2009;$i--){
$counter++;
$years[$counter]=$i;
$dstart = $i."0101";
$dend = $i."1231";
$year_filter[$counter] = array('title'=>$i,'operator'=>'between','value'=>array('type'=>'date','value'=>$i,'min'=>$dstart,'max'=>$dend));
$form_state['input']['edit_created']['#options'] = $years;
}