Default values in text input

Hi there!

I want to have a default value shown in the text-input (datetimepicker mode). I tried inputting a msg.payload with a numeric value representing miliseconds since epoch but it does not work.

The previous version of node-red-dashboard was able to do it, but I have not found the equivalent functionality for this case.

Any help?
Thanks!

You need to get the format correct.

[
    {
        "id": "57eaf83075f31008",
        "type": "ui-text-input",
        "z": "6f4940a10947d173",
        "group": "668a1b1875de5546",
        "name": "",
        "label": "Date Time Picker",
        "order": 4,
        "width": 0,
        "height": 0,
        "topic": "topic",
        "topicType": "msg",
        "mode": "datetime-local",
        "tooltip": "",
        "delay": 300,
        "passthru": true,
        "sendOnDelay": false,
        "sendOnBlur": true,
        "sendOnEnter": true,
        "className": "",
        "clearable": false,
        "sendOnClear": false,
        "icon": "",
        "iconPosition": "left",
        "iconInnerPosition": "inside",
        "x": 1330,
        "y": 1400,
        "wires": [
            []
        ]
    },
    {
        "id": "b3cc8dead0c94a3f",
        "type": "inject",
        "z": "6f4940a10947d173",
        "name": "",
        "props": [
            {
                "p": "payload"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": true,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "1972-03-22 10:15",
        "payloadType": "str",
        "x": 1090,
        "y": 1400,
        "wires": [
            [
                "57eaf83075f31008",
                "2e12ff52992417c5"
            ]
        ]
    },
    {
        "id": "9ba572ac4f6c9a49",
        "type": "inject",
        "z": "6f4940a10947d173",
        "name": "date today",
        "props": [
            {
                "p": "payload"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": true,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "$moment().format('YYYY-MM-DD HH:mm:00')",
        "payloadType": "jsonata",
        "x": 1070,
        "y": 1460,
        "wires": [
            [
                "57eaf83075f31008",
                "2e12ff52992417c5"
            ]
        ]
    },
    {
        "id": "2e12ff52992417c5",
        "type": "debug",
        "z": "6f4940a10947d173",
        "name": "",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "payload",
        "targetType": "msg",
        "statusVal": "",
        "statusType": "auto",
        "x": 1310,
        "y": 1460,
        "wires": []
    },
    {
        "id": "668a1b1875de5546",
        "type": "ui-group",
        "name": "Pre Populated",
        "page": "5d43941d3f14c655",
        "width": "6",
        "height": "1",
        "order": 3,
        "showTitle": false,
        "className": "",
        "visible": "true",
        "disabled": "false"
    },
    {
        "id": "5d43941d3f14c655",
        "type": "ui-page",
        "name": "Text Input",
        "ui": "72c1e5a9ec204878",
        "path": "/text-input",
        "icon": "cursor-text",
        "layout": "notebook",
        "theme": "5075a7d8e4947586",
        "order": 16,
        "className": "",
        "visible": "true",
        "disabled": "false"
    },
    {
        "id": "72c1e5a9ec204878",
        "type": "ui-base",
        "name": "My Dashboard",
        "path": "/dashboard",
        "appIcon": "",
        "includeClientData": true,
        "acceptsClientConfig": [
            "ui-notification",
            "ui-control",
            "ui-chart"
        ],
        "showPathInSidebar": false,
        "showPageTitle": true,
        "navigationStyle": "default",
        "titleBarStyle": "default"
    },
    {
        "id": "5075a7d8e4947586",
        "type": "ui-theme",
        "name": "Default Theme",
        "colors": {
            "surface": "#ffffff",
            "primary": "#0094CE",
            "bgPage": "#eeeeee",
            "groupBg": "#ffffff",
            "groupOutline": "#cccccc"
        },
        "sizes": {
            "pagePadding": "12px",
            "groupGap": "12px",
            "groupBorderRadius": "4px",
            "widgetGap": "12px"
        }
    }
]
1 Like

Thanks, it worked!