Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angularjs/24.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails 如何在AngularJS datepicker中禁用星期天?_Ruby On Rails_Angularjs_Twitter Bootstrap_Angular Ui Bootstrap_Bootstrap Datepicker - Fatal编程技术网

Ruby on rails 如何在AngularJS datepicker中禁用星期天?

Ruby on rails 如何在AngularJS datepicker中禁用星期天?,ruby-on-rails,angularjs,twitter-bootstrap,angular-ui-bootstrap,bootstrap-datepicker,Ruby On Rails,Angularjs,Twitter Bootstrap,Angular Ui Bootstrap,Bootstrap Datepicker,我正在使用ruby on rails和AngularJS的Bootstrap UI开发一个web应用程序。已经尝试了一段时间,禁止使用angular datepicker拾取任何周日。基本上,我希望用户可以选择从周一到周六的日期,而不是周日。你有什么建议吗 谢谢 你只需要做如下事情: // Disable sundays $scope.disabled = function(date, mode) { return ( mode === 'day' && ( date.g

我正在使用ruby on rails和AngularJS的Bootstrap UI开发一个web应用程序。已经尝试了一段时间,禁止使用angular datepicker拾取任何周日。基本上,我希望用户可以选择从周一到周六的日期,而不是周日。你有什么建议吗


谢谢

你只需要做如下事情:

// Disable sundays
$scope.disabled = function(date, mode) {
    return ( mode === 'day' && ( date.getDay() === 0) );
};
然后在日期选择器中:

<datepicker ng-model="dt" date-disabled="disabled(date, mode)" />


Dave抢先一步,但下面是我写的一篇文章: