dalelotts/angular-bootstrap-datetimepicker — pull request #39 by ilkelma (2014-01-29 15:36:54+00:00)
Title: returnType allows return of a moment() value. Includes tests

(First pull request so bear with me if I've done something wrong)

As wlingke stated in issue #30 moment is used for formatting and parsing already and thus this fits very easily within an angular app that makes use of moment for date storage. My use case is similar to his in that I need to store the ngModel value as a moment and not a date.

From a usability standpoint the way I've implemented it the default is to behave as it does now, returning a js date object. It can then be changed by passing in returnType: 'moment' to the directive's configuration.

I've included karma tests as well.