1
0
Fork 0

apps: settings: Clamp the dates a little more tightly

Currently a couple of down presses on the year results in the time being
set to some time in 2099. The micropython date logic does not support
dates this far in the future and throws an exception. Adopt a simple
fix that should be OK for the next 39 years ;-) .

Reported-by: Christopher Peters <me@christopherp.de>
Fixes: #167
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
This commit is contained in:
Daniel Thompson 2021-02-20 08:42:16 +00:00
parent a0ee26a412
commit 090ed8489b

View file

@ -36,7 +36,7 @@ class SettingsApp():
self._MM = wasp.widgets.Spinner(130, 60, 0, 59, 2) self._MM = wasp.widgets.Spinner(130, 60, 0, 59, 2)
self._dd = wasp.widgets.Spinner(20, 60, 1, 31, 1) self._dd = wasp.widgets.Spinner(20, 60, 1, 31, 1)
self._mm = wasp.widgets.Spinner(90, 60, 1, 12, 1) self._mm = wasp.widgets.Spinner(90, 60, 1, 12, 1)
self._yy = wasp.widgets.Spinner(160, 60, 20, 99, 2) self._yy = wasp.widgets.Spinner(160, 60, 20, 60, 2)
self._settings = ['Brightness', 'Notification Level', 'Time', 'Date'] self._settings = ['Brightness', 'Notification Level', 'Time', 'Date']
self._sett_index = 0 self._sett_index = 0
self._current_setting = self._settings[0] self._current_setting = self._settings[0]