views - how to filter by birthdays dependent on the current date I have the following use-case:

I have a custom content type called profile which has a birthday field (of type Unix timestamp).

I need to be able to filter all profiles that have a birthday in the interval (-3 days from now to +7 days from now). How can I achieve this using views? Do I need to make a custom filter or custom contextual filter or some other custom plugin?

Thanks a lot for your input.

Update:

So I started building a custom filter with the following:

my_module/my_module.module

&lt;?php

/**
 * Implements hook_views_data_alter().
 */
function my_module_views_data_alter(array &amp;$data) {
  $data['node__profile_birthday']['birthday'] = [
    'title' =&gt; t('Filter by birthday'),
    'group' =&gt; t('Content'),
    'help'  =&gt; t('Filter profiles by birthday.'),
    'filter' =&gt; [
      'id'    =&gt; 'birthday',
      'field' =&gt; 'profile_birthday_value'
    ],
  ];
}


my_module/src/Plugin/views/filter/Birthday.php

&lt;?php

namespace Drupal\my_module\Plugin\views\filter;

use Drupal\views\Plugin\views\filter\NumericFilter;


/**
 * Basic filter handler for Birthdays.
 *
 * @ViewsFilter("birthday")
 */
class Birthday extends NumericFilter {
  /**
   * Override the original Views opBetween behavior.
   */
  protected function opBetween($field) {
    // The birthdate is between -3 days and +7 days from the current date
    $expression = "DAYOFYEAR($field) BETWEEN ((DAYOFYEAR(CURRENT_DATE())) - 3) AND ((DAYOFYEAR(CURRENT_DATE())) + 7)";

    $this-&gt;query-&gt;addWhereExpression($this-&gt;options['group'], $expression);

  }

}


I am still having issues with views not properly saving the values of min and max of the between operator. Any help is appreciated.
So it looks like a custom filter is in order. They are relatively simple to make. There are a few tutorials out there. Look up “custom views filter handler” here or elsewhere. I’ve made custom contextual filters and sort handlers several times. “Contextual range filter” and “Views Raw SQL”. You can look at the code for them on Drupal.org. I think this would be a good candidate for something worth releasing as an official module. You could call it “Anniversary Date Filter” or something.