0

Type "5/3/2016" into the text box Expected: Date would be accepted and converted to "05/03/2016"

Required help:

  <input type="text" id="loanApplicationDate" name="loanApplicationDate"
       show-button-bar="false" class="form-control" 
       uib-datepicker-popup="{{newlpr.format}}" 
       alt-input-formats="newlpr.altInputFormats" 
       ng-model="@loanPresentmentRequestModel.BindingForElement(x => x.LoanPresentmentModel.LoanApplicationDate)" 
       is-open="newlpr.popup1.opened"
       datepicker-options="newlpr.dateOptions" 
       ng-required="true" tabindex="2" caret="1"/>
Nitheesh
  • 19,238
  • 3
  • 22
  • 49

1 Answers1

0

Just set

alt-input-formats="d/m/yyyy"

in your view. or set

$scope.newlpr.altInputFormats = "d/m/yyyy" 

in your controller. This will be the required solution. Now even you enter one digit for the date or month that will be accepted. In your code the current format might be "dd/mm/yyyy" that will convert your date and month to two digit enen you enter a single digit. If you set that to "d/m/yyyy" the conversion wont happen. It will take the value you entered.

Nitheesh
  • 19,238
  • 3
  • 22
  • 49