我正在使用角度UI引导程序弹出日期选择器来构建一个指令,它将允许我在需要的地方添加日期选择器.
当我将其与uiMask指令结合使用时,当我选择日期时,输入中的值会被加扰.
这是我的HTML:
<p class="input-group">
<input type="text" class="form-control"
ui-mask="99/99/9999"
ng-model="ngModel"
ng-model="order.date"
datepicker-popup="MM/dd/yyyy"
is-open="opened"
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>
Run Code Online (Sandbox Code Playgroud)
我的JS:
/**
* DATE PICKER
*/
$scope.today = function () {
$scope.dt = new Date();
};
$scope.today();
$scope.clear = function () {
$scope.dt = null;
};
// Disable weekend selection
$scope.disabled = function (date, mode) {
return (mode === 'day' && (date.getDay() …
Run Code Online (Sandbox Code Playgroud)