I changed the type to: datetime-local instead of datepicker.
Now I can set the date/time as well. However, the value always disappears in the input box field after it was set. Is this a normal behavior?
EDIT: I added a footer to display the item state as workaround. The calenderParams are useless when using type datetime-local as far as I see.
I have been trying to instantiate a simple, working timepicker widget for quite some time now for the purpose of bootstrapping.
I want to use the “time” input widget as it’s graphically nicer than any text-alike input.
Unfortunately right on Firefox on PC which I use per default, I keep seeing what @rlkoshak did (cannot click into). Chrome, Edge and even Firefox on Android work with the same widget code, there’s a clock symbol appearing, but not on my PC.
Has anyone gotten ‘time’ icon to appear and work with Firefox/PC?
If I modify the code and change type to datetime instead of datetime-local I get kind of a strange input field that does work on mobile devices but doesn’t work on the macbook/pc.
Any ideas?
I running the latest stable but previous stable had the same issue.
I know that the fields are implemented differently from one browser to the next. Perhaps they are not implemented correctly on Apple. I’m not sure what you can do about it short of just making it a plain old text field instead of a datetime type.
Thanks for the response. Think it is the iPhone and iPad that are the culprit because the mac does do ok. Chrome browser on the 2 former devices have the same issue…
Just like in OH 2.x, to persist the state of an Item across reboots one must use Persistence. Unlike in OH 2.x, OH 3 will install rrd4j by default and save everything that rrd4j supports with restoreOnStartup. But since you are coming from 2.5 I suspect either you are using addons.cfg which means rrd4j is probably not installed, or you have an rrd4j.persist file which is configured not to restoreOnStartup these Items.
Many thanks for this nice tutorial. I’m wondering why the time has different formats (12/24). E.g. in post #1 (last figure) time in the footer is clearly in 24 hour format but in Yannick’s post #2 the Time input is in 12 hour format. I have exactly the same situation which is somewhat annoying.
The config in the original post just shows the default rendering of the DateTime without any custom formatting applied. If you want to change that define a State Description Pattern to format the DateTime as you want and charger the widget config to use displayState instead of state.
Yes, I made these two changes. I’ll have a look at settings again in the evening. Hopefully I manage to change the time to 24 hour format. I made a rule to poll my Modbus device to read the time because it disappears from the input box after I have clicked the check mark.
i do have the same issue with time format , it always shows " --:-- --"
could you share the input card code example which has working 24 hour formatting i can get my input for time running with 24h
here is what i tried.
solve !
it was actually the language setting in the browser that define the 12 hour edit mode.
i changed to german and no the 24 hours are shown.
Sorry
many thanks for sharing
I tried with your code and still face same issues .
He input field still has 12hour with AM/PM