Skip to main content
Email Password   helpLost your password?

Day view screenshot

Sample Image

Week view screenshot

Features

DayPilot is an Outlook-like open-source event calendar/scheduling control:

Getting started

The only required step to make DayPilot working is to bind it to a data source. It supports DataTable (and DataSet) as a data source so you can easily supply the data from your database.

Let's have a following table:

ID Name Start End
1 Lunch 2006-06-01 12:00:00 2006-06-01 12:30:00
2 Dinner 2006-06-01 19:00:00 2006-06-01 21:00:00
3 Sleep 2006-06-01 22:00:00 2006-06-02 07:00:00
4 Breakfest 2006-06-02 07:30:00 2006-06-02 08:30:00

In order to show the events in DayPilot calendar you have to do the following steps:

  1. Place the DayPilot control on a WebForm.
  2. Set the DataSource property.
  3. Set column name properties.
  4. Select the days that will be shown.
  5. Call DataBind().

Setting the DataSource property

After loading a DataTable from a database (or other source) you should assign it to the DayPilotCalendar.DataSource property:

DayPilotCalendar1.DataSource = MyDataTable;

In our example we are building the DataTable by hand:

DataTable dt;
dt= new DataTable();
dt.Columns.Add("start", typeof(DateTime));
dt.Columns.Add("end", typeof(DateTime));
dt.Columns.Add("name", typeof(string));
dt.Columns.Add("id", typeof(string));
    
DataRow dr;

dr = dt.NewRow();
dr["id"] = 0;
dr["start"] = Convert.ToDateTime("15:30").AddDays(1);
dr["end"] = Convert.ToDateTime("16:30").AddDays(1);
dr["name"] = "Partner conf. call";
dt.Rows.Add(dr);

// ...

return dt;

When loading the events from a database I recommend limiting the SELECT so only the necessary events are loaded (not all events from the table). DayPilot will work properly in both cases (it only select the relevant events) but all the events will have to be loaded and they will be stored in the ViewState.

Setting column name properties

You need to indicate which columns contain the necessary data:

DayPilotCalendar1.DataStartField = "Start";
DayPilotCalendar1.DataEndField = "End";
DayPilotCalendar1.DataTextField = "Name";
DayPilotCalendar1.DataValueField = "ID";

Setting the visible dates

Let's say we want to show just a single day:

DayPilotCalendar1.StartDate = Convert.ToDateTime("1 June 2006"); 
DayPilotCalendar1.Days = 1; // default (not necessary) 

But we can show multiple days as well. This is a new feature of DayPilot 2.0.

DayPilotCalendar1.StartDate = Convert.ToDateTime("1 June 2006"); 
DayPilotCalendar1.Days = 5;

Example:

Data binding

Bind the data in the Page_Load() method:

if (!IsPostBack)
    DataBind();

Data-related properties overview

Here are the data-related properties of DayPilotCalendar:

Property Description Type Default value
DataSource Source of event data. DataSource or DataTable null
DataStartField Name of the data source column that contains the event start date and time. string null
DataEndField Name of the data source column that contains the event end date and time. string null
DataTextField Name of the data source column that contains the event name. string null
DataValueField Name of the data source column that contains the event ID. The Id will be passed to the event handling code when clicking on the event. string null
StartDate The first date that should be shown by the calendar. DateTime DateTime.Today
Days The number of days that should be rendered. integer 1

Integration with System.Web.UI.WebControls.Calendar

For switching the date you can use the standard .NET Framework control System.Web.UI.WebControls.Calendar. You can use the PostBack event to change the DayPilot StartDate and EndDate.

In our sample we will use the DayRender event to improve the calendar:

private void Calendar1_DayRender(object sender, System.Web.UI.WebControls.DayRenderEventArgs e)
{
    string fontWeight = "normal";
    if (isThereEvent(e.Day.Date))
        fontWeight = "bold";

    string color = "black";
    if (e.Day.IsOtherMonth)
        color = this.Calendar1.OtherMonthDayStyle.ForeColor.Name;

    e.Cell.Text = String.Format("<a href='Default.aspx?day={0:d}' style='color: " 
        + color + ";text-decoration:none; font-weight:" 
        + fontWeight + "'>{1}</a>", e.Day.Date, e.Day.Date.Day);        
}

The method isThereEvent() returns true if a specific day contains any event. This method will be specific to your application. You can go through the data returned from the database (and supplied to DayPilotCalendar.DataSource) to avoid another database request. We are not using the database in our sample so it is hard-coded:

private bool isThereEvent(DateTime date)
{
    DateTime today = DateTime.Now;
    DateTime tomorrow = today.AddDays(1);
    DateTime anotherDay = today.AddDays(3);

    // there are events today
    if ((date.DayOfYear == today.DayOfYear) && (date.Year == today.Year))
        return true;

    // there are events tomorrow
    if ((date.DayOfYear == tomorrow.DayOfYear) && (date.Year == tomorrow.Year))
        return true;

    // there are events on another day
    if ((date.DayOfYear == anotherDay.DayOfYear) && (date.Year == anotherDay.Year))
        return true;

    return false;
}

Integration using UpdatePanel

Since version 2.3 DayPilot can be used inside UpdatePanel (ASP.NET AJAX Extensions/.NET Framework 3.5). If you place both the Calendar (System.Web.UI.WebControls.Calendar) and DayPilotCalendar inside the same UpdatePanel you can switch the date using Calendar.SelectionChanged event handler. It can be used like a regular PostBack event:

    protected void Calendar1_SelectionChanged(object sender, EventArgs e)
    {
        DayPilotCalendar1.StartDate = Calendar1.SelectedDate;
        DayPilotCalendar1.DataBind();
    } 

Changing the appearance

There are many options to change the default appearance:

Property Description Type Default value
HourHeight Hour height in pixels. Minimum is 30. It must be even. int 40
HourWidth Width of the hour name in pixels. int 40
BusinessBeginsHour Hour when the business hours start. int 9
BusinessEndsHour Hour when the business hours end. int 18
NonBusinessHours Determines whether the non-business hours should be visible (if there is no event). NonBusinessHoursBehavior NonBusinessHoursBehavior.HideIfPossible
ShowHours Determines whether the hour names column should be visible. bool true
TimeFormat The time format - 12-hours cycle (3 PM) or 24-hours cycle (15:00). TimeFormat TimeFormat.Clock24Hours
Width Width of the control. Can be in pixels or in percent (like <table> width attribute). string "100%"

Appearance examples

Default appearance

24 hours

2 days, 12-hours time format

Working week

Handling user actions

There are two types of user actions:

The actions can be handled on the client (by custom JavaScript code) or on the server (by handling the server event).

Property Description Type Default value
EventClickHandling Handling of a click on a calendar event. UserActionHandling UserActionHandling.JavaScript
FreetimeClickHandling Handling of a click on a free-time slot. UserActionHandling UserActionHandling.JavaScript
JavaScriptEventAction JavaScript code that should be executed when the user clicks on a calendar event (provided that EventClickHandling is set to JavaScript). The string "{0}" will be replaced with an event ID. string "alert('{0}');"
JavaScriptEventAction JavaScript code that should be executed when the user clicks on a free-time slot (provided that FreetimeClickHandling is set to JavaScript). The string "{0}" will be replaced with the date and time specified in the standard format produced by DateTime.ToString("s") - e.g. "2006-05-15T07:00:00". string "alert('{0}');"

Server-side event handling

Event Description
EventClick Occurs when the user clicks on an event and EventClickHandling property is set to UserActionHandling.PostBack.
FreeTimeClick Occurs when the user clicks on an event and FreetimeClickHandling property is set to UserActionHandling.PostBack.

Your server-side event handling methods will get the important data:

EventClick knows the primary key (PK column)

private void DayPilotCalendar1_EventClick(object sender, EventClickEventArgs e)
{
    Label1.Text = "Selected event: " + e.Value;
}

FreeTimeClick knows the time clicked

private void DayPilotCalendar1_FreeTimeClick(object sender, FreeClickEventArgs e)
{
    Label1.Text = "Selected time: " + e.Start;
}

Resources

History

You must Sign In to use this message board.
 
 
Per page   
 FirstPrevNext
NewsSource code available online
Gilad Khen
17:40 30 May '09  
Here[^]
Sign In·View Thread·PermaLink
GeneralEnable a Specific cell as a Free Time and Disable other cells who are not
Hassan Akhtar Ali
20:41 16 Nov '08  
Hello hope u all having a good time, well
i have a sinceario of implementing a webschedular
the requirment is i have 3 tables

Tutor Working hours(Master)
PK_ID TutorID CourseID StartingDateID

This is table is meant by
A teacher can teach a course on a specific starting date marked by the univ

DetailTutorWorking Hours (Detail)
PK_ID FK_ID(PK_ID) StartTime EndTime DayofWeek
This is the detail table where a tutor can mark its free working hourse now like if i can say :

David(TutorID) teaches CCNA(COurseID) that starts on 3 Nov(StartingDateID)
and he marks his available time on 12:00pm(start time) to 1:00pm(end time) on monday and tuesday

now within this interval the student is available and can mark his appointment if the working hour is free he can save his appointment, if it is taken by some one else it is un editable, if it is already his saved then he can edit it, please suggest me what can i do to achieve this, please help me saving my job as i m in very much big depression now days i shall be very very gratefull to you,, regards

Hassan Akhtar

Sign In·View Thread·PermaLink
GeneralAwesome
merlin981
12:49 19 May '08  
This is great! Thank you very much. 5 from me



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Rhabot - World of Warcraft Bot
Uber RPGE - Free Private World of Warcraft Server
Make long URLs short with NeatURL.net
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Sign In·View Thread·PermaLink
GeneralEvent spanning on more than a day ?
cardigait
4:43 6 Jun '07  
Wonderful product and thinking to pick the pro solution.
I'm thinking to insert the events in other existing pages (with recurring events and so on) and to use it for the superb visaulization.
I just can't see any sample of events spanning on more than a day, maybe [hope] acting like outlook do ?

Any detail or link to sample given is appreciated,
Fabrizio
Sign In·View Thread·PermaLink
GeneralRe: Event spanning on more than a day ?
Dan Letecky
4:56 6 Jun '07  
Thanks. Wink

The events longer than a day are shown as "event parts" in each day. E.g. event lasting from Thursday 20:00 to Saturday 05:00 will have three pieces: Thursday 20:00 - Thursday 24:00, Friday 00:00 - Friday 24:00, and Saturday 00:00 - 05:00. See "Event 6" on this sample page: http://www.daypilot.org/demo/Horizontal/.

Outlook shows such events in the "All day events" area on the top of the calendar and marks the duration using a blue line on the left side of a day column. DayPilot is making such event more visible.

It's always possible to discuss the features on the roadmap - contact me at daypilot @ annpoint.com if you have any specific requirements Wink.



--
My open-source ASP.NET 2.0 controls:
DayPilot - Outlook-like calendar/scheduling control
MenuPilot - Hover context menu

Sign In·View Thread·PermaLink
QuestionJust reviewed the daypilot
ambshah
4:32 4 May '07  
hi Dan
great component i was just reviewing the code and the workings

Some suggestions
1) when we have non business hours it becomes really long
maybe a two hour box would help shorten it
2) i use a seven day at a glance view
from selected date -3 to seven days ahead
maybe an option to highlight a particular date (informing the user which date he has selected)

Thanks again for your efforts on this control.
viva la opensource!

http://www.chowknews.com
Sign In·View Thread·PermaLink
AnswerRe: Just reviewed the daypilot
Dan Letecky
5:21 11 May '07  
Hi,

Thanks for the nice ideas! I will consider them for the next release.

--
My open-source ASP.NET 2.0 controls:
DayPilot - Outlook-like calendar/scheduling control
MenuPilot - Hover context menu

Sign In·View Thread·PermaLink
QuestionDates on X Axis and Tasks on Y Axis
rk33
10:12 20 Jan '07  
This is great.
But what i was looking is just the dates for tasks and not time....
At this point due to overlapping days every event overlaps on the calendar making it unreadable.
Basically, along the Y Axis i would like to see the event wise grouping as opposed to time..
Is that Possible?
Can u plz help btw I am using ASP.NET 1.1
Sign In·View Thread·PermaLink
AnswerRe: Dates on X Axis and Tasks on Y Axis
Dan Letecky
4:08 19 Mar '07  
Yes, that would be useful but it would also mean writing a completely new control Smile.


--
My sites for smart .NET developers:
DayPilot - Open-source Outlook-like calendar control for ASP.NET
DotLucene - The fastest open source fulltext search engine for .NET
MenuPilot - Open-source task menu for ASP.NET 2.0
Seekafile Server - Flexible open-source search server
DotNetFirebird

Sign In·View Thread·PermaLink
GeneralRe: Dates on X Axis and Tasks on Y Axis
Dan Letecky
22:34 7 Aug '07  
This is now possible with DayPilotVertical and DayPilotScheduler controls. But these are only available in the commercial version of DayPilot.

--
My open-source ASP.NET 2.0 controls:
DayPilot - Outlook-like calendar/scheduling control
MenuPilot - Hover context menu

Sign In·View Thread·PermaLink
GeneralA simple change to make free time freely available...
Forogar
13:08 4 Jan '07  
Clicking on free time entirely covered by an event doesn't seem to be currently possible.
In Outlook there is a thin gap at the right of each event box where is it possible to get at the time slot behind the event. This can be achieved with the following one-line code change in the renderEvent method (within DayPilotCalendar.cs) where it has the line:

divMain.AddStyleAttribute("width", e.Column.WidthPct + "%");

...replace this with the following:

divMain.AddStyleAttribute("width", (e.Column.WidthPct - 3) + "%");

...and you will have a small gap to the right of each event box big enough to click in to select a free time.

You may want to use -2 or -4 instead of -3 but I think that gives the best gap balanced for real-estate usage versus click-ability - and looks about the same as the gap in my version of Outlook.


Life in the fast lane is only fun if you live in a country with no speed limits.

Sign In·View Thread·PermaLink
GeneralRe: A simple change to make free time freely available...
Dan Letecky
4:01 19 Mar '07  
Thanks for a good tip!

--
My sites for smart .NET developers:
DayPilot - Open-source Outlook-like calendar control for ASP.NET
DotLucene - The fastest open source fulltext search engine for .NET
MenuPilot - Open-source task menu for ASP.NET 2.0
Seekafile Server - Flexible open-source search server
DotNetFirebird

Sign In·View Thread·PermaLink
QuestionEvents not showing
maryg129
12:48 3 Jan '07  
Hi I followed the 5 steps in the databinding portion of the tutorial on daypilot.org and my events don't appear. I used Visual Web Developer to set data related properties and bind on page_load.Here's my code, do I need additional code to show the events? Thanks.

<%@ Page Language="VB" %>

<%@ Register Assembly="DayPilot" Namespace="DayPilot.Web.Ui" TagPrefix="DayPilot" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<script runat="server">

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
If IsPostBack Then
DataBind()
End If

End Sub

</script>

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>FRC Calendar</title>
</head>
<body>
<form id="form1" runat="server">

<daypilot:daypilotcalendar id="Calendar1" runat="server" backcolor="#FFFFD5"
bordercolor="Black" dataendfield="edate" datasourceid="FRCCalendar" datastartfield="sdate"
datatextfield="EDescr" datavaluefield="Eventid" dayfontfamily="Tahoma" dayfontsize="10pt"
days="3" eventbackcolor="White" eventbordercolor="Black" eventfontfamily="Tahoma"
eventfontsize="8pt" eventhovercolor="Gainsboro" eventleftbarcolor="Blue" hourbordercolor="#EAD098"
hourfontfamily="Tahoma" hourfontsize="16pt" hourhalfbordercolor="#F3E4B1" hournamebackcolor="#ECE9D8"
hournamebordercolor="#ACA899" hovercolor="#FFED95" nonbusinessbackcolor="#FFF4BC"
startdate="2007-01-03" style="position: static">
<asp:AccessDataSource ID="FRCCalendar" runat="server" DataFile="~/App_Data/frccalendar.mdb"
SelectCommand="SELECT [Eventid], [sdate], [edate], [stime], [etime], [CategoryID], [EDescr] FROM [qryeventdump] ORDER BY [sdate]">



</form>
</body>
</html>


MaryFRC

Sign In·View Thread·PermaLink
AnswerRe: Events not showing
Dan Letecky
4:01 19 Mar '07  
If there are no events visible you should check whether DayPilotCalendar.StartDate is set to the right date. Check if there are any events returned for 2007-01-03 (see your code) by your select command.

Moreover, I recommend limiting the number of events in the SELECT command to only the relevant ones (i.e. visible on the calendar). DayPilot will still work correctly but there will be too much stuff in ViewState and it can become slow.

--
My sites for smart .NET developers:
DayPilot - Open-source Outlook-like calendar control for ASP.NET
DotLucene - The fastest open source fulltext search engine for .NET
MenuPilot - Open-source task menu for ASP.NET 2.0
Seekafile Server - Flexible open-source search server
DotNetFirebird

Sign In·View Thread·PermaLink
QuestionLoad event based on Date selection , Need Help
Deepak_DOTNET
23:58 26 Nov '06  
Hi
i am using DayPilot 2.0.1 (.NET Framework 1.1) ,bcoz i cann't use .NET 2.0 in my server right now.

When user change the date using .NET calender,the events corresponding to the selected date should be loaded in outlook
calender(DayPilot control).But that is not happening.i have given all code which i have put in page.IF any thing missing me
please guide me.l what code i need to write to achieve it .plz tell me how to load events of selected date selected by user.if no event is there
for selected date,let it show nothing in outlook calender(DayPilot control).How to achieve it..?

and also how do these events beneficial to users :
clicking a free time
clicking an event

a) When i click on any free time column,a pop message box with date and time will be showed.
-- is it possible to add new event in free time sections from user interface(not from database)...?
b) when i click on any existing event , a pop message box with event id will displayed.
-- is it possible to show the all Event details ("name","start","End" columns values) in small pop up window (instead of pop up message box with event id) ...?
-- i want to open a ssmall window instead of pop up message box.
please help regarding this.

Thank U
Deepak



CODE i have used as below :

table : "tblCalender"

ID Name start End

1 BreakFast 11/20/2006 9:00 AM 11/20/2006 9.30 AM
2 Lunch 11/20/2006 1:00 PM 11/20/2006 1:30 PM
3 Dinner 11/20/2006 9:00 PM 11/20/2006 9:30 PM


<DayPilot:DayPilotCalendar id="DayPilotCalendar1" runat="server" EndColumnName="end" NameColumnName="Name"
BeginColumnName="start" PkColumnName="ID" TimeFormat="Clock12Hours" EndDate="2006-11-24"
StartDate="2006-11-20">

Private Sub CalenderDataBind()
Dim calenderTable As New DataTable
Dim sqlQry As String = "SELECT * FROM tblCalender"
Dim conStr As String = System.Configuration.ConfigurationSettings.AppSettings.Get("supportDB")
Dim sqlAdp As New SqlClient.SqlDataAdapter(sqlQry, conStr)
sqlAdp.Fill(calenderTable)
DayPilotCalendar1.DataSource = calenderTable
DayPilotCalendar1.DataBind()
End Sub

i have .NET calender control

<asp:Calendar id="Calendar1" style="Z-INDEX: 101; LEFT: 448px; POSITION: absolute; TOP: 16px"
runat="server">

IT is very urgent,plz give me soultion
Sign In·View Thread·PermaLink
QuestionLoad event based on Date selection , Need Help
Deepak_DOTNET
23:58 26 Nov '06  
Hi
i am using DayPilot 2.0.1 (.NET Framework 1.1) ,bcoz i cann't use .NET 2.0 in my server right now.

When user change the date using .NET calender,the events corresponding to the selected date should be loaded in outlook
calender(DayPilot control).But that is not happening.i have given all code which i have put in page.IF any thing missing me
please guide me.l what code i need to write to achieve it .plz tell me how to load events of selected date selected by user.if no event is there
for selected date,let it show nothing in outlook calender(DayPilot control).How to achieve it..?

and also how do these events beneficial to users :
clicking a free time
clicking an event

a) When i click on any free time column,a pop message box with date and time will be showed.
-- is it possible to add new event in free time sections from user interface(not from database)...?
b) when i click on any existing event , a pop message box with event id will displayed.
-- is it possible to show the all Event details ("name","start","End" columns values) in small pop up window (instead of pop up message box with event id) ...?
-- i want to open a ssmall window instead of pop up message box.
please help regarding this.

Thank U
Deepak
deepak.ramaiah@vertscape.net


CODE i have used as below :

table : "tblCalender"

ID Name start End

1 BreakFast 11/20/2006 9:00 AM 11/20/2006 9.30 AM
2 Lunch 11/20/2006 1:00 PM 11/20/2006 1:30 PM
3 Dinner 11/20/2006 9:00 PM 11/20/2006 9:30 PM


<DayPilot:DayPilotCalendar id="DayPilotCalendar1" runat="server" EndColumnName="end" NameColumnName="Name"
BeginColumnName="start" PkColumnName="ID" TimeFormat="Clock12Hours" EndDate="2006-11-24"
StartDate="2006-11-20">

Private Sub CalenderDataBind()
Dim calenderTable As New DataTable
Dim sqlQry As String = "SELECT * FROM tblCalender"
Dim conStr As String = System.Configuration.ConfigurationSettings.AppSettings.Get("supportDB")
Dim sqlAdp As New SqlClient.SqlDataAdapter(sqlQry, conStr)
sqlAdp.Fill(calenderTable)
DayPilotCalendar1.DataSource = calenderTable
DayPilotCalendar1.DataBind()
End Sub

i have .NET calender control

<asp:Calendar id="Calendar1" style="Z-INDEX: 101; LEFT: 448px; POSITION: absolute; TOP: 16px"
runat="server">

IT is very urgent,plz give me soultion
Sign In·View Thread·PermaLink
AnswerRe: Load event based on Date selection , Need Help
langdaddy
14:32 28 Jan '07  
To have the DayPilot change for the date


protected void Calendar1_SelectionChanged(object sender, EventArgs e)
{
DayPilotCalendar1.StartDate = Calendar1.SelectedDate;
}


Keith L Lang
Sign In·View Thread·PermaLink
GeneralImplement isThereEvent Method
obinna_eke
4:46 9 Oct '06  
How do you implement the method isThereEvent, I have implemented the getData pls help

private bool isThereEvent(DateTime date)
{
//help me pls
}


protected DataTable getData
{
get
{
DataTable dt;
dt = new DataTable();
dt.Columns.Add("start", typeof(DateTime));
dt.Columns.Add("end", typeof(DateTime));
dt.Columns.Add("name", typeof(string));
dt.Columns.Add("id", typeof(string));
DataRow dr;
DateTime myDate;
string myStrDate = Request.QueryString["day"].ToString();
myDate = Convert.ToDateTime(myStrDate);

Response.Write("
Well we have " + myStrDate);

SqlConnection myConnection = new SqlConnection();
myConnection.ConnectionString = "Data Source=SQL01;Initial Catalog=POMACS;Integrated Security=True";
SqlCommand myCommand = new SqlCommand();

myCommand.Parameters.Add(new SqlParameter("@startDate", SqlDbType.NVarChar,41));
myCommand.Parameters.Add(new SqlParameter("@endDate", SqlDbType.NVarChar,40));
myCommand.Parameters["@startDate"].Value = myStrDate;
myCommand.Parameters["@EndDate"].Value = myStrDate;
myCommand.CommandType = CommandType.StoredProcedure;
myCommand.CommandText = "MyDumbProc";
myConnection.Open();
myCommand.Connection = myConnection;

SqlDataReader myReader = myCommand.ExecuteReader();
try
{
while (myReader.Read())
{
dr = dt.NewRow();
Response.Write("
Start " + myReader["starttime"].ToString());
Response.Write(" End " + myReader["endtime"].ToString());
Response.Write(" Sub " + myReader["subject"].ToString());

dr["start"] = Convert.ToDateTime(myReader["starttime"].ToString());
dr["end"] = Convert.ToDateTime(myReader["endtime"].ToString());
dr["name"] = myReader["subject"].ToString();
dt.Rows.Add(dr);
}
}
catch (System.Exception ex)
{
Response.Write(ex.ToString());
}
finally
{
myReader.Close();
myConnection.Close();
}
return dt;

}

}
Sign In·View Thread·PermaLink
GeneralRe: Implement isThereEvent Method
Dan Letecky
4:04 19 Mar '07  
This is what I have in the sample:

private bool isThereEvent(DateTime date)
{
DateTime today = DateTime.Now;
DateTime tomorrow = today.AddDays(1);
DateTime anotherDay = today.AddDays(3);

// there are events today
if ((date.DayOfYear == today.DayOfYear) && (date.Year == today.Year))
return true;

// there are events tomorrow
if ((date.DayOfYear == tomorrow.DayOfYear) && (date.Year == tomorrow.Year))
return true;

// there are events on another day
if ((date.DayOfYear == anotherDay.DayOfYear) && (date.Year == anotherDay.Year))
return true;

return false;
}


But it's just a quick and dirty solution for my case. You will typically want to load the data from a database (just event counts for each day) and check all the days against this list.

--
My sites for smart .NET developers:
DayPilot - Open-source Outlook-like calendar control for ASP.NET
DotLucene - The fastest open source fulltext search engine for .NET
MenuPilot - Open-source task menu for ASP.NET 2.0
Seekafile Server - Flexible open-source search server
DotNetFirebird

Sign In·View Thread·PermaLink
GeneralRe: Implement isThereEvent Method
Dan Letecky
22:30 7 Aug '07  
Check also this forum thread for a hint on implementing isThereEvent:

http://forums.daypilot.org/Topic.aspx/110/modify_isthereevent_method



--
My open-source ASP.NET 2.0 controls:
DayPilot - Outlook-like calendar/scheduling control
MenuPilot - Hover context menu

Sign In·View Thread·PermaLink
GeneralInteresting..
Spotnick
9:22 4 Jul '06  
It's so easy to use it makes me jealous I didn't think of this when I developped mine.

It would be nice to have a simple feature to configure the colors though, just a suggestion.

Are you planning to do a monthview like Outlook someday? This is actually the one I did.

I will start to play with this one, I hope I'll be able to add small images before tasks and to give a task a color, I guess I'll need to override a few things to do that, but that should be fine. "All day events" would be a really nice addition like other said before.

Congrats!
Sign In·View Thread·PermaLink
GeneralRe: Interesting..
wardeaux
7:40 20 Jul '06  
I would also be interested in the Event/task coloring (assign color to event/task background), all day events, and "Monthview"... any hope of this in the NEAR future?
Sign In·View Thread·PermaLink2.00/5
GeneralRe: Interesting..
Dan Letecky
4:07 19 Mar '07  
I'm now offering an advanced version of DayPilot for money - it's called DayPilot Pro and it has features like this one.

Check here: http://www.daypilot.org/daypilot-pro.html

--
My sites for smart .NET developers:
DayPilot - Open-source Outlook-like calendar control for ASP.NET
DotLucene - The fastest open source fulltext search engine for .NET
MenuPilot - Open-source task menu for ASP.NET 2.0
Seekafile Server - Flexible open-source search server
DotNetFirebird

Sign In·View Thread·PermaLink
GeneralDayPilot 2.0.1 released
Dan Letecky
4:00 23 Jun '06  
This is a bugfix release. Read more in the release notes.

You can go directly to the download.

--
My sites for smart .NET developers:
DayPilot - Open-source Outlook-like calendar control for ASP.NET
DotLucene - The fastest open source fulltext search engine for .NET
Seekafile Server - Flexible open-source search server
DotNetFirebird - Using Firebird SQL in .NET

Sign In·View Thread·PermaLink
GeneralFrom Almost 1 To 5
Bassam Abdul-Baki
4:11 13 Jun '06  
I was almost ready to give up on this since I couldn't get it to work out of the box. Actually, this is the only application of yours that I got to work. The index server search engine wouldn't work no matter what I tried. For this one, I realized I had to change the ASP .NET version in IIS from 1.4 to 2.0, and that finally got it to work. Didn't read the article to see if it was mentioned. Red faced Great job. One request, will you be adding a way to add daily, weekly or any repeating events? Also, all day events need to appear at the top. If you could add that functionality it would be great.


There are II kinds of people in the world, those who understand binary and those who understand Roman numerals. Web - Blog - RSS - Math
Sign In·View Thread·PermaLink


Last Updated 4 Mar 2009 | Advertise | Privacy | Terms of Use | Copyright © CodeProject, 1999-2009