Birthday Field for Thunderbird’s Address Book
While working on my extension and reading discussions in #maildev, I noticed Bug 13595 – Add Birthday Fields to Address Book is still marked as NEW but has a high priority and a lot of votes in Bugzilla. With the datepicker XUL element now available and some knowledge of the address book from working on my extension, adding a birthday field should be simple, but I have a few questions about how exactly this should appear. This post isn’t a promise to fix this since school starts very soon and I’m trying to graduate in 3 years (1 year left after this year), but I’d like to at least get things started so somebody else can finish things up, if I am unable to do so myself.
Question #1: Which type of datepicker should be used?
There are three valid types for the datepicker element
- Normal – This just shows a small box that lets one type or increment/decrement the date shown with the arrows
- Grid – This shows a calendar and lets one click arrows to change the month (and year) and select a day from the calendar.
- Popup – It shows the same box as Normal, but also allows one to chose the date from a calendar like Grid does.
Notes: the two gContactSync tabs are from my extension and the Other tab isn’t necessarily going to be used; it just had the most extra room, and not all three types will be present, obviously.
Question #2 Which tab (for now)?
I know that the new/edit card dialogs might change, but which tab is best until then? Where should it be located in the tab?
Question #3 What if the user doesn’t change the date? How can a date be removed?
If the user doesn’t change the date, we probably do not want to save the birthday info. Right now it only saves the date if it was changed, but there is not a way to remove the date for now.
I have created an initial patch that uses a popup datepicker in the Other tab that only sets the card’s BirthDay, BirthMonth, and BirthYear if the datepicker has been updated. It also adds the birthday to the card view in the format generated by Date.toLocaleDate()
I added BirthDay and BirthMonth to the attribute map in mailnews.js so it will export the birthday information (BirthYear is already present). CSV and tab imports and exports BirthDay, BirthMonth and BirthYear already.
You can see my current WIP here.