If you want to create a similar widget but with some extra functionality you might also consider to extend the datepicker widget with dojo.extend or dojo.mixin.
My comment is too long so i will formulate my note in answer...
My need is select date and for example hit button, which render special HTML table with special functionality. That is my widget, the table. But i dont know how to do it. Two ways comes in my mind.
1) Have some mendix form and microflow button which opens my second form containg my widget. Problem is i dont know how to pass the date parameter to my widget. How can i access him in widget JS file? (Or select this parameter in properties of my widget, which is specified in widget.xml file?)
2) Input field for date will be present inside my widget. Problem is i dont know how to use dojo datepicker in my HTML template of widget.
Note for Michel: yes, i know the ability, i can access HTML nodes using dojoAttachPoint attribute...