Interface: DvtTimeComponentScale

Oracle® JavaScript Extension Toolkit (JET)
17.1.0

G12196-01

Since:
  • 11.0.0
Module:
  • ojdvttimecomponentscale

QuickNav

Fields

Description

JET DvtTimeComponentScale

The interface for DvtTimeComponentScale. An instance of this interface defines a timescale, which can be used in the scale and/or zoom-order attributes of oj.ojTimeline, oj.ojGantt, or oj.ojTimeAxis. When using a custom timescale instance, the scale value in viewportChange event's payload will be the instance's "name" field value instead of the instance itself.

Date and Time Formats

The date/time data in the DvtTimeComponentScale plays a key role, not only in the representation of events in the order in which they occurred, but also in many other places, such as the time axis, event durations, time markers, size and position calculations for the overview locator window, etc.

The DvtTimeComponentScale supports a simplified version of the ISO 8601 extended date/time format. The format is as follows: YYYY-MM-DDTHH:mm:ss.sssZ

Symbol Description Values Examples
-, :, .,TCharacters actually in the string. T specifies the start of a time.
YYYYYear2013-03-22
2014-02
MMMonth01 to 12
DDDay of the month01 to 31
HHHours00 to 242013-02-04T15:20Z
2013-02-10T15:20:45.300Z
mmMinutes00 to 59
ssSeconds. The seconds and milliseconds are optional if a time is specified.00 to 59
sssMilliseconds00 to 999
ZThe value in this position can be one of the following. If the value is omitted, character 'Z' should be used to specify UTC time.
  • Z indicates UTC time.
  • +hh:mm indicates that the input time is the specified offset after UTC time.
  • -hh:mm indicates that the input time is the absolute value of the specified offset before UTC time.
2013-02-04T15:20:00-07:00
2013-02-04T15:20:00+05:00
2013-02-04T15:20:00Z

The ISO format support short notations where the string must only include the date and not time, as in the following formats: YYYY, YYYY-MM, YYYY-MM-DD.

The ISO format does not support time zone names. You can use the Z position to specify an offset from UTC time. If you do not include a value in the Z position, UTC time is used. The correct format for UTC should always include character 'Z' if the offset time value is omitted. The date-parsing algorithms are browser-implementation-dependent and, for example, the date string '2013-02-27T17:00:00' will be parsed differently in Chrome vs Firefox vs IE.

You can specify midnight by using 00:00, or by using 24:00 on the previous day. The following two strings specify the same time: 2010-05-25T00:00Z and 2010-05-24T24:00Z.


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.
Supported Values:
Value
auto
center
start
Default Value:
  • "auto"
Since:
  • 11.1.0

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