Time picker for MIT App Inventor 2 with automatic addition of a leading zero (0) to hour or minute.
Natively, App Inventor does not add leading zeros in such cases, so if you simply use timepicker.hour or timepicker.minute, you will only be shown a single digit.
This sample MIT App Inventor 2 project nicely displays the selected time over the time picker button. It can be easily ported to displaying the time in a label or any other visual object.
You can easily change the code to add a leading zero only to the minute and not to the hour, if you prefer 09:05 to be displayed as "9:05".
Installation instructions:
- Download ZeroTimePicker.aia.
- In App Inventor, go to Projects > Import Project (.aia) from my computer.
- Select the downloaded file.
- Voilà!