A simple stand alone widget that presents an input field to select a date time. The widget supports a custom label and shows the current state of the DateTime Item in the footer. Clicking on the calendar icon opens the selection widget. Alternatively one can just type in the date. Clicking the check causes the new date time to be sent to the Item.
I am interested in working with dates in a custom widget but what happens to me is that when I press outside, the date is deleted and I would like it to remain present. I have seen the example of him, I have replicated it and it also happens.
For info, as I get inconsistent results depending on browser. I get that there’s not much control available for this…!
Dark theme used throughout.
Ubuntu, Firefox
Clicking on either dd, mm, or yyyy gives the below - no time picker. Clicking anywhere else provides nothing. After selecting a date, user has to manually enter a time before the check icon can be clicked, otherwise nothing happens.
Ubuntu, Chromium
The picker only comes up when clicking the almost invisible calendar icon, but at least you can choose the time! Picker doesn’t respect the theme settings.
I have similar problem with iPhone/iOS.
Doesn’t work in openHAB app or edge browser on the phone.
The widget works fine on PC. @rlkoshak do you know why?
There where some issues with setting time in the input card. This should be resolved with PR#1525. It will be available with the next milestone.
The datetime-local behaviour is not consistent across browsers. With the next milestone, you should be able to use datepicker as type and set a showTime flag to true. However, when using datetime-local, it should now correctly show time as well.
On iOS, no matter what browser you use, all browsers are forced to use the same renderer. So when you see differences in how things look, switching browsers on an iOS device isn’t going to help.
Hi,
is it possible to change the format of the displayed datetime-value? I would like to have a format like “weekday, dd.mm hh:mm”, which also shows the weekday
Put the formatting you desire in the State Description metadata and change the widget to use =items[props.item].displyState.
However, be aware that you probably don’t want to do that for the placeholder. I’m pretty sure you’ll end up with a mess if you try to put it there. But it will work just fine in the footer.
I still having problem.
But I can change the value if the item already have value.
So to set the value first time you have to open OH GUI in web browser on your PC/MAC.
I also have set this item should restore when booted. So I don’t need to manually set the item after reboot.
Hi,
What do I need to do to just see the time component and not to display the calendar.
I saw it somewhere but couldn’t find the configuration for the yaml code
thanks for pointing me to the right documentation part if there is one.
joerg