Taifun
Let's assume, you like to get the instant of today, 3pm
Take the datetime of today which is 2024-06-13 00:00, convert it into the format you need (see the 2 options below) and add the time received from the timepicker, which is 3pm
As always there are several possibilities to do this
-
convert both into millis and add the millis to get the millis of that datetime
-
use one of the methods from the clock component to add the 2 instants to get the instant of that datetime
Let me suggest you to start trying something
Taifun
Isn't there a simpler way to send a notification to the person at the time she chose in the timepicker when she submits the medicine? Also, I visited the 'How to use the CLOCK' tutorial and didn't quite get it how it works... I even downloaded the .aia but it didn't show what I wanted to do soo...
To add a date and the time received from the timepicker to get the alarm datetime is a simple addition like 2 + 1, it does not get simpler...
If you only visit the clock tutorial without doing anything you will not learn much...
Start doing something...
Taifun
To find out what you are doing, convert the millis into a readable format using the FormatDateTime method
If you do this exactly at midnight, then yes ..
Remember:
Taifun
What should I change then?
Thanks Taifun, now finally the data is being stored correctly... Now can you show me the blocks that are needed to make the clock remind at that time?
Sorry... it is your school project... you have to do it yourself. ..
In the clock timer event check regularly, if the current time >= alarm time, then display a notifier
Taifun
I know but can you at least give me a headstart, at least how to make the clock start working? I can figure out the rest...
set Clock.TimerEnabled to true
Taifun
Do I put that block on after timeset on the time picker or when the button save is clicked? Or is it on the "When Clock1 timer do"?
What about trying a few things? Experimenting?
Sounds like a good choice
How can that event be triggered without first starting the clock?
Taifun
Yes, comparing milliseconds is a good way to see if a deadline has passed.
I did this soo far but I don't know if I did correctly because as soon as I set the time (I didn't even click the save button), it already shows the notification that only shows up when it's time to take the medication.. can you give me a hand?
In the designer set timer enabled to false
and start the clock when you are ready
Taifun
Something is still not right, I put the alarm to the 16:35 and it sends the notification as soon as I press the 'save medication' button and the notification doesn't appear only one, it's just being spammed... How can I solve this issues?
It would really help if you provided a screenshot of your relevant blocks, so we can see what you are trying to do, and where the problem may be.
To get an image of your blocks, right click in the Blocks Editor and select "Download Blocks as Image". You might want to use an image editor to crop etc. if required. Then post it here in the community.
Taifun
Trying to push the limits! Snippets, Tutorials and Extensions from Pura Vida Apps by Taifun.