Hey

I'm working on a view that will show the upcoming list of birthdays.

So basically it looks like this right now:

May 02
User 1 - (# years old)
User 2 - (# years old)
May 07
User 1 - (# years old)

But the problem is I can't figure out how to set the "years old" to add +1 as it would make sense it'll show the age he's becoming rather than the current age.

Any ideas how to do this? Thanks in advance.

Comments

MHLut’s picture

You could use a math field in views which takes the year (or age) the view wants to print and add one (1) to the year.

I can not see a direct way to place just the year in a global text field, but you can add the birthday field again and rewrite it to just the year. As birthday fields can access their own year, month and day separately. This rewritten field you can use in your math expression.

Niklas Fiekas’s picture

Status: Active » Fixed

Since this seams to be a common use case, I've added an "Age +1" field formatter. (Update to the latest dev release, clear caches.)

Commit: http://drupalcode.org/project/birthdays.git/commitdiff/4f9258d

Thanks for the suggestion!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.