logbon72 / angular-material-datetimepicker

Datepicker for Angular Material, mimick's Android's date time picker
https://logbon72.github.io/angular-material-datetimepicker
MIT License
169 stars 123 forks source link

Suggestion: Type Date Time Option #85

Open alobban opened 7 years ago

alobban commented 7 years ago

The ability to type in the date-time instead of being forced solely to use the picker. Some users find it faster to type in the values than having to pick it. Any PRs?

logbon72 commented 7 years ago

You can disable the dialog for an input and use a button, alongside the mdcDateTimeDialog service to display dialog.

Somewhere on your page, you have:

<input ng-model="selectedDateTime"/> <md-button ng-click="displayDialog()">Use Picker</md-button>

Then in your controller:

      $scope.displayDialog = function () {
        mdcDateTimeDialog.show({
          maxDate: $scope.maxDate,
          time: false
        })
          .then(function (date) {
            $scope.selectedDateTime = date;
          });
      };
hexadecy commented 7 years ago

The thing missing is how to format the input without the directive. I used type="date" for the example, it works but not for "datetime".

hexadecy commented 7 years ago

Released in our fork v1.6.7