What about showing us a screenshot of your relevant blocks of that screen then?
Taifun
What about showing us a screenshot of your relevant blocks of that screen then?
Taifun
I already have very low expectations of your abilities, but you regularly manage to undercut them.
@SteveJG gave you the solution, you ignored it and were not able to understand, that it is the solution.
Taifun
Sorry, it's just that I am under a bit of stress lately, now it works just fine, thanks SteveJG.
Now how do I make in the list instead of appearing the "mm/dd/yyyy hh:mm:ss s" appear something like "(Name of the medication) - (Description) - (Alarm Time)" ?
I don't know either.
Perhaps if those values are saved as a List in the Tag mm/dd/yyyy hh:mm:ss s if you click on the Tag in the LV GetTags, this code might
Try it. What happens?
or another way to display the content of the time Tag if you wish to display the information in a Label
What it happened was: It appear the name, description and the dosage like on top of each other and the alarm time dissapeared
Let's look again at the concept
Now your skills of working with lists can come to action again...
You have to create that list manually
Here is a pseudo code:
Use a for each item in list loop together with TinyDB.GetTags as list
Inside the loop do a TinyDB GetValue item to get a list of the stored data of a specific alarm time, which is a list of 3 items (name, description, dosage)
Now select the first item to get the name and select the second item to get the description
Use the add items to list block to add the data of your choice (name, description, alarm time) into a new list
Display the newly created list in the Listview
Remember to use Do it to debug your blocks...
Taifun
That's a lot to take in all at once... I don't think I can do that...
Additionally, there's another issue. On the screen where you add medication, if someone sets the alarm for a time that refers to the next day (like 4 AM when it's currently 4 PM), the alarm will go off immediately because 4 AM is earlier than 4 PM.
Just add an if statement
if alarm time < current time
Then add 1 day to the alarm time
You can find the AddDays method in the Clock drawer
Taifun
it is not too complicated if you are familiar with working with lists...
let me suggest you to simplify ... reduce your expectations...
in the listview display your alarm times as you already have it and after selecting an item display the details of that alarm time in one or several labels... @SteveJG already gave you the blocks for that
Taifun
I'm feeling soo dumb... I understand what you said and found the component I just didn't understand how to put it in blocks, this is what I have.. where exactly do I put the AddDays method?
There is a small issue.
You need to get into the habit of reading through the blocks pallette of a component every time you use it, even if you know part of the answer.
Work with your eyes open.
Regarding Instants, use the FormatDateTime block on them to get something human readable.
Read that block's tool tip and follow its link to the table of formats.
SMALL issue. I think it is a BIG issue.
What you see in yellow is what happens when you post an instant in a Label. You want a formatted date.
You did not post the blocks you used to get that display. That makes helping you very difficult. I guess what you need to fix the issue might be Blocks like this
That part I already solved but there is somethings I still don't understand.
Soo I have my dosage selection on a spinner and what the user selects is put on a label and when I go on the listview screen, now everything appears correctly except the Dosage information that doesn't appear at all.
Also, could you help me with the blocks to add the in here?
Soo it can do what Taifun said because I don't know where to place them exactly:
if alarm time < current time
Then add 1 day to the alarm time
I don't have an aia of your Project. This means I can't see all your Blocks to help you figure out why the dosage information doesn't appear (in the Label ???). Post the Blocks you use to try to show medication - dosage - date please.
Did you try the blocks you posted. Looks like they might work.if you add 1 day instead of using Notification in the then puzzle piece.
You could use the AfterTimeSet event for that, calculate the correct alarm time there and store it in TinyDB...
Anorher thing to consider...
You are storing several alarm times in TinyDB...
But in the Clock Timer event currently you compare the last picked alarm time and the current time...
What is missing is to detect the next alarm time and do the comparison for that in the Clock Timer event
Also when there was an alarm, then again detect the next alarm time
Taifun
And how exactly would I do that?