2

I have a content type that represents a person, and this content type has a CCK Date field "birthday". I'd now like to add a list of upcoming birthdays and a calendar where they are displayed.

I'm already using the Calendar module for events on that site, but the birthday stuff seems to be more difficult. I can't use the Birtdays module as I'm working with nodes, not user profiles. And the Date field doesn't seem to support this use case, I can't create a view that only shows upcoming birthdays because I see no way to ignore the year for that calculation.

What would be the easiest way to implement such a birthday calendar?

0

2 Answers 2

2

You can try with Birthdays module. It allows users to add their birthday to their profile.

The Birthdays module allows users to add their birthday to their profile. It also lists birthdays on a seperate page and in different blocks. Users can receive an e-mail on their birthday automatically, and the administrator can receive periodic reminders of who are having their birthday. Uses Profile module from core.

1
  • 1
    The OP wants a view showing nodes basing on the CCK field added to them, and which contains a birthday. The module is not helpful, in that case.
    – apaderno
    Oct 28, 2012 at 13:32
0

The only way I've been able to accomplish this is by having two fields. One I've called field_born and the other called field_birthday.

Using the node_presave hook, field_birthday is a copy of the field_born date replacing the year with the current year. Then you use that field in your calendar display.

The only problem I've run into is what will happen next year. I'll have to recalculate all my birthdays. Using SQL wouldn't be tough. But, it would be nice to have it be automatic. Maybe something can be done with an annual cron job on Jan 1st?

Also, this limits your calendar view to the current year. Otherwise, future and past years are empty.

So, hopefully this is closer to what you want. But there's still problems with it. What would be nice is a way to save a date where the year was dynamic somehow. Or if the event was repeated annually. Not sure how to do it, though.

Your Answer

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

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