Datepicker special control

Datepicker special control

I have a need to do the following and do not know how to set up Datepicker.

An input box which will take text from user. I want Datepicker to show only after the user typed the the text "date(", and this allow the user to pick a date and append the date string  the text - e.g. "date(2019-01-10". Now the user can continue to type and pick another date later and the now date will keep append to the text of the input box.

Below is my design:

User input --> a key up event callback will check input for text "date(" --> show Datepicker --> User pick date --> Datepicker append date string to input box --> user continue to type --> at somepoint, user pick another day --> Datepicker append text --> user click the closebutton of Datepicker --> input end