Context: Currently there is no way to set a date/dateTime field to NULL once a value has been picked. Users need a Clear button inside the calendar drawer to reset the field.
Solution: Add a Clear button for date and date time form editors to set the value to NULL and collapse the drawer.
Implementation hints:
app/qml/form/editors/MMFormCalendarEditor.qml and app/qml/form/components/MMCalendarDrawer.qml is where the changes will be made.
- Add a new signal to be fired when the clear button is tapped
- There is a signal that already supports null via its second param in MMFormCalendarEditor:
root.editorValueChanged( root._fieldValue, true ) // isNull = true
- Also, you can take a look how the clear button works in MMFilterDateInput.qml lines 62-94 for filter date fields or the Clear button in Value Map/ Relation editor.
Acceptance criteria:
Context: Currently there is no way to set a date/dateTime field to NULL once a value has been picked. Users need a Clear button inside the calendar drawer to reset the field.
Solution: Add a Clear button for date and date time form editors to set the value to NULL and collapse the drawer.
Implementation hints:
app/qml/form/editors/MMFormCalendarEditor.qmlandapp/qml/form/components/MMCalendarDrawer.qmlis where the changes will be made.root.editorValueChanged( root._fieldValue, true ) // isNull = trueAcceptance criteria: