2

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

3
  • Remove ui-mask="XX.XX.XXXX" Commented Nov 11, 2015 at 7:37
  • And then nothing use datepicker-popup="dd.MM.yyyy" to format the date, what's the question? Commented Nov 11, 2015 at 7:40
  • i want to have both - datepicker and masked input. if user wants he uses datepicker, otherway he types date in input. Commented Nov 11, 2015 at 7:41

1 Answer 1

1

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

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

5 Comments

then mask not working. i need masked input with datepicker
?? what exactly you are trying to do ?
i want to have both - datepicker and masked input. if user wants he uses datepicker, otherway he types date in input.
ok, sorry didn't get that right, so ... your problem is that when you select a date your ng-model dt = "2015-11-11T07:47:07.798Z"

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.