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

1 Answer 1

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

Sign up to request clarification or add additional context in comments.

1 Comment

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.