in a part of my application the user needs to select two dates in the datepicker
and I need to save the number of days between these two dates
but the months do not have equal days how do I return the interval between different months?
in a part of my application the user needs to select two dates in the datepicker
and I need to save the number of days between these two dates
but the months do not have equal days how do I return the interval between different months?
That is done automatically if you use the right blocks for it.
Use the DURATION TO DAYS block. Attach a DURATION (start,end) to it with the start and end dates.
Also, your procedure assumes that both months are in the same year. Just use the built in blocks and enjoy a nice day! ![]()
thaaannnkss
but I only had one problem: the duration does not accept dates apparently what do I do?
convert the dates into an instant of time, see the documentation of the Clock component
Taifun
sure !
thanks ![]()
Well, if it doesn’t accept dates, then we are in trouble because that’s the only purpose of it! ![]()
Just kidding!
Learn all about instants, durations, milliseconds, etc. It sounds complicated but it will save you a lot of time when working with dates in Kodular/App Inventor.
or give a try to extension by @vknow360