I currently have a flow that helps me at work. When I trigger the flow, it will simply put the "trigger time" in the notification area on my phone. The script I use to get the trigger time is {triggertime,dateformat,hh:mm} . Here is where I need help. What script string would I use to take the trigger time and add 30 minutes to it? For example, if I execute the flow at 10:00, 10:30 is the time that would display.
Thank you in advance.
Script help
Moderator: Martin
Re: Script help
use addMinutes(). While you can add the time directly to the triggertime, it is a better practice to modify it in other variable first.
then use {tt,dateformat,hh:mm} in your notification.
Code: Select all
tt = addMinutes(triggertime, 30);
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.
Re: Script help
Thank you
Would I add the string tt = addMinutes(triggertime, 30); to a global variable? I'm not sure where to add it?
Would I add the string tt = addMinutes(triggertime, 30); to a global variable? I'm not sure where to add it?
Re: Script help
No need to do so. All variable are default to local variable, only exist during flow execution and destroyed after flow stop. You only need global variable if you want to use this variable in other flow, which I don't think you need it here. If you really need it later, you can simply add global_ tag to the variable name.
Then use {global_tt,dateformat,hh:mm} in your other flow.
Code: Select all
global_tt = addMinutes(triggertime, 30);
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.