Ui.bootstrap.datepicker: change date format

I'm trying to set up ui.bootstrap.datepicker there http://plnkr.co/edit/?p=preview

I would like to set the dd-MM-yy format and make it work with masked input (second at the bottom "Popup" in plunkr)

<div class="col-md-6">
            <p class="input-group">
              <input type="date" class="form-control" datepicker-popup ng-model="dt" is-open="opened" min-date="minDate" max-date="'2015-06-22'" datepicker-options="dateOptions" date-disabled="disabled(date, mode)" ng-required="true" close-text="Close" />
              <span class="input-group-btn">
                <button type="button" class="btn btn-default" ng-click="open($event)"><i class="glyphicon glyphicon-calendar"></i></button>
              </span>
            </p>
        </div>

      

I added a new format to script.js:

  $scope.formats = ['dd-MM-yy', 'dd-MMMM-yyyy', 'yyyy/MM/dd', 'dd.MM.yyyy', 'shortDate'];

      

Is there a way to change the format of the second datepicker (under Popup) i.e. from <input type="date"...>

?

Thank.

+3


source to share


1 answer


HTML5 date input types do not support custom formats. See Is there a way to change the input type = "date" format? for more information. I think it's better to change the input type to text like the first one.



+1


source







All Articles