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?
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With