Strange Behavior when Binding to an AppointmentSource

4 posts, 1 answers
  1. Boutemine
    Boutemine avatar
    7 posts
    Member since:
    Jun 2012

    Posted 19 Jan 2012 Link to this post

    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
  2. Answer
    Victor
    Admin
    Victor avatar
    1351 posts

    Posted 24 Jan 2012 Link to this post

    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 >>

  3. DevCraft banner
  4. Boutemine
    Boutemine avatar
    7 posts
    Member since:
    Jun 2012

    Posted 24 Jan 2012 Link to this post

    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
  5. Victor
    Admin
    Victor avatar
    1351 posts

    Posted 25 Jan 2012 Link to this post

    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 >>

Back to Top