2017-11-07 8 views
1

未来のみをangularjs:感謝停止は

<input 
         type="text" 
         datetime-picker 
         date-format="dd-MM-yyyy hh:mm a" 
         future-only 
         name="flightarrivaltime" 
         ng-model="users.flightarrivaltime" 
         required> 

angular.module('Options', ['angularjs-datetime-picker']) 
    .controller('Options', ['$rootScope', '$scope', function ($rootScope, $scope) { 

    }]); 

はまた、ユーザーを許可することができます提案してください私は今よりも

を以前の日付にかかる力の検証エラーを設定したいしかし、それは動作しません。月に

+0

使用**バリデータ**:https://docs.angularjs.org/guide/forms#カスタム検証 – Thowk

答えて

0

を設定するためにそれはまだ https://github.com/kineticsocial/angularjs-datetime-picker によると、すべての過去の日付を表示しますが、それ以前の日付はフォームが

0123無効になります選択している場合

次はあなたの問題を解決する: https://github.com/720kb/angular-datepicker

JS

$scope.MinDate = new Date(); 
$scope.Date = null; 

HTML

<datepicker><input ng-model="date" date-min-limit="MinDate" type="text"/></datepicker>