Bug in RecurrenceRule.SetEffectiveRange?

6 posts, 0 answers
  1. Roger McCoy
    Roger McCoy avatar
    7 posts
    Member since:
    May 2010

    Posted 27 Jul 2010 Link to this post

    I guess it's debatable whether this is the desired behaviour, but I noticed that when I use SetEffectiveRange it only accounts for the start date, not the end date.  To use a quick, realistic example, let's say we have an office that blocks off the time when they're closed with a recurring appointment from 5 PM to 8 AM.  If I parse all of the appointments on a given day, I get the equivalent of:

    8 AM - 9 AM - Early appointment
    12 PM - 1 PM - Lunch
    5 PM - 8 AM tomorrow - Office closed

    But I don't get:

    5 PM yesterday - 8 AM today - Office closed

    Similarly, if an appointment runs from Monday to Wednesday and I use SetEffectiveRange to show Tuesday's appointments, the effective "all day" appointment doesn't show.  I can work around this easily enough by setting a wider range and filtering with an If statement, but I don't know if this is considered the expected behaviour for this function.
  2. Peter
    Admin
    Peter avatar
    6637 posts

    Posted 30 Jul 2010 Link to this post

    Hi Roger,

    How do you parse all of the appointments? Have you used approach similar to the one from this kb article:

    http://www.telerik.com/support/kb/aspnet-ajax/scheduler/how-to-display-all-radscheduler-appointments-in-gridview.aspx

    Another helpful resource is the help topic on Working with Recurring Appointments.

    With the information you provided, we cannot say for sure if this is a bug or expected behavior. Anyway, we appreciate your feedback on this.


    Best wishes,
    Peter
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. Roger McCoy
    Roger McCoy avatar
    7 posts
    Member since:
    May 2010

    Posted 18 Aug 2010 Link to this post

    Same basic principle.  I guess my point is that it will parse whether an appointment is inside the range based on the start date but not the end date.  So if an appointment starts prior to the range but ends during (or even after) the range, it doesn't appear to be included. Sample code snippet below.

    If Len(appt.Recurrence) > 0 Then
        Dim parsedRule As RecurrenceRule
        Dim apptLength As Integer = DateDiff(DateInterval.Minute, appt.Time, appt.TimeEnd)
        Telerik.Web.UI.RecurrenceRule.TryParse(appt.Recurrence, parsedRule)
        parsedRule.SetEffectiveRange(LowDate.AddMinutes(-apptLength), HighDate)
        Dim occurrence As DateTime
        For Each occurrence In parsedRule.Occurrences
            Dim Item As New TimeSlotDesc
            Item.Room = appt.Room
            Item.RoomName = appt.RoomName
            Item.Time = occurrence
            Item.TimeEnd = occurrence.AddMinutes(apptLength)
            AppointmentList.Add(Item)
        Next occurrence
    End If
  4. T. Tsonev
    Admin
    T. Tsonev avatar
    2809 posts

    Posted 24 Aug 2010 Link to this post

    Hello Roger,

    That's actually what we do in RadScheduler - we subtract one appointment duration from the range start, so we can handle the case you describe.

    // The effective range start is adjusted with one appointment duration,
    // so we can include the recurring appointments that are starting
    // in the previous period and span into the current one.
    rrule.SetEffectiveRange(visibleRangeStart - parent.Duration, visibleRangeEnd);

    I agree with you - the best place to address this issue is to fix the SetEffectiveRange method. I've logged this issue.

    As a token of gratitude for your involvement your Telerik points have been updated.

    Best wishes,
    Tsvetomir Tsonev
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  5. Rohit Aggarwal
    Rohit Aggarwal avatar
    2 posts
    Member since:
    Jul 2010

    Posted 22 Aug 2011 Link to this post

    Has this bug fixed for SetEffectiveRange method ?
  6. Peter
    Admin
    Peter avatar
    6637 posts

    Posted 24 Aug 2011 Link to this post

    Hi Rohit,

    Thank you for your interest, but unfortunately, this issue has been postponed.

    All the best,
    Peter
    the Telerik team

    Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

Back to Top