4

I am using angular-ui-bootstrap datepicker. When i try to change the date manually in input box as 1/1/2015 then the model value is undefined But when I enter as 01/01/2015 it works fine.

I want to use both the format.

Plunkr link: Demo link

Eftakhar
  • 455
  • 4
  • 17

1 Answers1

1

I see the issue, here is something I found as a fix:

app = angular.module 'myapp', ['ng-bootstrap-datepicker']

AppCtrl = ($scope)->
  $scope.datepickerOptions =
    format: 'mm-dd-yyyy'
    language: 'fr'
    autoclose: true
    weekStart: 0

  $scope.date = '12-03-2000'

app.controller 'AppCtrl', AppCtrl    
angular.bootstrap document, ['myapp']

Check out this jsfiddle: http://jsfiddle.net/cletourneau/kGGCZ/

This allows for both formats to be accepted, change the scope date and the date picker should work

rocat
  • 109
  • 9
  • here you are using 'ng-bootstrap-datepicker' library. Due to some constraints I cannot use this library. Need a solution using the angular 'ui.bootstrap' library – Eftakhar Aug 28 '15 at 09:39