LoginSignup
4
5

More than 5 years have passed since last update.

Rails(Ruby)で日付の重複をチェックする

Posted at

スケジュールの管理システムなどで、登録したスケジュールが既に
登録した日付が重複していないかチェックして何か処理を行う場合があると思います。
そんな対応を今日やったので、まとめてみようと思います。

重複をチェックする条件式

日付の重複チェックには定石があるそうです。

(開始時間1 < 終了時間2) && (終了時間1 > 開始時間2)
4
5
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
5