I’m trying to do some time comparison within a SmartApp. I basically want to use conditional logic to compare the current time vs a time defined as a perference in the app. It seems like using the nextOccurrence method is the best way to do this. The problem I’m having is the method doesn’t seem to work according to the documentation. For example, I’d like to get the next occurrence of “10 PM” so i have “def next = nextOccurrence(‘20:00’)” as per the documentation. When I run this in the IDE I get a message indicating I need to include a TimeZone. If I try to use "def next = nextOccurrence(‘20:00’,‘America/Los_Angeles’) I get a different message in the IDE that I don’t quite understand (pasted below). Anyone have any ideas on how to get this working?
groovy.lang.MissingMethodException: No signature of method: script1410314202644455294186.nextOccurrence() is applicable for argument types: (java.lang.String, java.lang.String) values: [22:00:00.00, America/Los_Angeles]
Possible solutions: nextOccurrence(java.lang.Object) @ line 75