登录:装备,密码,短信登录

This commit is contained in:
luying
2021-03-02 20:21:12 +08:00
parent 95deef6230
commit 9dfee7f49c
7 changed files with 397 additions and 170 deletions

View File

@@ -93,4 +93,24 @@ export function getTodayZeroDate() {
date.setMinutes(0);
date.setSeconds(0);
return date;
}
export function getAge(birthday: string) {
let d = new Date(birthday + ' 00:00:00');
let _year = d.getFullYear();
let _month = d.getMonth() + 1;
let _day = d.getDate();
let age = 0;
let now = new Date();
let year = now.getFullYear();
let month = now.getMonth() + 1;
let day = now.getDate();
if (year >= _year && month >= _month && day >= _day) {
age = year - _year;
}else{
age = year - _year - 1;
}
return age
}