DashboardItemDate

Inherits DashboardItem

This DashboardItem shows the current in-game simulation time. The FormatString and the TimeFormat options provide the ability to customize the output that is printed. See these two parameters for more information on how to structure the inputs.

Members

Name

Documentation

Type

Description

Optional

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 date in the format as specified by TimeFormat.

String

Value of type ‘String’

Yes

TimeFormat

The format string used for formatting the date/time before being passed to the string in FormatString. See https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/timout_c.html for full information about how to structure this format.

String

Value of type ‘String’

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

Year Month Day

This example adds a new DashboardItem that shows the current in-game simulation date with a resolution of days.

 1local Item = {
 2  Identifier = "DashboardItemDate_Example_YearMonthDay",
 3  Type = "DashboardItemDate",
 4  TimeFormat = "YYYY MON DD"
 5}
 6
 7asset.onInitialize(function()
 8  openspace.dashboard.addDashboardItem(Item)
 9end)
10
11asset.onDeinitialize(function()
12  openspace.dashboard.removeDashboardItem(Item)
13end)
No Decorations

This example adds a new DashboardItem that shows the current in-game simulation date without any additional text surrounding the current date

 1local Item = {
 2  Identifier = "DashboardItemDate_Example_NoDecoration",
 3  Type = "DashboardItemDate",
 4  FormatString = "{}"
 5}
 6
 7asset.onInitialize(function()
 8  openspace.dashboard.addDashboardItem(Item)
 9end)
10
11asset.onDeinitialize(function()
12  openspace.dashboard.removeDashboardItem(Item)
13end)
Day of Year

This example adds a new DashboardItem that shows the current in-game simulation date showing the current year and the number of days that have passed in the year.

 1local Item = {
 2  Identifier = "DashboardItemDate_Example_DayOfYear",
 3  Type = "DashboardItemDate",
 4  TimeFormat = "YYYY DOY"
 5}
 6
 7asset.onInitialize(function()
 8  openspace.dashboard.addDashboardItem(Item)
 9end)
10
11asset.onDeinitialize(function()
12  openspace.dashboard.removeDashboardItem(Item)
13end)
Basic

This example adds a new DashboardItem that shows the current in-game simulation date.

 1local Item = {
 2  Identifier = "DashboardItemDate_Example",
 3  Type = "DashboardItemDate"
 4}
 5
 6asset.onInitialize(function()
 7  openspace.dashboard.addDashboardItem(Item)
 8end)
 9
10asset.onDeinitialize(function()
11  openspace.dashboard.removeDashboardItem(Item)
12end)
Timezone

This example adds a new DashboardItem that shows the current in-game simulation date with a timezone of UTC-7 (=PDT)

 1local Item = {
 2  Identifier = "DashboardItemDate_Example_Timezone",
 3  Type = "DashboardItemDate",
 4  TimeFormat = "YYYY MON DD HR:MN:SC.### PDT ::UTC-7"
 5}
 6
 7asset.onInitialize(function()
 8  openspace.dashboard.addDashboardItem(Item)
 9end)
10
11asset.onDeinitialize(function()
12  openspace.dashboard.removeDashboardItem(Item)
13end)