hotfix: fix date.add and data.sub docs

pull/4009/head^2
Scott Anderson 2022-05-11 21:35:38 -06:00
parent e0682225bf
commit 7f6e799556
2 changed files with 14 additions and 14 deletions

View File

@ -1,10 +1,10 @@
--- ---
title: date.addDuration() function title: date.add() function
description: > description: >
`date.addDuration()` adds a duration to a time value and returns the resulting time. `date.add()` adds a duration to a time value and returns the resulting time.
menu: menu:
flux_0_x_ref: flux_0_x_ref:
name: date.addDuration name: date.add
parent: date parent: date
weight: 302 weight: 302
flux/v0.x/tags: [date/time] flux/v0.x/tags: [date/time]
@ -15,12 +15,12 @@ related:
introduced: 0.162.0 introduced: 0.162.0
--- ---
`date.addDuration()` adds a duration to a time value and returns the resulting time. `date.add()` adds a duration to a time value and returns the resulting time.
```js ```js
import "date" import "date"
date.addDuration(d: 12h, to: now()) date.add(d: 12h, to: now())
``` ```
## Parameters ## Parameters
@ -39,7 +39,7 @@ Durations are relative to [`now()`](/flux/v0.x/stdlib/universe/now/).
```js ```js
import "date" import "date"
date.addDuration(d: 6h, to: 2019-09-16T12:00:00Z) date.add(d: 6h, to: 2019-09-16T12:00:00Z)
// Returns 2019-09-16T18:00:00.000000000Z // Returns 2019-09-16T18:00:00.000000000Z
``` ```
@ -50,7 +50,7 @@ import "date"
option now = () => 2022-01-01T12:00:00Z option now = () => 2022-01-01T12:00:00Z
date.addDuration(d: 6h, to: 3h) date.add(d: 6h, to: 3h)
// Returns 2022-01-01T21:00:00.000000000Z // Returns 2022-01-01T21:00:00.000000000Z
``` ```

View File

@ -1,11 +1,11 @@
--- ---
title: date.subDuration() function title: date.sub() function
description: > description: >
`date.subDuration()` subtracts a duration from a time value and returns the `date.sub()` subtracts a duration from a time value and returns the
resulting time value. resulting time value.
menu: menu:
flux_0_x_ref: flux_0_x_ref:
name: date.subDuration name: date.sub
parent: date parent: date
weight: 302 weight: 302
flux/v0.x/tags: [date/time] flux/v0.x/tags: [date/time]
@ -16,13 +16,13 @@ related:
introduced: 0.162.0 introduced: 0.162.0
--- ---
`date.subDuration()` subtracts a duration from a time value and returns the `date.sub()` subtracts a duration from a time value and returns the
resulting time value. resulting time value.
```js ```js
import "date" import "date"
date.subDuration(d: 12h, from: now()) date.sub(d: 12h, from: now())
``` ```
## Parameters ## Parameters
@ -41,7 +41,7 @@ Durations are relative to [`now()`](/flux/v0.x/stdlib/universe/now/).
```js ```js
import "date" import "date"
date.subDuration(d: 6h, from: 2019-09-16T12:00:00Z) date.sub(d: 6h, from: 2019-09-16T12:00:00Z)
// Returns 2019-09-16T06:00:00.000000000Z // Returns 2019-09-16T06:00:00.000000000Z
``` ```
@ -52,7 +52,7 @@ import "date"
option now = () => 2022-01-01T12:00:00Z option now = () => 2022-01-01T12:00:00Z
date.subDuration(d: 6h, from: -3h) date.sub(d: 6h, from: -3h)
// Returns 2022-01-01T03:00:00.000000000Z // Returns 2022-01-01T03:00:00.000000000Z
``` ```