Skip to main content

API Reference

Classes ​

Duration ​

Represents a length of time.

Static Functions ​

NameDescription
fromDays
Create a Duration representing an amount of days.
fromHours
Create a Duration representing an amount of hours.
fromMilliseconds
Create a Duration representing an amount of milliseconds.
fromMinutes
Create a Duration representing an amount of minutes.
fromMonths
Create a Duration representing an amount of months.
fromSeconds
Create a Duration representing an amount of seconds.
fromYears
Create a Duration representing an amount of years.

fromDays ​
duration.fromDays(amount: num);

Create a Duration representing an amount of days.

amountRequired ​
  • Type: num

the amount of Days the Duration will represent.


fromHours ​
duration.fromHours(amount: num);

Create a Duration representing an amount of hours.

amountRequired ​
  • Type: num

the amount of Hours the Duration will represent.


fromMilliseconds ​
duration.fromMilliseconds(amount: num);

Create a Duration representing an amount of milliseconds.

amountRequired ​
  • Type: num

the amount of Milliseconds the Duration will represent.


fromMinutes ​
duration.fromMinutes(amount: num);

Create a Duration representing an amount of minutes.

amountRequired ​
  • Type: num

the amount of Minutes the Duration will represent.


fromMonths ​
duration.fromMonths(amount: num);

Create a Duration representing an amount of months.

amountRequired ​
  • Type: num

the amount of Months the Duration will represent.


fromSeconds ​
duration.fromSeconds(amount: num);

Create a Duration representing an amount of seconds.

amountRequired ​
  • Type: num

the amount of Seconds the Duration will represent.


fromYears ​
duration.fromYears(amount: num);

Create a Duration representing an amount of years.

amountRequired ​
  • Type: num

the amount of Years the Duration will represent.


Properties ​

NameTypeDescription
days
numReturn the total number of days in this Duration.
hours
numReturn the total number of hours in this Duration.
milliseconds
numReturn the total number of milliseconds in this Duration.
minutes
numReturn the total number of minutes in this Duration.
months
numReturn the total number of months in this Duration.
seconds
numReturn the total number of seconds in this Duration.
years
numReturn the total number of years in this Duration.

daysRequired ​
days: num;
  • Type: num

Return the total number of days in this Duration.


hoursRequired ​
hours: num;
  • Type: num

Return the total number of hours in this Duration.


millisecondsRequired ​
milliseconds: num;
  • Type: num

Return the total number of milliseconds in this Duration.


minutesRequired ​
minutes: num;
  • Type: num

Return the total number of minutes in this Duration.


monthsRequired ​
months: num;
  • Type: num

Return the total number of months in this Duration.


secondsRequired ​
seconds: num;
  • Type: num

Return the total number of seconds in this Duration.


yearsRequired ​
years: num;
  • Type: num

Return the total number of years in this Duration.