現在の日付とユーザーが入力した日付の年の差を取得するjavascript関数を教えてください。
私はこれを試しましたが、うるう年を数えることはできません
var yearOld=2000
var dateOld=11
var mnthOld=1;
var currendDate=new Date(); // 9 - jan - 2013
var oldDate=new Date(yearOld,mnthOld-1,dateOld);
var timeDiff =currendDate-oldDate ;
var diffDays = timeDiff / (1000 * 3600 * 24 * 365);
結果は来ている 13.00789 何か 13 未満になるはずです
どんな助けでも大歓迎です