FFixer

By Vaughan Chandler Last update Mar 9, 2011 — Installed 15,737,306 times.

Profile Birthdate

in
Subscribe to Profile Birthdate 8 posts, 4 voices



scriptright User
FirefoxWindows

It seems that if the user does not provide his year of birth, the birth date will appear as for example:

1 Jan ()

But if the year is provided it displays correctly:

1 Jan, 1981 (31 years old)

Any ideas on how to fix this?

 
Versa User
FirefoxWindows

i think what you show is actually normal and not a bug.
if the user doesn't show his birth year, then the script has no way of knowing how old he is. if the script were still somehow able to know, then it would probably be against the rules.

but, if you're talking about the () still showing when there's no year, then i don't know how to fix it either. probably more lines would be need to be written to hide the () when it senses that a profile hasn't got a birth year on it.

 
scriptright User
FirefoxWindows

Yup it's the () that bothers me. The script should determine whether the birth year is provided or not and if none is provided the brackets should not appear. The brackets are probably hard coded?

 
Ed G Scriptwright
FirefoxWindows

Find and change the line
if (info) { bdayNode.innerHTML = bdayNode.innerHTML + ' (' + info.join(', ') + ') '; }
to
if (info.length >0) { bdayNode.innerHTML = bdayNode.innerHTML + ' (' + info.join(', ') + ') '; }

That seems to fix it for me when there's nothing to display

 
scriptright User
FirefoxWindows

Ed G: It works! Thank you!

 
scriptright User
FirefoxWindows

In 2.3.1.8 Beta, if no year is provided, it will appear as:

Jan 1 (-1 years old)

I'm using the old layout, not timeline.

 
Vaughan Chan... Script's Author
Firefox

Thanks scriptright, just fixed it, new beta up soon.

 
Ed G Scriptwright
FirefoxWindows

For anyone that wants to fix the -1 year thing before the next beta goes up here's a quick fix, on line 5066 change
if (prefs['Age']) { if (now.getFullYear()!=bday.getFullYear()) { info.push($l('yearsOld',bday.getAge())); } }
to
if (prefs['Age']) { if (now.getFullYear()!=bday.getFullYear() && bday.getAge()>=0) { info.push($l('yearsOld',bday.getAge())); } }