moment.js を使ってサクッと年齢計算
function birth2age(y, m, d) {
var birth = moment().year(y).month(m - 1).date(d);
return moment().diff(birth, 'years');
}
Go to list of users who liked
Share on X(Twitter)
Share on Facebook
More than 5 years have passed since last update.
moment.js を使ってサクッと年齢計算
function birth2age(y, m, d) {
var birth = moment().year(y).month(m - 1).date(d);
return moment().diff(birth, 'years');
}
Register as a new user and use Qiita more conveniently
Go to list of users who liked