Comparing dates

The app I'm creating includes a part that compares the current date and a date chosen by the user. Is there a way to do that?

yes, the clock component offers methods to work with date and time
http://ai2.appinventor.mit.edu/reference/components/sensors.html#Clock

for example the Duration method gives you the milliseconds between 2 dates, so if you get 0 then the dates are identical

Taifun


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

2 Likes

Hello Taifun, i'm a beginner with appinventor and you seem to be of a great help!
I do not find how to show in my app the remaining time until a date and time i have selected in the date picker and time picker.
I would like to select a final date, and then my app tells me for example : 10 days, 12hrs, 50 seconds remaining before the end.
Could you show me the blocks for that if that's quick and easy for you ? (i've spent hours reading and looking for tutorials but i'm helpless :upside_down_face:

thanks so much in advance for your help !

Maryne (pronounce marina :wink: from Bordeaux in France

this extension might help

Taifun
PS: please always ask in the community rather than sending personal messages.... thank you...

Search the Gallery for countdown timers.

Hi all, this extension is great and I'm using it in my project on Mit App Inventor (not on Kodular).
Testing my APP in AI companion, this block is NOT run automatically.
I changed it's position to insert it in the main flow of the program (not in a procedure block) but it still doesn't work.
I tried manually (right click -> run) following the CompareDates.Date block and everything works fine.
I can't figure out where I'm wrong.
Is it not 100% compatible with Mit App Inventor or do I need to add something?

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 icon24 Taifun.

I'm sorry, in the end I was able to calculate the difference in days with the internal clock functions and I no longer used the extension.
I will certainly use it for other projects because it is very comfortable and fast, in case I will post the possible error.
Thank you very much for the support you give us.

M.

great... you might want to provide a screenshot of your solution to help others with the same question in future... thank you...

Taifun

It's works.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.