5

Using latest angular-ui-bootstrap and the date picker directive to do my date selections, but what I'd like to know is if it's possible to have the date picker select two different formats for a text box.

<input type="text" 
 class="form-control" 
 ng-model="vm.startDate" 
 uib-datepicker-popup="M/d/yyyy" 
 datepicker-options="vm.dateOptions" 
 close-text="Close" 
 is-open="vm.opened1" 
 placeholder="Start Date" 
 ng-required="false" 
 min-date="vm.minDate" 
 max-date="vm.maxDate" 
 init-date="vm.getCalendarInitDate()"
/>

the uib-datepicker-popup="M/d/yyyy" works fine for dates like 9/5/2015 but what about somebody who puts in 9/5/15? It doesn't work out that.

Ideally, I'd like both of them to be acceptable.

Any ideas?

1 Answer 1

5

Seems that the issue (at least for days and months) has been fixed with this commit. You can now define a day/month/year-date in format d!.M!.yyyy. It allows an optional leading zero for day and month. See this github-issue for more information.

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

Comments

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.