I was working on a project where client wants to show list of holidays from start date to end date.Client was having multiple sub businesses running under one root.So, each department was having different list of holidays.
Whenever there is a holiday calendar should display its Name for which is called off-or-holiday on same day.By clicking on that event it should redirect to some other page whereby client can edit or add same holiday as per need.
So first of we need to create some basic sql to keep it going.Based on my table structure i had created simple query as below.
WITH D1 AS
(SELECT cal_event_id,
cal_start_date AS firstdate,
cal_end_date AS lastdate
FROM cal_event)
SELECT u.name,c.cal_start_date,u.cal_event_id
FROM cal_event u,
(SELECT
firstdate + LEVEL - 1 cal_start_date
FROM D1
CONNECT BY firstdate + LEVEL - 1 <= lastdate) c
WHERE c.cal_start_date BETWEEN u.cal_start_date AND u.cal_end_date
Now, it's time to add calendar region in page. Create a calendar based on above query if you want you can add a Link to a event and it will redirect to a specific page as i did in my demo page.
Thats it now you can see Events from star date to end date. :)
Demo : test/test
Calendar Events for hoildays
Twitter:
Pranav
Whenever there is a holiday calendar should display its Name for which is called off-or-holiday on same day.By clicking on that event it should redirect to some other page whereby client can edit or add same holiday as per need.
So first of we need to create some basic sql to keep it going.Based on my table structure i had created simple query as below.
WITH D1 AS
(SELECT cal_event_id,
cal_start_date AS firstdate,
cal_end_date AS lastdate
FROM cal_event)
SELECT u.name,c.cal_start_date,u.cal_event_id
FROM cal_event u,
(SELECT
firstdate + LEVEL - 1 cal_start_date
FROM D1
CONNECT BY firstdate + LEVEL - 1 <= lastdate) c
WHERE c.cal_start_date BETWEEN u.cal_start_date AND u.cal_end_date
Now, it's time to add calendar region in page. Create a calendar based on above query if you want you can add a Link to a event and it will redirect to a specific page as i did in my demo page.
Thats it now you can see Events from star date to end date. :)
Demo : test/test
Calendar Events for hoildays
Twitter:
Pranav