Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
is it possible to restrict de display of months to only the current year? (so in januari show all 12 months, november show last 2, etc )?
Comments
Comment #1
fietserwinWhat you can do is implement this theme preprocess hook:
Make sure that you don't increase this setting OR that you execute before availability_calendar's own theme preprocess hook, as this hook reads the availability from the database and if it reads to few, behaviour will be undefined. You can assure so by implementing these lines of code into the preprocess functions for both theme availability_calendar and theme availability_calendar_viewport.
I'll leave this request open for now as I might implement it in the future.
Comment #2
fietserwinComment #3
daskog CreditAttribution: daskog commentedWhat file do i edit..? and a little before after snippet would help me understand the implementation.
Thanks in advance.
Comment #4
daskog CreditAttribution: daskog commentedAnyone?
Comment #5
fietserwinCreate a custom module to implement the theme preprocess as above. I leave the date arithmetic up to you.
Comment #6
daskog CreditAttribution: daskog commentedLet me start with saying thank you for your feedback.
This works, but how to set the starting month to January, how would the actual string on numbers look like?
Comment #7
fietserwinShowing past dates is a different issue, though probably a bit related. You can set the start year and month via the similarly named variables, but that will still show all past dates as "past dates" thus hiding the actual availability.
There is another issue to show past dates : #1490928: Showing dates in the past.
If you just want to continue, you can override this module's theme function. See e.g.: https://drupal.org/node/1621416. Patches are welcome though for the other issue.