DashboardItemElapsedTime

Inherits DashboardItem

This DashboardItem displays the remaining time until a provided ReferenceTime or the elapsed time since the ReferenceTime. The output can be configured through the FormatString and the unit that is used to display the configurable as well.

Members

Name

Documentation

Type

Description

Optional

ReferenceTime

The reference time relative to which the elapsed time is specified. The format must be an ISO 8601-compliant date string.

Date and time

Value of type ‘Date and time’

No

FontName

This value is the name of the font that is used. It can either refer to an internal name registered previously, or it can refer to a path that is used.

String

Value of type ‘String’

Yes

FontSize

This value determines the size of the font that is used to render the distance.

Double

Value of type ‘Double’

Yes

FormatString

The format text describing how this dashboard item renders its text. This text must contain exactly one {} which is a placeholder that will contain the value of the elapsed time.

String

Value of type ‘String’

Yes

LowestTimeUnit

If ‘SimplifyTime’ is enabled, this is the lowest time unit that will be shown. All finer grained timesteps will be ignored.

String

In list { Nanosecond, Microsecond, Millisecond, Second, Minute, Hour, Day, Month, Year }

Yes

SimplifyTime

If this value is enabled, the elapsed time will be simplified into seconds, minutes, hours, etc. If the value is disabled, the elapsed time is always presented in seconds. The default value for this is ‘true’.

Boolean

Value of type ‘Boolean’

Yes

Inherited members from DashboardItem

Name

Documentation

Type

Description

Optional

Identifier

The unique identifier for this DashboardItem.

Identifier

An identifier string. May not contain ‘.’, spaces, newlines, or tabs

No

Type

Determines the type of the DashbordItem that should be created.

String

Value of type ‘String’

No

Enabled

If this value is set to ‘true’ this dashboard item is shown in the dashboard. Otherwise it will be hidden.

Boolean

Value of type ‘Boolean’

Yes

GuiName

The name for the DashboardItem that is used when showing it in the user interface.

String

Value of type ‘String’

Yes

Asset Examples

Basic

This example adds a dashboard item that shows the remaining time or the elapsed time since midday 2000 JAN 01.

 1local Item = {
 2  Identifier = "DashboardItemElapsedTime_Example",
 3  Type = "DashboardItemElapsedTime",
 4  ReferenceTime = "2000 JAN 01 12:00:00"
 5}
 6
 7asset.onInitialize(function()
 8  openspace.dashboard.addDashboardItem(Item)
 9end)
10
11asset.onDeinitialize(function()
12  openspace.dashboard.removeDashboardItem(Item)
13end)
Fixed Time

This example adds a dashboard item that shows the remaining time or the elapsed time since 2000 JAN 01 but ignoring any unit smaller than days.

 1local Item = {
 2  Identifier = "DashboardItemElapsedTime_Example_FixedTime",
 3  Type = "DashboardItemElapsedTime",
 4  ReferenceTime = "2000 JAN 01 12:00:00",
 5  LowestTimeUnit = "Day"
 6}
 7
 8asset.onInitialize(function()
 9  openspace.dashboard.addDashboardItem(Item)
10end)
11
12asset.onDeinitialize(function()
13  openspace.dashboard.removeDashboardItem(Item)
14end)
No Decorations

This example adds a dashboard item that shows the remaining time or the elapsed time since midday 2000 JAN 01 without any additional text decoration and only printing the remaining time.

 1local Item = {
 2  Identifier = "DashboardItemElapsedTime_Example_NoDecorations",
 3  Type = "DashboardItemElapsedTime",
 4  ReferenceTime = "2000 JAN 01 12:00:00",
 5  FormatString = "{}"
 6}
 7
 8asset.onInitialize(function()
 9  openspace.dashboard.addDashboardItem(Item)
10end)
11
12asset.onDeinitialize(function()
13  openspace.dashboard.removeDashboardItem(Item)
14end)