开发者

Displaying Calendar in Hourly format inside a Table tag

I have a database holding events in the form of a start_time and an end_time which are timestamps. I am trying to make a calendar that has 2开发者_Python百科4 rows, and 7 columns.

A normal calendar would be easier for me to create because my SQL results would be in order of lowest to highest.

I am not quite sure how I would run through my SQL table, and display hourly for each day to make the html work

i.e:

12:00am | m | t | w | t | f | s | s

Any information at all on the best way to do this would be appreciated.


You should convert your timestamps into epoch seconds. Then obtain length of event in seconds by end_time-start_time

Depending on the height of your 24-row table, each second (or 60 seconds) would correspond to some count of pixels.

You can create floating divs of the appropriate height using this math. Only problem may arise if an event goes overnight onto the next day.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜