nclark
January 31, 2025, 8:22pm
1
EDIT: This code actually worked after all...
Looking to see how I can set a default value for a time input?
input (name: "pollStartTime", type: "time", title: "Time to start poling the API ", defaultValue: "13:13")
This does not work nor do many other attempts to set a default value
nclark
January 31, 2025, 8:34pm
3
Thanks, but that thread has nothing to do with the time input type and having a default value already entered in the fields when the app opens for the first time.
I haven't tried this, but time input returns a String value formatted like this:
"yyyy-MM-dd'T'HH:mm:ss.sssXX"
You might try that...
1 Like
nclark
January 31, 2025, 8:35pm
5
Thanks Bruce, I'll try that tonight and see, will report back.
1 Like
This worked for me:
input (name: "pollStartTime", type: "time", title: "Time to start poling the API ", defaultValue: "13:13")
It shows the default value until entering the input area to change (actual value at that point is null).
2 Likes
nclark
January 31, 2025, 8:47pm
7
thebearmay:
This worked for me:
??? hmmm that is weird as heck, I just copied you're line and it worked, yet it's the same as what I posted above ???
When I hit done, it saves the preference with the default value.
Thanks for making me test it again, maybe I added the colon and did not test it thinking I did!
1 Like