Usage
Signature:
interface DvtTimeComponentScale
Typescript Import Format
//To use this interface, import as below.
import {DvtTimeComponentScale} from "ojs/ojdvttimecomponentscale";
For additional information visit:
Fields
-
(nullable) labelPosition :("start"|"center"|"auto")
-
The position of the label relative to its time interval. This only takes effect on horizontal time axes. The behavior of "auto" varies based on consuming component and theme.
- Default Value:
"auto"
- Since:
- 11.1.0
Supported Values:
Value auto
center
start
-
name :string
-
Name of this scale. This value is provided in the viewportChange event payload of the consuming time component to identify this timescale. See Timeline viewportChange and Gantt viewportChange for more information.
- Since:
- 11.0.0
Methods
-
formatter(date) : {string}
-
Formats the given date into a label used for display.
Parameters:
Name Type Description date
string The date to be formatted. See datetime formatting for more details on the required string format. Returns:
The formatted label.
- Type
- string
-
getNextDate(date) : {string}
-
Takes in a date representing the start of an interval in this scale, and returns the date representing the end of the interval. For example, if the scale is weeks and begins on Sundays, and the input date represents Sunday January 3, 2021, then the returned date should represent Sunday, January 10, 2021.
Parameters:
Name Type Description date
string A date representing the start of an interval in this scale. See datetime formatting for more details on the required string format. Returns:
The date representing the end of the interval. See datetime formatting for more details on the required string format.
- Type
- string
-
getPreviousDate(date) : {string}
-
Takes in an arbitrary date, and returns the date representing the start of the interval in this scale that the specified date belongs to. For example, if the scale is weeks and begins on Sunday, and the input date represents Thursday, January 7, 2021, then the returned date should represent Sunday, January 3, 2021.
Parameters:
Name Type Description date
string The query date. See datetime formatting for more details on the required string format. Returns:
The date representing the start of the interval in this scale that the specified date belongs to. See datetime formatting for more details on the required string format.
- Type
- string