0

I am new using drupal and I am creating a website for renting various items. I need the searcher to give me as a result the available articles between 2 dates, that is, the user searches for items that are available between 2 dates, for example, I am looking for an amplifier that is available between September 11th and Augus 2th.

Please help me. Thanks.

2
  • long way to go pal, study views and exposed filters, please tag your question 7 or 8
    – pinueve
    Commented Sep 12, 2017 at 0:42
  • I would never use standard drupal search module to achive it. As @pinueve suggested this you need to use views, filters, some preprocessing and so on.
    – David
    Commented Sep 12, 2017 at 8:36

1 Answer 1

0

You have not mentioned is it drupal 7 or 8 If it is drupal 7 i think it will help you. First you install date module. You can add a date field with a start and an end date. Other than that the rest is simple. Go to your view and add two filters.

First filter will be your start date where the field is "less than or equal to" -> "now" you can write that only if you select "enter a relative date"

Second filter as you may have guessed will be your expire date field where the field is "is greater than or equal to" -> "now"

If "less than or equal to" and "greater than or equal to" don't appear as options, make sure you've enabled the Date Views module. (It is installed as part of the Date project.)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.