I would like to programmatically set an exposed filter for a field date (field_date) in a view.
Date has to be > of a specific date or between to dates.
I tried this, but it does not work. It ignores the filter.
$view = views_get_view('myview');
$view->set_display("default");
$view->get_exposed_input();
$exposed_filters["field_date_value_op "] = "between";
$exposed_filters["field_date_value"]["value"]["day"] = "";
$exposed_filters["field_date_value"]["value"]["month"] = "";
$exposed_filters["field_date_value"]["value"]["year"] = "";
$exposed_filters["field_date_value"]["min"]["day"] = 1;
$exposed_filters["field_date_value"]["min"]["month"] = 1;
$exposed_filters["field_date_value"]["min"]["year"] = 2014;
$exposed_filters["field_date_value"]["max"]["day"] = 1;
$exposed_filters["field_date_value"]["max"]["month"] = 12;
$exposed_filters["field_date_value"]["max"]["year"] = 2015;
$view->set_exposed_input($exposed_filters);
$view->execute();
Any idea? Thank you in advance.