20 July 2011

JS/ExtJS Code to Determine Age

Just something I came up with for a form I'm building -- is there a quicker way to do this?

(_now.format('Y') - birthdate.format('Y')) 
     - (_now.format('z') < birthdate.format('z') ? 1 : 0)

No comments:

Post a Comment