SuzukiTakamasa / Casaparo

0 stars 0 forks source link

Schedule画面で、年、月を跨いで予定を登録できるようにする #22

Closed SuzukiTakamasa closed 5 months ago

SuzukiTakamasa commented 5 months ago

scgedulesテーブルに以下のカラムを追加する

fromYear
toYear
fromMonth
toMonth
SuzukiTakamasa commented 5 months ago

現行のロジック (schedule.year === year && schedule.month === month && schedule.from_date <= day && schedule.to_date >= day) &&

変更後のロジック const isDisplayed = () => { //関数の中身 }

SuzukiTakamasa commented 5 months ago

現行のschedule表示ロジック (schedule.year === year && schedule.month === month && schedule.from_date <= day && schedule.to_date >= day) &&

変更後のschedule表示ロジック ((schedule.from_year <= year && schedule.to_year >= year) && (schedule.from_year === schedule.to_year ? schedule.from_month <= month && schedule.to_month >= month : schedule.from_month <= 12 && schedule.to_month >= 1) && (schedule.from_month === schedule.to_month ? schedule.from_date <= day && schedule.to_date >= day : schedule.from_month <= numerOfDate && schedule.to_month >= 1) &&

SuzukiTakamasa commented 5 months ago

from、toのバリデーション disabled={fromYear > toYear} disabled={fromYear === toYear && fromMonth > toMonth} disabled={fromYear === toYear && fromMonth === toMonth && fromDate > toDate}

SuzukiTakamasa commented 5 months ago

フロントエンド、バックエンドそれぞれにバリデーションを実装する

SuzukiTakamasa commented 5 months ago

対応済み