Bug in timeTodayAfter

(www.rboyapps.com - Make your home your butler!) #1

@Jim, this one’s for you. According to the documentation

Gets a Date object for the specified input that is guaranteed to be after the specified starting date.

Date timeTodayAfter(String startTimeString, String timeString [, TimeZone timeZone])

So this code should return the time input by the user (10:59 AM) but with tomorrow’s date:

input “endTime”, “time”, title: “End Time”

def scheduledEnd = timeTodayAfter(endTime, endTime, location.timeZone) // Get the time for tomorrow

Instead it return today’s date with the time selected by the user. (Thu May 19 2016 10:59 EDT)

Looking at the debug settings the input time as stored in settings is:


Potential issue is when the input is taken from the user it is stored with a past date (2014-11-14 as you can see, and I entered this on 2015-5-19). So timeTodayAfter returns today date because the starting date is 2 years ago.

Either the documentation is incorrect or the functionality is broken.

@slagle @jody.albritton FYI please

(www.rboyapps.com - Make your home your butler!) #2

FYI even this doesn’t work, this should guarantee that the starting date is todays’s date so it should return the next date, but it doesn’t, so it may be a bug with the platform implementation

def scheduledEnd = timeTodayAfter(timeToday(endTime), endTime, location.timeZone) // Get the time for tomorrow