set minimum birthday to 13 years ago (#7808)
This commit is contained in:
@@ -19,6 +19,17 @@ export function getAge(birthDate: Date): number {
|
||||
return age
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a Date object that is N years ago from now
|
||||
* @param years number of years
|
||||
* @returns Date object
|
||||
*/
|
||||
export function getDateAgo(years: number): Date {
|
||||
const date = new Date()
|
||||
date.setFullYear(date.getFullYear() - years)
|
||||
return date
|
||||
}
|
||||
|
||||
/**
|
||||
* Compares two dates by year, month, and day only
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user