krescruz / angular-materialize

Angularjs directives for Materialize CSS Framework https://github.com/Dogfalo/materialize
MIT License
397 stars 129 forks source link

DatePicker not work #204

Closed jeansarlon closed 7 years ago

jeansarlon commented 7 years ago

Picker modal not open!!

view

<form novalidate name="formulario" class="col s12" ng-submit="submit()">
    <div class="row">
        <div class="input-field col s12">
            <label for="inputCreated">Data</label>
            <input input-date
            type="text"
            name="date"
            id="inputDate"
            ng-model="task.date"
            container=""
            format="dd/mm/yyyy"
            months-full="{{ month }}"
            months-short="{{ monthShort }}"
            weekdays-full="{{ weekdaysFull }}"
            weekdays-short="{{ weekdaysShort }}"
            weekdays-letter="{{ weekdaysLetter }}"
            min="{{ minDate }}"
            max="{{ maxDate }}"
            today="today"
            first-day="1"
            clear="clear"
            close="close"
            select-years="15"
            on-start="onStart()"
            on-render="onRender()"
            on-open="onOpen()"
            on-close="onClose()"
            on-set="onSet()"
            on-stop="onStop()" />
        </div>
         </div>
</form>

Controller

var currentTime = new Date();
   $scope.currentTime = currentTime;
   $scope.month = ['Januar', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'];
   $scope.monthShort = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
   $scope.weekdaysFull = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'];
   $scope.weekdaysLetter = ['S', 'M', 'T', 'W', 'T', 'F', 'S'];
   $scope.disable = [false, 1, 7];
   $scope.today = 'Today';
   $scope.clear = 'Clear';
   $scope.close = 'Close';
   var days = 15;
   $scope.minDate = (new Date($scope.currentTime.getTime() - ( 1000 * 60 * 60 *24 * days ))).toISOString();
   $scope.maxDate = (new Date($scope.currentTime.getTime() + ( 1000 * 60 * 60 *24 * days ))).toISOString();
   $scope.onStart = function () {
       console.log('onStart');
   };
   $scope.onRender = function () {
       console.log('onRender');
   };
   $scope.onOpen = function () {
       console.log('onOpen');
   };
   $scope.onClose = function () {
       console.log('onClose');
   };
   $scope.onSet = function () {
       console.log('onSet');
   };
   $scope.onStop = function () {
       console.log('onStop');
   };
}
jeansarlon commented 7 years ago

The problem was solved I had forgotten that: var app = angular.module('DBTest', [ 'ui.materialize'])