Experimental project

This is a sandbox project, which contains experimental code for developer use only.

Module abandoned, see Issue #1504362: Is this module abandoned?

This module is intended to enable Date Fields for views in a form that projects them to the actual or next year.

That means any date in that field will be shown with its own month and day but with the year either being the actual or the next depending on the comparision of the field's and the actual date.

The anniversary module uses "standard" Date Fields and presents them to you as corresponding Views fields, filters and sorts. The anniversary module also contains Views fields, filters and sorts for the age at that date.

Features

  • For each Date Field:
    • a views field, filter and sort criteria "FieldName (next anniversary)"
    • a views field, filter and sort criteria "FielsName (age at next anniversary)"
  • For each of those you can:
    • set an offset that moves the year of scope in days (forwards or backwards) to enable for example a View to include the last three days.
    • use the features you know of normal Date / numeric Fields in views (not yet all features working)

Development status

Before the first release there should at least be added the following:

  • Enable the Date Formatters for the next anniversary field.
  • Make the Date Module think that this is a "real" Date Field for example when selecting a Date Field in a contextual filter.
  • Test module with other Database type than mySQL - no idea if that will work at all.

A backport to D6 could be done but is not yet planned.

Short example

You have a node type "Friends" (think of an address book or similar usage) with a Date Field called "Birthday".
When you have a friend called "John" which is born 28th of August 1979 then you could have a simple view that shows something like:
[Birthday (next anniversary)] [Name] ([Birthday (age at next anniversary)])
If you look at it on 27th of August 2011 it will be:
2011-08-28 John (32)
If you look at it on 29th of August 2011 it will be:
2012-08-28 John (33)

Similar Modules or Code Snippets

The special thing about this module is that it does the "projection" onto the "year of scope" in the query. Therefor it uses a "CASE WHEN" statement. I haven't found any other module doing this. But there are several issues on that:

Modul Birthdays

http://drupal.org/project/birthdays
This modul only enable a special field for user profiles and does all the handling by itself.

Project issues

Project information