Cannot preload Time field in Dashboard form

I'm trying to preload the Time field of a node red dashboard ui form using the incoming msg, like so:

[{"id":"c1dce9ca4b3f9013","type":"ui_form","z":"30c224646f95e02b","name":"Date form","label":"","group":"903a6ab8.4f4ca8","order":1,"width":0,"height":0,"options":[{"label":"formDate","value":"formDate","type":"date","required":false,"rows":null},{"label":"formTime","value":"formTime","type":"time","required":false,"rows":null}],"formValue":{"formDate":"","formTime":""},"payload":"","submit":"submit","cancel":"cancel","topic":"","topicType":"str","splitLayout":false,"x":1180,"y":1160,"wires":[["c3abdd59a3dcf461"]]},{"id":"ffbc742075c7aa70","type":"function","z":"30c224646f95e02b","name":"Date & Time","func":"msg.payload = {\n    formDate: \"2021-08-10T19:24:42.854Z\",\n    formTime: \"1970-01-01T20:26:00.000Z\"\n    }\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":975,"y":1160,"wires":[["c1dce9ca4b3f9013","48e7b13e046a3fbc"]]},{"id":"3287732f7dd33cd2","type":"inject","z":"30c224646f95e02b","name":"","repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":800,"y":1160,"wires":[["ffbc742075c7aa70"]]},{"id":"48e7b13e046a3fbc","type":"debug","z":"30c224646f95e02b","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":1190,"y":1200,"wires":[]},{"id":"c3abdd59a3dcf461","type":"debug","z":"30c224646f95e02b","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":1350,"y":1160,"wires":[]},{"id":"903a6ab8.4f4ca8","type":"ui_group","name":"Home","tab":"e2e6f4f5.56f91","order":1,"disp":false,"width":"6","collapse":false},{"id":"e2e6f4f5.56f91","type":"ui_tab","name":"Home","icon":"dashboard","order":1,"disabled":false,"hidden":false}]

What I'm feeding into the form is the exact output of itshelf, when submiting new values, for example:

msg.payload = {
    formDate: "2021-08-10T19:24:42.854Z", // Works
    formTime: "1970-01-01T20:26:00.000Z" // Does not work
}
return msg;

The date field initializes, but the time field does not.

2021-09-01 01_07_32-form

Am I missing something? Thanks!

Node-RED version: v2.0.5
Node.js version: v10.24.1
Linux 5.10.52-v7l+ arm LE
Dashboard version 2.30.0 started at /ui

I have tested and confirmed... no apparent way to dynamically load in a time field.

Submitting this gets this...

image image

Feeding this back via function node get this...
image image

It does seem strange that the submitted time output is using the 1970-01-02 date instead of current.

And I think this git-hub issue is referring to the same thing as this topic issue.

Oh, also... (default) label and data format is backwards... but data format probably also depends on region?

image

So, I guess we need to wait for the fix..

It does not seem to depend on region. It is mm/dd/yyyy. Ι did not find any obvious way to change it.

It does depend on language settings I think... mine is
image
(the smaller text above is set by the label so is under your control)

I have a fix for the time input in the v3 branch on github. Not quite ready for release.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.