Skip to main content

date-picker

Add date and time selection controls to the dashboard.

Overview

The date-picker node adds date and time selection to your dashboard. Users can select dates, times, or date ranges for filtering data, scheduling events, or setting time-based parameters.

Date
Selection
Time
Selection
Range
Selection
Format
Custom

Properties

Property Type Default Description
group string - Dashboard group
label string "Date" Label text
dateFormat string "YYYY-MM-DD" Output date format
showTime boolean false Include time picker
minDate string "" Minimum selectable date
maxDate string "" Maximum selectable date

Output Formats

Timestamp (Default)

// msg.payload (milliseconds)
1706745600000

Formatted String

// With dateFormat: "YYYY-MM-DD"
"2024-02-01"

With Time

// With showTime: true
"2024-02-01T14:30:00"

ISO Format

// dateFormat: "ISO"
"2024-02-01T14:30:00.000Z"

Example: Historical Data Query

Let users select a date range for data queries.

// Two date-picker nodes: "Start Date" and "End Date"

// Function node: Build query from selected dates
var startDate = flow.get("startDate") || Date.now() - 86400000; // Default: 24h ago
var endDate = flow.get("endDate") || Date.now();

msg.payload = {
    query: "SELECT * FROM sensor_data WHERE timestamp BETWEEN ? AND ?",
    params: [startDate, endDate]
};

return msg;

// Connect to InfluxDB or other time-series database

Example: Event Scheduling

// Date-picker configuration:
{
  "label": "Schedule Event",
  "showTime": true,
  "dateFormat": "YYYY-MM-DDTHH:mm",
  "minDate": "today"  // Can't schedule in past
}

// Output when user selects date/time:
{
  "payload": "2024-02-15T09:00",
  "topic": "schedule/event"
}

// Function node: Schedule the action
var scheduledTime = new Date(msg.payload).getTime();
var delay = scheduledTime - Date.now();

if (delay > 0) {
    setTimeout(function() {
        node.send({ payload: "Event triggered!" });
    }, delay);
}

Related Nodes