Month Year granularity on views exposed filter for a custom table exposed to view I have a custom table exposed to view with a column of type int where I am storing current time stamp. while exposing the custom table I have kept views filter handler as "views_handler_filter_date", but this is not allowing to create expose filter with month and year granularity.How can I get month and year granularity for my date_of_purcahse 

Here is the snippet exposing the field to views.

  $data['jh_report']['date_of_purchase'] = array(
    'title' =&gt; t('Date of purchase'),
    'help' =&gt; t('Date of last purchase for current month'),
    'field' =&gt; array(
      'handler' =&gt; 'views_handler_field_date',
      'click sortable' =&gt; TRUE,
    ),
    'sort' =&gt; array(
      'handler' =&gt; 'views_handler_sort_date',
    ),
    'filter' =&gt; array(
      'handler' =&gt; 'views_handler_filter_date',
    ),
  );
In order to get month, year granularity we can use date handler as defined by date module so while exposing field to use it will be all about choosing the right filter handler so I used "date_views_filter_handler_simple" handler.

Code while exposing the custom table field with proper filter handler.

$data['jh_report']['date_of_purchase'] = array(
    'title' =&gt; t('Date of purchase'),
    'help' =&gt; t('Date of last purchase for current month'),
    'field' =&gt; array(
      'handler' =&gt; 'views_handler_field_date',
      'click sortable' =&gt; TRUE,
    ),
    'sort' =&gt; array(
      'handler' =&gt; 'views_handler_sort_date',
    ),
    'filter' =&gt; array(
      'handler' =&gt; 'date_views_filter_handler_simple',
    ),
  );