Datepicker add days

where i find solution. app inventor datepicker + textbox + button + label1 + label2
when user select date in datepicker and enter number of days in textbox and click button if display in label1 datepicker + number of days, and display in label2 datepicker - number of days

image

Put on 'Instant' the moment in the time related to the result of Datepicker... and in 'Quantity' put the number of days informed in the TextBox. :pray:

The 'Clock' component needs to be dragged to the Designer to have these blocks available.

Lito

@>-->---

1 Like

To subtract the number of days without using any extension, I believe it is best to break up the data resulting from the Datepicker and compose a moment in time when the number of days is equal to the number of days dismembered less the TextBox result.

This could also be valid for the sum of the days. :pray:

image

Lito

@>-->---

I'd have to double check, but I'm pretty sure that the various Add methods can take negative values if you need to subtract the amount.

1 Like

Not directly...

Indirectly it is possible, yes... but using negative values requires 'Make Instant' Block, that loses the original formatting... and needs to be formatted again to MM/dd/YYYY.

This would work for the question in the topic, but if there is another solution to subtract time I do not know it. @ewpatton :pray:

Lito

@>-->---

can Anny one display screen shot of datepicker + textbox + button + label1 + label2

image

1 Like