Add age to member admin window
This commit is contained in:
@ -173,5 +173,12 @@ namespace Elwig.Helpers {
|
||||
public static long DecToDb(decimal value, byte precision) {
|
||||
return (long)decimal.Round(value * (decimal)Math.Pow(10, precision), 0);
|
||||
}
|
||||
|
||||
public static int GetAge(DateOnly birthday) {
|
||||
var today = DateTime.Today;
|
||||
var a = (today.Year * 100 + today.Month) * 100 + today.Day;
|
||||
var b = (birthday.Year * 100 + birthday.Month) * 100 + birthday.Day;
|
||||
return (a - b) / 10000;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user