我想将weekendDays更改为在我的碳实例中只包含Sunday。我怎么能这么做?
发布于 2017-11-18 15:08:11
运行:
Carbon::setWeekendDays([Carbon::SUNDAY]);在App\Providers\AppServiceProvider中的引导函数中。
编辑:
setWeekendDays被否决了。使用宏代替。
Carbon::macro('isDayOff', function ($date) {
return $date->isSunday();
});
$isDayOff = $carbon_inst->isDayOff(): bool;https://stackoverflow.com/questions/47367323
复制相似问题