workbook.createDuration(options)

Method Description

Creates an duration.

Returns

workbook.Duration

Supported Script Types

Server scripts

For more information, see SuiteScript 2.x Script Types.

Governance

None

Module

N/workbook Module

Sibling Module Members

N/workbook Module Members

Since

2021.2

Parameters

Note:

The options parameter is a JavaScript object.

Parameter

Type

Required / Optional

Description

options.start

string

required

Start date or date time.

Use the workbook.TemporalUnit enum to set the value.

options.end

string

required

End date or date time.

Use the workbook.TemporalUnit enum to set the value.

Errors

Error Code

Thrown If

INVALID_TEMPORAL_UNIT

If options.start or options.end values are not valid temporal unit values.

Related Topics

General Notices