dalelotts/angularjs-bootstrap-datetimepicker

maxView option

Closed this issue · 1 comments

Great work!

I am using this plugin, and it works really well for what I need. However, I would like to be able to use the datetime picker only to select time (hh-mm) in some cases.

It would be awesome to have a "maxView" option (like the minView option) to restrict date input.

Thanks!

It is possible to implement maxView yourself in the beforeRender callback by setting $upDate.selectable = false

Try something like this (not tested):

$scope.beforeRender = function ($view, $dates, $leftDate, $upDate, $rightDate) {
    $upDate.selectable = $view === 'hour';
}

This may not be the correct logic for your application so feel free to make changes as necessary.