Filter entries by date range in plugin
Have a look at the Dashboard Widget section in the Craft docs. It’ll walk you through defining your “Start Date” and “End Date” settings, and how to render the settings template, where you can make use of the dateTimeField Twig macros to render the Date and Time fields.

An important step to make your widget save the values properly to the database. You’ll have to convert them DateTime objects to string before save in the prepSettings(), and convert them back in the getSettingsHtml() before rendering the settings template. There’s this convenient DateTime::createFromString() helper that you should proabably want to use.

Another thing that you’ll probably find useful is the mySqlDateTime() method that prepares a DateTime object for use in criteria model parameters.

Have a look at P&amp;T Store Hours plugin, that shows some of these methods in code context.