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'], |