Medication Reminder (again)

Now I tried something:


Is this correct? And now how do I activate the clock1 to send the "notification" to the user at that time?

Great
To get a better understanding of how to work with date and time, do this tutorial

And learn how to use Do it

use Do it to debug your blocks, see also tip 4 here App Inventor: How to Learn | Pura Vida Apps
see also Live Development, Testing, and Debugging Tools

Then use the FormatDateTime method from the Clock component and show us a Do it result of that instant you just stored in TinyDB and compare the result with what you get after using Clock.Now
See also chapter 2.2.6 of the tutorial

Taifun


Trying to push the limits! Snippets, Tutorials and Extensions from Pura Vida Apps by icon24 Taifun.

Why is my 'do it' option grey? I can't select it.

You need to connect by Companion or emulator.

that is a problem because I only test my app by building it.

but didn't you told me I had to convert the timedate into millis? Also, where do I put those blocks you just sent?

Yes, because you want to store it in TinyDB
However first to have to

Therefore read again my previous answer and

Taifun

Understood but I still don't quite understood how to make 'Do it' work...
Also, sorry for all the questions but wouldn't the instant that I stored be different from the one I get on those blocks (since the clock will give the instant moment and the one I store is introduced on the timepicker by the user)?

Install the companion app and use Do it to debug your blocks, see also tip 4 here App Inventor: How to Learn | Pura Vida Apps
see also Live Development, Testing, and Debugging Tools
Taifun


Trying to push the limits! Snippets, Tutorials and Extensions from Pura Vida Apps by icon24 Taifun.

Is it this? I did the do it of the blocks you sent at 03:01 PM and the hours i introduced in the time picker was 03:03 PM...

Ok, you made some progress... very good...

Now compare the millis of the 2 instants or the FormatDateTime of the 2 instants
You will find out, that the date part of the timepicker instant is missing... to be able to compare the 2 instants, you have to add the date therefore

The timepicker gives you only an instant of time, but not of datetime

Taifun

Soo... What do I have to do exactly?

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

  1. convert both into millis and add the millis to get the millis of that datetime

  2. 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


Is it something like this?

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?