This is a migrated thread and some comments may be shown as answers.

Strange Behavior when Binding to an AppointmentSource

3 Answers 70 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Boutemine
Top achievements
Rank 1
Boutemine asked on 19 Jan 2012, 05:58 PM
Hello Guys,
I've noticed a small but quite strange behavior in the Calendar control.
Here is the FetchData Method.
        public override void FetchData(DateTime startDate, DateTime endDate)
        {
            previousEndDate = endDate;
            previousStartDate = startDate;
 
            AllAppointments.Clear();
            AllAppointments.Add(new PeriodDayCalendarItem(new DateTime(2012, 1, 15,0,0,0,0), ShowPin: true));
                }

When I try to add a single Element with a date with 0 for hours, minutes, seconds and milliseconds , I see two items showing the  Pin image, the item with the specified date and the item for the date just before it (I'm using by the way a simple Template for the calendar item)
but when I fix the hours, minutes, the secs and the millisec, I only see my item
I just wanna know if this is a default behavior the date is fixed to midnight 00:00:00.000

Thanks

3 Answers, 1 is accepted

Sort by
0
Accepted
Victor
Telerik team
answered on 24 Jan 2012, 01:04 PM
Hi Boutemine,

 Thank you for the question.
Actually, RadCalendar does not support appointments that have zero length, that is, appointments that have start date and end date as the same value. However, there is also a bug in the logic that determines which days have appointments. Please try setting an end date different than the start date of your appointment.

In the upcoming update the bug will be fixed and our DateTimeAppointment class will throw an exception if it is initialized with a start date that is later than the end date or if they are the same. If you are implementing the IAppointment interface manually, please note that the calendar will not work correctly if you have appointments that have start dates greater than their end dates.

Your feedback is greatly appreciated.
Your Telerik points have been updated.

All the best,
Victor
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Boutemine
Top achievements
Rank 1
answered on 24 Jan 2012, 05:29 PM
Hello admin, 
Thanks for your kind reply, in the particular WP7 app I'm working on, the spec states that the appointments begin and finish the same day, say a zero day appointment, I'm not sure if it's a good idea to not support this logic, anyway I'm still using the trial version and the company I'm working for has not decided yet to buy a license.
Again, thanks for your continued support,
Regards
Oualid
0
Victor
Telerik team
answered on 25 Jan 2012, 09:13 AM
Hello Boutemine,

 A zero day appointment is still not a zero interval appointment. You may have an appointment from, say, 2:00 PM to 3:00 PM. This is a zero day appointment but its interval is not zero, its interval is one hour.

Thank you for the suggestion though, we will consider implementing an appointment with a start date and an indefinite end date. For example you know that an appointment starts tomorrow at 10:AM but you are not sure how long it would take so the appointment will be displayed for every day after the start date and you will have to remove it from the appointments source in order to stop it.

Please write again if you have more questions.

All the best,
Victor
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Tags
Calendar
Asked by
Boutemine
Top achievements
Rank 1
Answers by
Victor
Telerik team
Boutemine
Top achievements
Rank 1
Share this question
or