Yes you can.
I can demonstrate it inside a loop. Will create one later tonight or tomorrow morning.
Yes you can.
I can demonstrate it inside a loop. Will create one later tonight or tomorrow morning.
Thank you very much, have a good evening @muneer .
I created a test scenario to make sure the function works.
This sets the list and populate it with sample data
The sample data is shown in a list.
This is the routine that will remove the status messages if available.
Sample run
Processed list
Thanks for the sample block @muneer . I tried implementing this and ran into a few issues. The function does not seem to remove the status as it keeps duplicating it when the screen is opened. I added a wait block to confirm this.
Remove status function:
Calling function:
Result when opening the screen more than once:
Any idea why this could be occurring? Thanks!
Edit
I have found that the functions works when I set j
to the function rather than in list app variable timetable insert as app variable i as remove status with assignment: j
Do you mean to say that the problem with the in list ... set ...
block?
Yes, it is not removing the status. The modification I outlined above works fine though but I am not sure why list block would not be working.
So you can safely mark this post as solved. Anyway, the subject of the post is the comparison of dates which was solved already.
Thank you so much @muneer for taking the time to help me solve my queries. Your knowledge and expertise you have shared with me has taught me a lot. This was quite a challenging topic but Thunkable has such a helpful and kind community that takes the time to help with anything.
Thank you for the nice complement.
I have retained a copy of your project that you previously shared as I want to go back to it and instead of using text items in the list, I have the idea to change it to list of objects which would get rid of many substring operations.
This would be my little gift to you.
Thank you so much! Please feel free to look through the project and share any feedback or suggestions with me, here is the latest link:
https://x.thunkable.com/copy/65a6b3f99bbbe00afec26a323ba082d0
@muneer Hi Muneer,
I completed my application a couple of month ago and have not really looked at since. I recently decided to test it again to add some improvements and all the date functions / algorithms you helped make in this thread seem to be broken. The status does not seem to be working; no matter what date you select in the assignment, the status will be âdue todayâ. I checked and this seems to be because the assignment date and the current always are the same for some reason. I have spent a while trying to fix this to no avail, so a fresh pair of eyes on this problem would be much appreciated.
I know it has been a while since we went through all of this but I would really like the app to work as intended. I have no idea why it has suddenly stopped working - I have not even opened the project in a month, at that time it was working perfectly. Any help would be much appreciated.
Here is a link to the project.
https://x.thunkable.com/copy/32370fd8a39e85db591cb1c6dda6916d
the blocks in question are located on the âassignmentâ screen.
Thanks!
I just copied your project but could not find the Assignment screen.
Sorry @muneer , its actually the âhomework screenâ.
@muneer update, I created a new project and copied the code from scratch and tested it. It does not work as well. I just wanted to check if there was some sort of glitch in my project that was preventing the code from working; I have had it before where you have to drag blocks in and out in order to make the code work. Therefore, it seems that there is somehow a error with the logic. This is very frustrating as the code was working fine earlier but now, without any additional changes, it is broken. Any help would be greatly appreciated.
Thanks!
Can you just refresh my memory?
When the screen opens, it executes a function (update assignments)
This in turn executes (get dates)
Up to this point, there are no loops, but the (get dates) function is using j variable which would fail.
I tried adding a loop into that function but It is still does not work. Below, the compare dates function calls the get dates function which is in a loop. Therefore, the j variable would work as it is being called inside a loop.
I have changed this function so that it only calls on the âcompare datesâ function. You were correct in that I was called the âget datesâ function first and as that uses the âjâ variable, it would not work. I only need to call the âcompare datesâ function as it already calls the âget datesâ function. However, despite this changes, the code still does not work.
In case you were confused about what my actual problem is, I will try and explain it. When a user creates an assignment, a status message should be joined onto the assignment depending on how close the current date is from the assignment due date. For instance, if the assignment is due the following day, the status message should be 'due tomorrow or if it is due within 3 to 5 days it should be âdue soonâ. However, what is happening now is no matter what date you set the assignment date to be, the status message will always return âdue todayâ. Even if you set the assignment for 7 days time, it will say this. Remember that we created a function that converted the written date of the assignment into a numerical format. This is used to calculate the difference between the current date and the assignment date. When it is returning âdue todayâ as the status message, it is indicating that the the numerical format of the current date and the assignment date are the same.
I am sorry if I have not explained this clearly, please ask if I could explain anything further. And once again, thank you for your help.
Hi Muneer, any help with this would be greatly appreciated as I need to complete this app very soon and as of to date, its core functionality is not working. I very sorry for any inconvenience I have caused.
Thanks!
Not ignoring you but got busy with others things. Will look into it and give you a reply tomorrow.
Many thanks for your patience.