Jack Malkovich
Jack Malkovich

Reputation: 806

Angularjs UI Datepicker with ui.mask

I am trying to use ui datepicker with ui.mask:

 <div class="row">
    <div class="col-md-6">
        <p class="input-group">
          <input type="text" class="form-control" ui-mask="99.99.9999" datepicker-popup="dd.MM.yyyy" ng-model="dt" is-open="opened" datepicker-options="dateOptions" 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>
</div>

But when i select date for example 11.11.2015, it shows up in input as 11.20.1500

What am i doing wrong? Here is a plunker: http://plnkr.co/edit/1lXyWDAig2MRajxMLrLF?p=preview

Upvotes: 2

Views: 3928

Answers (1)

macrog
macrog

Reputation: 2105

change your ui-mask to ui-mask="XX.XX.XXXX" and it should be working fine

Upvotes: 1

Related Questions