Skip to first unread message

Spede

unread,
Jan 25, 2018, 4:04:29 PM1/25/18
to MIT App Inventor Forum
Hi,

I have a program with two DatePickers and a List-button. I set the start day with the first Datepicker and the end day with the other one and with the List button it prints the number of days and a list of dates between the two dates as milliseconds. My problem is that I can't convert the list of dates as milliseconds to a list of dates MM/dd/yyyy.  Can someone help me? This is about App Inventor 2.

TimAI2

unread,
Jan 25, 2018, 6:33:18 PM1/25/18
to MIT App Inventor Forum
Can you show blocks of how you are making the list of dates (in millis) then I am certain it will be possible to advise on a solution

Spede

unread,
Jan 26, 2018, 12:20:34 AM1/26/18
to MIT App Inventor Forum
Hi, The blocks are here. The view looks a little mixed and there are some extra blocks after trying to make it but hopefully you can read it.
blocks (5).png

TimAI2

unread,
Jan 27, 2018, 7:19:32 AM1/27/18
to mitappinv...@googlegroups.com
Here you go

Blocks


aia attached.


I used just one datepicker with two buttons and set a variable from each button for the logic

Added a 1 to the number of days calculation so it matched the number of dates displayed

The method was to assign the picked dates to variables and then use the built in clock format date for desired date display

The Reset button and placement of reset blocks in the code ensure the labels and the dates list are empty on each run


millis.aia

Spede

unread,
Jan 27, 2018, 7:26:46 AM1/27/18
to MIT App Inventor Forum
Thank you very much for your advise Tim!
Reply all
Reply to author
Forward
0 new messages