squiggle/packages/website/docs/Api/Duration.mdx
2022-06-11 08:57:02 -07:00

91 lines
838 B
Plaintext

---
sidebar_position: 6
title: Duration
---
import TOCInline from "@theme/TOCInline";
<TOCInline toc={toc} />
### toString
```
toString: (duration) => string
```
## Units
### minutes
```
minutes: (number) => duration
```
### hours
```
hours: (number) => duration
```
### days
```
days: (number) => duration
```
### years
```
years: (number) => duration
```
### toHours
```
toHours: (duration) => number
```
### toMinutes
```
toMinutes: (duration) => number
```
### toDays
```
toDays: (duration) => number
```
### toYears
```
toYears: (duration) => number
```
## Algebra
### add
```
add: (duration, duration) => duration
```
### subtract
```
subtract: (duration, duration) => duration
```
### multiply
```
multiply: (duration, number) => duration
```
### divide
```
divide: (duration, number) => duration
```