Closed ghost closed 7 years ago
Done with a caveat: you cannot use the server-provided pattern for DateTime items, and the format is different - see https://docs.angularjs.org/api/ng/filter/date for a reference.
I am still having difficulty getting the time format to change. Is the problem anything to do with the fact that I have a JAR file in my addons and the latest code in my conf\html directory?
Ideally, I would like to just use the 'shortTime' format and have tried multiple options without success.
Could you possibly give me an example of exactly what I should type into the format field in the dummy widget.
Thanks in advance. Mike
Below is a comparison, the first widget is the raw value and the second one is what I get when I put 'HH:mm' as a format:
'shortTime' is also a valid option but since there's no good way of configuring AngularJS locales in a generic way, it'll use a US English format (12h)
Did you update the latest sources and run from your static install in server:8080/static/habpanel
and not server:8080/panelui/
?
Yes, definitely running from the latest source, I just downloaded the master again and copied over the old code. Also definitely running from the static install.
This is what I am seeing:
Just noticed something else, the icons seem to be broken.
They are still there but now very small.
p.s. the icons seem to be broken on the slider to.
I might try a fresh install rather than copy over the old. Will report back shortly.
I just deleted the habpanel directory and reinstalled. Same issues as the above two posts are still there.
This might help with the icon issue.
For both the slider and the dummy widget , if I click the 'center backdrop horizontally' the icons return on both widgets. In the case of the slider the icon disappears when I un-click that option.
Don't put quotes around the format, it's simply:
HH:mm
The icons are a result of an unfortunate CSS change, I'll look into it.
I tried that....
Strange... is your item a DateTimeItem? You can check by navigating to http://server:port/rest/items
and looking for your item's name, the type must be DateTimeItem.
{"link":"http://localhost:8000/rest/items/astro_sun_local_rise_start","state":"2016-08-29T06:50:00.000+0200","stateDescription":{"pattern":"%1$tF %1$tR","readOnly":true,"options":[]},"type":"DateTimeItem","name":"astro_sun_local_rise_start","label":"Start time","tags":[],"groupNames":[]}
Here's what I got from the REST API, hope this give some clues to the issue.
{ "link": "http://192.168.1.240:8080/rest/items/Sunrise_Time", "state": "2016-08-29T07:04:00.000+1200", "stateDescription": { "pattern": "%1$tH:%1$tM", "readOnly": false, "options": [] }, "type": "DateTime", "name": "Sunrise_Time", "label": "Sunrise", "category": "sunrise", "tags": [], "groupNames": [ "Weather" ] }
I will go and try to change it to DateTimeItem and advise
Following is my item definition:
DateTime Sunrise_Time "Sunrise [%1$tH:%1$tM]"
It does not appear that I can change it to DateTimeItem in either the Paper UI or OH2 Designer.
Huh. All my items are suffixed with 'Item' and it looks like yours are not, maybe this changed at some point in ESH/openHAB and we have different versions (mine is from last month). Anyways, let's check for both types. Please try with this latest change. We're getting there ;)
That's all fixed now. Thank you!
At last! Thanks!
Problem parsing Date & Time data to the dummy widget.
Please refer to the following forum post:
https://community.openhab.org/t/habpanel-bundle-proof-of-concept-aka-panel-ui/12981/35