src/app/core/basic-datatypes/date-with-age/dateWithAge.ts
Subclass of Date which provides the getter age
.
This age is calculated based on the date that this object represents.
Properties |
|
Accessors |
Static DATA_TYPE |
Type : string
|
Default value : "date-with-age"
|
age |
getage()
|
import { calculateAge } from "../../../utils/utils";
/**
* Subclass of Date which provides the getter `age`.
* This age is calculated based on the date that this object represents.
*/
export class DateWithAge extends Date {
static DATA_TYPE = "date-with-age";
get age() {
return calculateAge(this);
}
}