Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Creating a calendar form

Status
Not open for further replies.

tommeekers

Programmer
Sep 10, 2003
77
0
0
BE
Hi,

I need a little help creating a calender system which I can use to determine the "working hours" for my company for the next year.

For example: I wanna set the default working hours from 8am to 5pm, monday till friday. Then I want to set the 24th and 25th of may as days off. I also wanna set the holiday from the 1ste of july till the 25th. And finally I wanna add a few days in the year where we would only work till 1pm instead of 5pm.

What would be the best way to make a form for this kind of input ? I'm guessing a calendar would be easy.
Also how would I store all of this in a database ? Create a record for every day ? Create only records for the "exceptions" (holidays, shorter days, ...) ?

Any help and/or examples would be greatly appreciated. :)
 
Just a suggestion as I have never done a calendar application like what you are asking for. But I'm assuming you are working more from the stand point of having a system to assist with payroll and scheduling (Doctor or Dentist office?).
Therefore, I would have several tables:
1. tblCalendarDefaults, that would hold all the default information: StartTime, EndTime, etc.
2. tblDaysOff would have a field to show what kind of day off this is (Holiday, OfficeClosed, MentalHealth, etc.). Then, just list what dates will be a day off. This date will include month, day, and year.
3. tblShortHours to hold the short hours and dates for the short hours.

As you can see, I'm taking the "exception" route here. If you want to put up a form to display one month, that would show which days are a day off, a normal work day, a day with shortened hours, I would suggest creating a form with six (6) rows of seven (7) columns. Within each one of these squares (42 squares = 6 rows x 7 columns) I would have a square field that I could change the background color on, then in the upper right (or left) hand corner of this background field, I would have a field for the day of the month. I might have two background fields rather than just one, so that on the days with shortened hours, I could darken the bottom half of the square, leaving the top half white. On the days where the office is closed for the whole day, I would darken both of the background fields. I would change the text color of the day of the month to white if the office is closed that day, so the date would show up better on the darkened background.

Hope this is not too complicated. I'm mostly just trying to do a little brain-storming to give you some ideas to spark some in you too.

Vic
 
a bit of brian storming has (obviously?) already been done, even here (In Tek-Tips) a reasonably succinct bit of advice would be to use search with soe reasonable set(s) of keywords (e.g. [Calendar | Month | Day | Date | Year | et al]. For some inkling on data structure / storage of dates with attributes, see faq 181-261. It does not deal with the calendar in the manner you desire at all, however the companion table use for the holidays enumeration is quite a bit of the how to set up the storage of exceptions.




MichaelRed


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top