Altair® Panopticon

 

Adding an Action Date Picker

 

The Action Date Picker allows the entry of a Date/Time parameter.

Whenever the date picker value is changed, the associated action is executed.

Steps:

1.     After double-clicking or drawing a rectangle on the dashboard canvas, click  on the Select Part pane then click the Action Date Picker   icon.

The Action Date Picker pane is displayed, and the Action Date Picker part is added on the dashboard canvas with the current date and the Set button to the right.

For this example, the following parameters are defined:

Parameter Name

Type

Default Value

Ticker

Text

COST

TWS

Text

2008-01-01

TWE

Text

2009-03-01

SS

Text

2009-03-01

 

These parameters are used on the Title of the Line graph (e.g., Start: {TWS: yyyy-MMM-dd HH:mm:ss}, End = {TWE: yyyy-MMM-dd HH:mm:ss}, Snapshot: {SS: yyyy-MMM-dd HH:mm:ss}).

 

2.     The action date picker can be configured to either be a Standalone or a Form component.

When set to Form, the action date picker can be connected to any form controller on the same dashboard. The parameters that the action part can set depends on how the form is configured.

   NOTE

An action form part must be defined first to associate the action date picker as a component. Refer to Adding an Action Form more information.

 

 

A line connects the component to the associated form.

 

If the action date picker should not be connected to a form, it can be set to Standalone instead. Select the Target Parameter that will be updated by this action part.

 

3.     Enter the Title of the action date picker button.

If set to the Standalone type and the Title is blank, the button will be Set <Target Parameter>.

4.     Select the Date/Time Format.

Clicking on the Date/Time box displays the date picker in calendar mode.

 

The text of the date can be directly entered, or alternatively it can be clicked on, to bring up a date picker in the Web client.

5.     Tap the Hide Button slider to turn it on. This means the action control will update the parameter whenever the value of the date picker changes.

6.     Tap the Default to Today slider to turn it on. This allows the action date picker to check the current value of the dashboard parameter. If it is set to null/empty, an action is executed to update the parameter and trigger the loading of the parameterized data with the current date.

7.     Tap the Relative Date UTC Offset slider to turn it on then enter the UTC Offset value (default is +0000).

By default, when an action date picker performs a relative date calculation, the point in time that the calculation is relative to will be based on the time zone picked up from the browser (i.e., the timezone the user is in). Since parameters do not encode the time zone information, the resulting value from the relative date calculation will be affected by the time zone the relative calculation is performed in.

Example:

User timezone: UTC+0200

Expression: now

UTC Offset: none

Current time: 2001-01-01T00:00:00.000+0000

Evaluated time: 2001-01-01T02:00:00.000+0200

Parameter value: 2001-01-01T02:00:00.000

The now expression is evaluated in relation to the current time and when formatted, the time zone information is no longer encoding, resulting in a parameter value offset from UTC by +0200.

The UTC offset setting allows for configuring an offset from UTC for the time the calculation is relative to, independent of the timezone the user is in.

Example:

User timezone: UTC+0200

Expression: now

UTC Offset: +0600

Current time: 2001-01-01T00:00:00.000+0000

Evaluated time: 2001-01-01T02:00:00.000+0200

Parameter value: 2001-01-01T06:00:00.000

Since the UTC offset is +0600, the resulting parameter value is formatted with the offset from UTC rather than as the time zone the user is in.

This allows the parameter values generated by date pickers to target a specific UTC offset instead of generating values based on the time zone the user is currently in.

8.     Instead of turning the Default to Today slider on, enter the Default Relative Date String then click . This allows the relative date calculation (based on today’s date), by parsing the input text string.

This method uses the following pattern:

SIGN NUMBER UNIT

Where:

·         SIGN is either a ‘+’ or ‘-’

·         NUMBER is any number

·         UNIT which can be any of the following:

¨        m - minute

¨        H – hour

¨        D – day

¨        B – business day

¨        M – month

¨        Y – year

 

For example:

Pattern

Description

-5m

Back 5 minutes from current time.

-1D

Back 1 day from today.

+D

Forward 1 day from today.

-1B

Back 1 business day from today (ignore Saturday and Sunday).

+1B

Forward 1 business day from today (ignore Saturday and Sunday).

-1M

Back 1 month from today.

-1Y

Back 1 year from today.

-7D

Back 7 days from today.

-14D

Back 14 days from today.

 

When these values are entered, the correct date should be selected, and then the data requests are executed based on this date.

The special now term can also be used, this represents the current Date/Time. For example:

·         Using now will set the date picker to the current Date/Time

·         now-7D will set the date picker to 7 days ago. This is the same as specifying

-7D

For example:

 

The date will be now-7D by default.

For example, now is September 14, it will go back 7 days (September 7) and then the date will be recalculated along with the Date/Time format.

 

 

 

In addition, you can use the SIGN UNIT NUMBER pattern to modify the relative date calculation.

For example, if you enter -1M, the recalculated relative date will be August 14.

 

 

Complex expressions can also be entered to recalculate the relative date. These expressions are evaluated from the left to right pattern. The now term can also be used as a pointer to the currently evaluated value of the relative time expression.

For example, if you enter now-5M-2D+3Y in the Action Date Picker Settings pane:

 

The date will be now-5M-2D+3Y by default.

 

In the expression, you can also use startOf and endOf functions. Both functions take the same arguments, a relative time string, and a unit.

For example, if you enter startOf(now, D):

 

The date will display the start of the current day:

 

Lastly, you can define a complex expression with the functions. For example, if you enter startOf(now-7D, W):

 

The date will display the start of the previous week:

 

 

NOTE

·         The Default Relative Date String will be used if the dashboard parameter is null/empty.

·         The relative Date/Time string is case sensitive.

·         You can also opt to select from pre-populated date ranges:

 

Refer to Selecting Relative Dates in Action Date Picker and Action Date Range Picker Controls for more information.

 

 

9.     Tap the Display in PDF slider to turn it on and include the action date picker in the PDF output.

10.   To modify the style settings of the action date picker:

·         click the Background box to display the Color dialog and set the background color or enter the Hex color code

·         click the Foreground box to display the Color dialog and set the foreground color or enter the Hex color code

·         set the Font type, size, style (Bold and/or Italic)

11.   Click the Save  icon on the toolbar to save the changes.

When saved, the   notification is displayed.