panchristo Posted February 15, 2011 Posted February 15, 2011 Hi all! I'm trying to make a more firendly way of entering time-of-day data into two fields, let's call them TimeStart and TimeEnd. What I'd like to have is an interface which: 1)allows typing the time in continuoous form, ommiting the separator, 2)allows for setting the time by using two buttons beside the time field (increase/decrease) for a specified increase/decrease time step 3)cycles between 00:00 and 23:59 (time-of-day strict data type) Currently, I have a script for the increase/decrease buttons by using a Set Field script step attached that uses the following formula: Time(hour(timestart);minute(timestart)+15;"00") But I have the problem time doesn't cycle in the range 00:00-23:59 and keep increasing. Do you have any ideas?
comment Posted February 15, 2011 Posted February 15, 2011 Re your script, try = Mod ( TimeStart + 900 ; 86400 )
panchristo Posted February 15, 2011 Author Posted February 15, 2011 Re your script, try = Mod ( TimeStart + 900 ; 86400 ) What does that do?
comment Posted February 15, 2011 Posted February 15, 2011 It adds 900 seconds to TimeStart, and rolls back to 0 when the result crosses midnight.
panchristo Posted February 15, 2011 Author Posted February 15, 2011 It adds 900 seconds to TimeStart, and rolls back to 0 when the result crosses midnight. Ok but I can't understand where this calc should be put. Also, what about subtracting 15' from the time?
comment Posted February 15, 2011 Posted February 15, 2011 I can't understand where this calc should be put. In the Set Field[] script step. Also, what about subtracting 15' from the time? Use minus instead of plus (how cool is that?).
HandOfCode Posted February 16, 2011 Posted February 16, 2011 Please let me know how you achieve #1 and #2
Recommended Posts
This topic is 5029 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now