Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

from: new Date() and to: new Date() #117

Closed
comapedrosa opened this issue Nov 9, 2015 · 1 comment
Closed

from: new Date() and to: new Date() #117

comapedrosa opened this issue Nov 9, 2015 · 1 comment
Labels

Comments

@comapedrosa
Copy link

When you set the properties of the $scope.datepickerObject if you put to: new Date() everything works fine, you can select all the days that are before the date and you can also select the today date.

    $scope.datepickerObject = {
      titleLabel:  $scope.datePickerTitle,
      todayLabel: $scope.todayText,
      closeLabel: $scope.closeText,
      setLabel: $scope.setText,
      inputDate: new Date(),
      mondayFirst: true,
      templateType: 'popup',
      showTodayButton: 'true',
      to: new Date(),
      callback: function (val) {
        datePickerCallback(val);
      }
    };

But when you use thefrom: new Date() you are able to select all the upcoming dates but not the today date. What I have done to fix it is to create an object date with the yesterday's date. It would be great that the from: new Date() wuld let you select all the upcoming days including today.

Note that for the example I'm using moment.js

    $scope.yesterday = moment().subtract(1, 'days');
    $scope.datepickerObject = {
      titleLabel: $scope.datePickerTitle,
      todayLabel: $scope.todayText,
      closeLabel: $scope.closeText,
      setLabel: $scope.setText,
      mondayFirst: true,
      inputDate: new Date(),
      templateType: 'popup',
      showTodayButton: 'true',
      from: $scope.yesterday._d,
      callback: function (val) {
        datePickerCallback(val);
      }
    };
@rajeshwarpatlolla
Copy link
Owner

Please check the new release v1.0.0. This issue has been addressed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants