Fixed a bug which can potentially happen if you select the appointment
when the appointment is longer than an hour.