<$action-sendmessage $message="tm-new-tiddler" ...> defines the initial values of the desired fields.
But it doesn’t change anything in the default EditTemplate. To actually use the <$edit-date> widget in the EditTemplate, do this:
Create a tiddler (e.g., NewContactEditTemplate), tagged with $:/tags/EditTemplate, containing:
<$list filter="[<currentTiddler>tag[Contact]]">
First met on: <$edit-date field="first-met-on" format="YYYY-MM-DD ddd" />
</$list>
While viewing this new edit template tiddler, click on the $:/tags/EditTemplate tag “pill”, and drag-and-drop the NewContaactEditTemplate title so it is just after $:/core/ui/EditTemplate/body
To hide the default display of the “first-met-on” field (so only your custom field input is shown in the editor), create a tiddler named $:/config/EditTemplateFields/Visibility/first-met-on and set it’s text field value to hide
@EricShulman There is one glitch, though. I can not pick up a date. I can change it. But I can not delete it — like I would delete the value from the field. Even if I remove the entire text from the date picker, the field continues to carry the value.
How can I set things such that I can delete the date from the date picker?
As you noted, it appears that blank input is ignored and the $edit-date widget doesn’t allow you to clear the field contents. However, I didn’t write the Date Picker plugin — based on Pikaday, so there little I can do to change it’s behavior.
Fortunately, there is a way to add some buttons next to the $edit-date widget that can also manipulate the same field.
Try this:
<$list filter="[<currentTiddler>tag[Contact]]">
First met on: <$edit-date field="first-met-on" format="YYYY-MM-DD ddd" />
<$button> {{$:/core/images/close-button}} <$action-setfield first-met-on=""/></$button>
<$button> {{$:/core/images/delete-button}} <$action-deletefield first-met-on/></$button>
</$list>
The first button clears the field contents but leaves it defined in the tiddler.
The second button completely removes the field definition from the tiddler.
You can add either button (or both buttons) to your NewContactEditTemplate, depending upon your needs.
@EricShulman Thanks. That did solve the problem. I have come to realize that I will be using the same code multiple times in my view template. And I was wondering if I can define it once and keep reusing it. But I am asking that as a separate question.