File

src/app/core/basic-datatypes/date-with-age/dateWithAge.ts

Description

Subclass of Date which provides the getter age. This age is calculated based on the date that this object represents.

Extends

Date

Index

Properties
Accessors

Properties

Static DATA_TYPE
Type : string
Default value : "date-with-age"

Accessors

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);
  }
}

results matching ""

    No results matching ""