开发者

Reservation/booking system dayview, issues with time granularity

I'm developing a room booking application in the browser using JQuery-Mobile. Initially I had modelled my bookings as records with a timestamp and field with duration.

Now I'm having issues on how to actually show this information in HTML if I have a table/divs each representing 15min of a day. Essentially the book开发者_开发技巧ings can be at any time, but in my view I have divided the day up in 15min intervals.

How do I get past this inconsistency?


"How do I get past this inconsistency?"

Eliminate it.

After all, it's you who created the "inconsistency" in the first place, no ?

Either the business rules are really that rooms must be booked on 15-min boundaries, and then your UI design is OK but your database design is not, or else the business rules are really that rooms can be booked for just any microsecond period, and then your UI design is in denial of the business rules because it does not allow the user to specify something that the business rules say should be possible.


+1 to Erwin (I can't actually do it because I'm not registered).

It's typical in calendaring apps to create a table to hold the days so you can left join onto your calendar table by date and have a row for the days that have nothing scheduled in the calendar. You could so something analogous and populate a table with rows where each row represents a 15-minute chunk of the day (assuming, of course, 15-minutes is your booking chunk). You could number these "timeslot" rows from 1 to 96, and book the rooms by timeslot which eliminates all of the time-boundary calculations and will make your effort a lot simpler.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜