Closed (fixed)
Project:
Birthdays
Version:
7.x-1.x-dev
Component:
Code (Birthdays)
Priority:
Major
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
17 Apr 2012 at 20:14 UTC
Updated:
6 Jun 2012 at 22:21 UTC
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
Comment #1
MHLut commentedYou 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.
Comment #2
Niklas Fiekas commentedSince 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!