Comparing Time Periods or Date Ranges with SQL
TL;DR
SELECT * FROM periods
WHERE range_start <= @check_period_end
AND range_end >= @check_period_start
The opposite:
/** @var \Illuminate\Log\Writer $log */ | |
$log = App::make('log'); | |
DB::listen(function ($sql, $bindings, $time) use ($log) { | |
if ( ! starts_with($sql, 'select')) | |
return; | |
// only log long running select statements | |
if ($time <= 1) |
Comparing Time Periods or Date Ranges with SQL
TL;DR
SELECT * FROM periods
WHERE range_start <= @check_period_end
AND range_end >= @check_period_start
The opposite:
<template> | |
<div class="date-picker"> | |
Month: <input type="number" ref="monthPicker" :value="value.month" @input="updateDate()"/> | |
Year: <input type="number" ref="yearPicker" :value="value.year" @input="updateDate()"/> | |
</div> | |
</template> | |
<script> | |
export default { | |
props: ['value'], |
<?php | |
declare(strict_types=1); | |
namespace App\Providers; | |
use Illuminate\Database\Eloquent\Model; | |
use Illuminate\Support\Facades\DB; | |
use Illuminate\Support\Facades\URL; | |
use Illuminate\Support\Facades\Vite; |
{ | |
"$schema": "https://getcomposer.org/schema.json", | |
"name": "laravel/laravel", | |
"type": "project", | |
"description": "The skeleton application for the Laravel framework.", | |
"keywords": ["laravel", "framework"], | |
"license": "MIT", | |
"require": { | |
"php": "^8.2", | |
"laravel/framework": "^11.31", |