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.
By vitormp on
Hi,
I have a custom content for 'persons' (not users) which includes a date field for the person's date of birth. I would like to create a block which lists today's birthdays (or this week's birthdays) using views (to start, the block would just show a list with the node title of the matching nodes).
What would be the easiest way to do that? Basically I need to filter this field and see if its month/day equals today's month/day. It seems that date+cck+views alone cannot accomplish this.
Many thanks.
V.
Comments
=-=
date = now
if the date = now you have the control you need for "todays birthdays"
if you use date > now, you will have "upcoming birthdays"
if you use date < now, you will have a "past birthdays"
Thanks, My problem is that
Thanks,
My problem is that the field "field_dob" contains the date of birth as yyyy/mm/dd.
I don't see a way to strip the year to make the comparison between 'now' and the value in 'field_dob' in the views editor.
this might help
http://drupalsn.com/learn-drupal/drupal-tutorials/user-age-date-birth-%E...
Thanks. I will take a look at
Thanks. I will take a look at the "computed field" module.
Calculate days for the next birthday.
Hello. I know that I write in this post one year later, but I want to contribute with my code.
I have set a CCK date field, to user input the birthday.
I have set a Computed CCK Field, to display days to the next birthday with the next code:
Sorry for my english n.n
PD: I have to implement an exception. For example, my uncle has born on February 29 :)