angular-ui/bootstrap — pull request #640 by bekos (2013-07-08 19:22:11+00:00)
Title: refactor(datepicker): fix code organization and performance

* Add `datepickerService` to hold common functionality.
* Remove `$watch` for `mode`.
* Use integer values (intead of strings) for `mode`, inside the directive.
* Do not create new Date objects if not necessary.