1) Edit a project
2) Select a date range, click the "Range" radio button, and save.
3) Re-edit the project
Expected behavior: New date range is shown.
Current behavior: Date is set to today
There were two issues. 1) The function date_select_opts only looked for the when field in the object. 2) The same function always expected to get the object from an explicitly provided object: option. The fix uses the field: option and tried to look up the object from any associated form. If it doesn't find one, then it uses the object: option.
coverage: 94.459%. remained the same
when pulling 8e3093ad64e943668f74a5ea672f5b685d91634a on njw-project-date-fix
into 5145bf8ab4dc44e20ec04c39a414de57b6eee90a on main.
To reproduce:
1) Edit a project 2) Select a date range, click the "Range" radio button, and save. 3) Re-edit the project Expected behavior: New date range is shown. Current behavior: Date is set to today
There were two issues. 1) The function
date_select_opts
only looked for thewhen
field in the object. 2) The same function always expected to get the object from an explicitly providedobject:
option. The fix uses thefield:
option and tried to look up the object from any associated form. If it doesn't find one, then it uses theobject:
option.