AngularJS partial dates input and formatting function