Perspective - DateTime Input
Component Palette Icon:
Description​
A DateTime Input is an easy way to select a date from a popup calendar. Similar to the DateTime Picker component, it takes up much less real estate on the screen. Configure the date and time format in the Property Editor using the 'formattedValue' property.
The DateTime Input component has two pre-configured variants:
- Date and Time - Opens a calendar from which users can select a date and time.
- Time - Enables users to set a time using the up and down arrows on the component.
Properties​
Most Properties have binding options. For more information on Bindings, see Types of Bindings in Perspective. This section only documents the Props Category of properties. The other Categories are described on the Perspective Component Properties page.
| Name | Description | Property Type |
|---|---|---|
| value | Current date/time as a Date object or timestamp in milliseconds. | value: string |
| formattedValue | Date and time in configured format. | value: string |
| inputProps | Sets a style for this component. Full menu of style options is available for text, background, margin and padding, border, shape and miscellaneous. | object |
| modalStyle | Style applied to the Date picker modal (popup). Full menu of style options is available for text, background, margin and padding, border, shape and miscellaneous. You can also specify a style class. | object |
| pickerType | Whether to display and enable picker for date only, time only, or both date and time. | value: string |
| minDate | Minimum date/time as a Date object or timestamp in milliseconds. If null, the minimum date is 10 years in the past from today. | value: string |
| maxDate | Maximum date/time as a Date object or timestamp in milliseconds. If null, the maximum date is 10 years in the future from today. | value: string |
| format | Template for formatting date display - must be valid moment.js format, e.g., 'MM/DD/YYYY h:mm a'. | value: string |
| enabled | 'False' will disable any interaction with the calendar.Note: If the component is disabled, scripts can still run on the component. For example, if you add a script action to a System Event, such as an onStartup event, the script will fire when the page is loaded. Events that require user interaction, such as onClick events, will not fire with the exception of Pointer Events. | value: boolean |
| placeholder | Text for input field to display when no date/time is selected. | value: boolean |
| locale | Code for localization of language and formatting. Use the dropdown to select language. | value: string |
| dismissOnSelect | Determines if the date picker should be dismissed when a date is selected. | value: boolean |
| style | Sets a style for this component. Full menu of style options is available for text, background, margin and padding, border, shape and miscellaneous. You can also specify a style class. | object |
Component Scripts and Events​
Further component interaction and functionality can be configured for all components through scripting and event actions. Right-click on the component or select Components from the Designer menubar to access the configuration popups for both of these options:
- Configure Events: Accesses the Event Configuration popup where you can configure actions to run in response to events to make the component dynamic. The Events Configurations page shows how to configure events and actions on a Perspective component.
- Configure Scripts: Accesses the Script Configuration popup where custom methods and message handlers can be added. The Scripting in Perspective section details scripting fundamentals, creating custom methods, and using message handlers.
Example​
| Property | Value | Style Category |
|---|---|---|
| props.pickerType | date | N/A |
| props.format | MM/DD/YYYY | N/A |
| props.style.borderStyle | solid | border |
| props.style.borderColor | #00AC00 | border |
| props.style.borderWidth | 2px | border |