DateTime List Item

A List Item input widget to select and enter a date time to populate a DateTime Item. The date and time can be entered through text or click the calendar icon and open a selector. The date and time will not be sent to the Item until the check icon is clicked. The current state of the Item is shown under the label.

Screenshots

Changelog

Version 0.2

  • Adjusted to show the displayState, if defined

Version 0.1

  • initial release

Resources

uid: rlk_datetime_list
tags:
  - marketplace:127967
props:
  parameters:
    - description: Label for the widget
      label: Label
      name: label
      required: false
      type: TEXT
    - context: item
      description: An item to control
      label: Item
      name: item
      required: false
      type: TEXT
  parameterGroups: []
timestamp: Jan 20, 2022, 9:48:26 AM
component: oh-input-item
config:
  inputmode: text
  label: =props.label
  name: alarmtime
  outline: true
  sendButton: true
  subtitle: "=(items[props.item].displayState) ? items[props.item].displayState : items[props.item].state"
  title: =props.label
  type: datetime-local
1 Like

I get the following error when trying to add the “Date Time List Item”:

Running OH 3.3.0-SNAPSHOT on Win 10. No problem to add when running OH 3.2.0

There have been a number of threads on this posted to the forum. It seems to be a more system wide issue.

I’ll remove the date field from my widgets in the mean time which should work.

Hi @rlkoshak,
i like your widget very much, but didn’t get it work. I copied the code from the resources block or installed it through the marketplace, but it always stays empty.
Is there everything that have to be done before?

I’m using oh3.2.

What always stays empty? How are you trying to use it? Have you set it as the Default List Item Widget for a DateTime Item? Does your Item have a state that isn’t NULL or UNDEF? Where are you looking at the widget?

My testitem looks like:

The widget isnt shown in the default card for the room.

Did you look on the Properties tab of the room’s card? Since this isn’t a member of an Equipment, it’s a property directly on the Room and is shown on a separate tab. This is discussed in the Getting Started Tutorial: Pages - Overview Page | openHAB

Note that what you see on the Item’s page is the Stand Alone Widget, not the List Widget.

Nothing is shown in the property tab :/.
Furthermore if i open the timestamp card, which is created with this item, it only shows:

Do i need to install something?

Then there is something wrong with the model or with your Item. Perhaps you need to refresh the page. It’s not something that is related to this widget so opening a new thread is probably best.

NOTE: there is nothing at all special about this widget. It’s just a standard oh-input Item with the inputmode set to “datetime-local”.

On thing you can check is go back to the Default List Item Widget screen. Does it render there?

Edit: Wait, I had to remove a line from this earlier and may have removed one too many lines. It should work now. You’ll have to delete it and reinstall it.

After reinstalling the widget it now renders :). But for now the calendar button / calendar itself is missing. And i cant input anything
I’ll take a deeper look into it at the afternoon.

Hi Rich,

I can cofirm this problem, the item only shows an input box with the content mm/dd/yyy …, no calendar and no check icon is displayed.
Inputs in the box are seemingly not forwarded to the item. I set the default List Item Widget of the Item to rkl_datetime_list

grafik

I just posted a new version. I didn’t change anything except to use the displayState in the label if it’s defined.

All I can say is that it works for me (except I see that the check button no longer shows up) and there really isn’t anything else I can do about it. If I can’t reproduce the problem I don’t know what to fix.