ckroon
Posts: 869
|
| Posted: 06/11/2008, 5:58 PM |
|
Hi All.
I am about to embark on a component that allows users to set weekly "office hours"
I need to set it up so that when they look at their personal event calendar, those days and times show up as Office Hours, every month.
I saw Mentecky's post regarding recurring events but that seemed too complicated for this purpose.
Does anyone have any suggestions on how to set up the table?
_________________
Walter Kempees...you are dearly missed. |
 |
 |
mentecky
Posts: 321
|
| Posted: 06/11/2008, 6:06 PM |
|
ckroon,
It may seem complicated, but check out part II of that thread at http://forums.yessoftware.com/posts.php?post_id=97419
The complication in viewing is well worth the ease of editting.
Let me know if you need help with it.
Rick
_________________
http://www.ccselite.com |
 |
 |
ckroon
Posts: 869
|
| Posted: 06/11/2008, 8:34 PM |
|
Ok!
I followed the instructions and got the calendar page to show up with no errors
(you may want to add that you rename the calendar component to 'chat_rooms' )
I have two chat_room records a type 10 and a type 3... but nothing is showing in the calendar.
MonthDate, DayOf Week and DayNumber are formatted with DBFormat: yyyy-mm-dd and the default Format.
EventTime label is DBFormat: HH:nn:ss.S
That format works for date fields in all the other components in this project.
The default dates are set correctly as well.
Any ideas?
_________________
Walter Kempees...you are dearly missed. |
 |
 |
mentecky
Posts: 321
|
| Posted: 06/12/2008, 12:20 PM |
|
ckroon,
I had to change formats on the calendar and time label.
On my calendar control I set "Time DB Format" to "HH:nn:ss". I had to manually type that in because it's not in the dropdown.
On the time label I set "Format" to "h:nn AM/PM" and "DB Format" to "HH:nn:ss" Also manually typed.
Then it worked fine for me.
Rick
_________________
http://www.ccselite.com |
 |
 |
ckroon
Posts: 869
|
| Posted: 06/12/2008, 6:03 PM |
|
Made the changes.. still no go.
Empty calendar.
When I preview the data in the SQL builder.. it shows up perfect.. just not displaying in the calendar.
_________________
Walter Kempees...you are dearly missed. |
 |
 |
mentecky
Posts: 321
|
| Posted: 06/13/2008, 4:27 AM |
|
Sounds like something in the building of the SQL statement may be broken. In the event where we build the SQL statement, temporarily add this code after all the "SQL .=" statements. Then go to your page and paste the result in a message here. I'll try to help you sort out what is wrong.
echo $SQL;
exit;
Rick
_________________
http://www.ccselite.com |
 |
 |
ckroon
Posts: 869
|
| Posted: 06/13/2008, 5:14 PM |
|
Quote :SELECT chat_rooms.*, chat_types.chat_type AS chat_types_desc, e.chat_date as chat_date FROM chat_rooms INNER JOIN chat_types ON chat_rooms.chat_type = chat_types.chat_type_id, (SELECT chat_date FROM ( SELECT DATE('2008-06-01') as chat_date UNION SELECT DATE('2008-06-02') as chat_date UNION SELECT DATE('2008-06-03') as chat_date UNION SELECT DATE('2008-06-04') as chat_date UNION SELECT DATE('2008-06-05') as chat_date UNION SELECT DATE('2008-06-06') as chat_date UNION SELECT DATE('2008-06-07') as chat_date UNION SELECT DATE('2008-06-08') as chat_date UNION SELECT DATE('2008-06-09') as chat_date UNION SELECT DATE('2008-06-10') as chat_date UNION SELECT DATE('2008-06-11') as chat_date UNION SELECT DATE('2008-06-12') as chat_date UNION SELECT DATE('2008-06-13') as chat_date UNION SELECT DATE('2008-06-14') as chat_date UNION SELECT DATE('2008-06-15') as chat_date UNION SELECT DATE('2008-06-16') as chat_date UNION SELECT DATE('2008-06-17') as chat_date UNION SELECT DATE('2008-06-18') as chat_date UNION SELECT DATE('2008-06-19') as chat_date UNION SELECT DATE('2008-06-20') as chat_date UNION SELECT DATE('2008-06-21') as chat_date UNION SELECT DATE('2008-06-22') as chat_date UNION SELECT DATE('2008-06-23') as chat_date UNION SELECT DATE('2008-06-24') as chat_date UNION SELECT DATE('2008-06-25') as chat_date UNION SELECT DATE('2008-06-26') as chat_date UNION SELECT DATE('2008-06-27') as chat_date UNION SELECT DATE('2008-06-28') as chat_date UNION SELECT DATE('2008-06-29') as chat_date UNION SELECT DATE('2008-06-30') as chat_date UNION SELECT DATE('2008-07-01') as chat_date UNION SELECT DATE('2008-07-02') as chat_date UNION SELECT DATE('2008-07-03') as chat_date UNION SELECT DATE('2008-07-04') as chat_date UNION SELECT DATE('2008-07-05') as chat_date ) d) e WHERE chat_rooms.chat_start_date <= e.chat_date AND chat_rooms.chat_end_date >= e.chat_date AND ((( chat_types.chat_type_id = 11 OR chat_types.chat_type_id = 10 )) OR ( chat_types.chat_type_id = 9 AND ( 1 = DAYOFWEEK(e.chat_date) OR 7 = DAYOFWEEK(e.chat_date) )) OR ( chat_types.chat_type_id = 8 AND 1 <> DAYOFWEEK(e.chat_date) AND 7 <> DAYOFWEEK(e.chat_date) ) OR chat_types.chat_type_id = DAYOFWEEK(e.chat_date) ) ORDER BY chat_date, chat_start
_________________
Walter Kempees...you are dearly missed. |
 |
 |
mentecky
Posts: 321
|
| Posted: 06/16/2008, 10:14 AM |
|
Hey ckroon!
Sorry I haven't been able to answer as quickly as usual. It's been one of those weeks.
I checked your SQL and it's perfect, so no need to mess with that. I assume there's a date/time format wrong somewhere.
On my Calendar Control I have the following set:
Name: chat_rooms
Data Source:SQL
Data Field: chat_date
Date DB Format: yyyy-mm-dd HH:nn:ss
Time Field: chat_start
Time DB Format: HH:nn:ss
On my event_time label I have:
Control Source: chat_start
Data Type: Date
Format: h:nn AM/PM
DB Format: HH:nn:ss
Also make sure you have the chat_types table set up and populated. We use a union so if the types don't match you won't get data.
Rick
_________________
http://www.ccselite.com |
 |
 |