我需要从日期选择器中突出显示一个禁用的日期
我现在拥有的是这样
唯一可用的日子是星期二,所以我想强调一下残疾的日子
这是我的javascript
File "C:\Python36\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 903, in implicitly_wait
'ms': float(time_to_wait) * 1000})
File "C:\Python36\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 320, in execute
self.error_handler.check_response(response)
File "C:\Python36\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 242, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: Object reference not set to an instance of an object.
Stacktrace:
at Quamotion.WebDriver.Controllers.SessionController+<SetImplicitWaitTimeout>d__42.MoveNext (<anonymous>)
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw (<anonymous>)
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (<anonymous>)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (<anonymous>)
at lambda_method (<anonymous>)
at Microsoft.Extensions.Internal.ObjectMethodExecutorAwaitable+Awaiter.GetResult (<anonymous>)
at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor+AwaitableResultExecutor+<Execute>d__0.MoveNext (<anonymous>)
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw (<anonymous>)
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (<anonymous>)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (<anonymous>)
at System.Threading.Tasks.ValueTask`1.get_Result (<anonymous>)
at System.Runtime.CompilerServices.ValueTaskAwaiter`1.GetResult (<anonymous>)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker+<<InvokeActionMethodAsync>g__Awaited|12_0>d.MoveNext (<anonymous>)
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw (<anonymous>)
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (<anonymous>)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (<anonymous>)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker+<<InvokeNextActionFilterAsync>g__Awaited|10_0>d.MoveNext (<anonymous>)
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw (<anonymous>)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow (<anonymous>)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next (<anonymous>)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeInnerFilterAsync (<anonymous>)
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw (<anonymous>)
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (<anonymous>)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (<anonymous>)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker+<<InvokeNextExceptionFilterAsync>g__Awaited|25_0>d.MoveNext (<anonymous>)
我该怎么做?
答案 0 :(得分:0)
使用jQuery UI,您可以将主题与CSS结合使用。请考虑以下示例。
$(function() {
$("#datepicker").datepicker({
beforeShowDay: function(dt) {
if (dt.getDay() == 2) {
return [true, ""];
} else {
return [false, ""];
}
}
});
});
.ui-datepicker-calendar .ui-datepicker-unselectable span {
background-color: yellow;
}
<link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
<script src="https://code.jquery.com/jquery-1.12.4.js"></script>
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
Date:
<div id="datepicker"></div>