Closed rkoshak closed 1 year ago
@rkoshak
I know what‘s the problem:
Since my PR #137, toZDT
is no property of time
in time.js.
Anyway, you can call time.toZDT
because toZDT
is seperately exported with module.exports
.
I changed this because otherwise typescript
was not able to generate type definitions for toZDT
, sorry.
I fixed that, you might have seen the commit which links to this issue.
As I am not at home and currently can‘t try out myself, so it would be cool if you could verify that it works.
Just run npm install git+https://github.com/florian-h05/openhab-js.git#issue-150
in OPENHAB_CONF/automation/js
.
I‘ll open a PR; please give an approval review if it works.
Expected Behavior
When calling
myZDT.isBetweenTimes(before, after)
I expect to get back a boolean.Current Behavior
An error is thrown:
I know this worked when I checked it in because I had test cases to exercise it. But I can't see anything that has changed in time.js since then to cause it to break.
Possible Solution
I don't understand the problem yet so I've no idea how to fix it. Clearly there is something going on that is making it invisible to the isBetweenTimes function.
Steps to Reproduce (for Bugs)
time.toZDT()
just to prove to myself that there is nothing wrong withtime.toZDT()
. Let's name itmyTime
.myTime.isBetweenTimes("06:00:00", "12:00:00")
or just about anything thattoZDT
supports.Context
Your Environment