Week Picker¶
Use a week picker to pick a week in a given range.
Basic¶
Set mode='week' to show a week picker.

Set initial week¶
Set value= to pre-select a week.
Dates must be in ISO 8601 format. Date-only strings (e.g. "1970-01-01") are treated as UTC, not local.

Set min date¶
Set min= to specify a minimum date.
week = view(box('Pick a week', mode='week', value='2021-10-10', min='2019-01-01'))
view(f'You picked {week}.')

Set max date¶
Set max= to specify a maximum date.
week = view(box('Pick a week', mode='week', value='2021-10-10', max='2022-12-31'))
view(f'You picked {week}.')

Combine min and max dates¶
Set both min= and max= to restrict selection between two dates.
week = view(box('Pick a week', mode='week', value='2021-10-10', min='2019-01-01', max='2022-12-31'))
view(f'You picked {week}.')

Set range¶
Set range= to a (min, max) tuple to restrict selection between two dates.
This is a shorthand notation for setting min= and max= individually.
week = view(box('Pick a week', mode='week', value='2021-10-10', range=('2019-01-01', '2022-12-31')))
view(f'You picked {week}.')

Handle changes immediately¶
Add live to mode to handle changes immediately.
week = '2021-10-10'
while True:
week = view(
box('Pick a week', mode='live week', value=week),
f'You picked {week} (UTC).'
)

Disable¶
Set disabled=True to disable.
