# Availability on AppointmentCalendar class

**URL:** https://forum.kirupa.com/t/availability-on-appointmentcalendar-class/300636
**Category:** programming
**Created:** [November 24, 2009, 10:47pm UTC](https://forum.kirupa.com/t/availability-on-appointmentcalendar-class/300636 "2009-11-24T22:47:05Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![imagined](https://avatars.discourse-cdn.com/v4/letter/i/a87d85/32.png) [@imagined](https://forum.kirupa.com/u/imagined)
#### Post date: [November 24, 2009, 10:47pm UTC](https://forum.kirupa.com/t/availability-on-appointmentcalendar-class/300636/1 "2009-11-24T22:47:05Z")

</div>

I’m setting up with class with availability dates and times. So if there is a date and time that the user is unavailable, it won’t be possible to make an appointment during that period.

The user should be able to set specific dates and times he won’t be available, on times he had previously set to be available. For example, let say he’s available every Monday from 8am-5pm, but there is this specific Monday he won’t be, so he enters that specific date and it has precedence over the Availability. So for that I setup the following table:

Unavailability table with the following fields  
[LIST]  
[_]id int not null auto\_increment primary key  
[_]userid int not null  
[_]UnavailableStartDateTime datetime not null  
[_]UnavailableEndDateTime datetime not null  
[/LIST]

The user should be able to set normal schedules available dates and times. The user should be able to set something like  
Available Every Monday from 8am - 5pm  
Available Every Tuesday from 9am - 6pm  
Available Every Wednesday from 8am - 12pm

So I setup the the Availability table with the following fields  
[LIST]id int not null auto\_increment primary key  
[_]userid int not null  
[_]AvailableDay text (to enter Monday or Tuesday)  
[_]AvailableTimeStart time  
[_]AvailableTimeEnd time  
[/LIST]

Any suggestions?
