zanizde thanks!
It helped me a lot. It didn’t solve it completely though, because it only allows the opening hours to be saved when the open hour is during the day and the closing time is during the night. I was configuring a site for a bar which closes before midnight on sundays, so the sunday time didn’t get saved.
I solved this by changing your last line from
return ( $this->start > $this->end );
To this
return ( $this->start > $this->end ) || ( $this->start < $this->end );
I’m not a php developer so this might create some bugs but it works so far.