Page 1 of 1

Recurring Patterns not parsing correctly

Posted: Wed Mar 29, 2023 8:36 am
by clade_developer1

We use D365 Field Service to create availability patterns which are then parsed to Scheduler Pro.

We're finding that complex availability patterns are not displaying correctly in Scheduler.

I have attached a video that displays this error and the code being used to retrieve the data set.

We are using bryntum/schedulerpro": "5.2.0


Re: Recurring Patterns not parsing correctly

Posted: Thu Mar 30, 2023 10:55 pm
by marcio

Hey clade_developer1,

Are you able to provide a demo with the issue that you're having and a sample of data for us to debug and check what's going on?

Is difficult to say what's going wrong there, so we need more context and information.


Re: Recurring Patterns not parsing correctly

Posted: Sun May 07, 2023 5:49 am
by clade_developer1

Hi,
We have a scenario where we want to see the availability of the resource at 10:00 AM to 04:00 PM on Monday and Tuesday every 2 weeks between 01/01/2023 and 03/01/2024. So what happens is the bryntum pro calendar shows the correct availability for Jan, Feb and March month in 2023 but after that the calendar does not reflect the availability (as per the pattern) and all days in calendar are grayed out. Ideally the calendar should show availability between 10:00 AM to 04:00 PM on every alternate Monday and Tuesday till 03/01/2024. But looks like calendar fails to render it correctly after few initial days/weeks.

Hi,
Please find few examples below -

"calendars":{
    "rows": [
        {
            "id": "weekends",
            "name": "Weekends",
            "intervals": [
                {
                    "recurrentStartDate": "at 10:00 AM on Monday and Tuesday every 2 week in 2023",
                    "recurrentEndDate": "at 6:00 PM on Monday and Tuesday every 2 week in 2023",
                    "isWorking": true
                }
            ]
        }
    ]
}

Another example of calendar interval which is not working after first week in April. Basically the problem is with every 2 week patterns.

"calendars":{
    "rows": [
        {
            "id": "weekends",
            "name": "Weekends",
            "intervals": [
                {
                    "recurrentStartDate": "at 10:00 AM on Monday and Tuesday every 2 weeks starting on the 1 week in 2023 before 2 week in 2024",
                    "recurrentEndDate": "at 6:00 PM on Monday and Tuesday every 2 weeks starting on the 1 week in 2023 before 2 week in 2024",
                    "isWorking": true
                }
            ]
        }
    ]
}

[/code]


Re: Recurring Patterns not parsing correctly

Posted: Mon May 08, 2023 9:05 pm
by marcio

Hey clade_developer1,

I believe this pattern is the one that you're looking for, please let me know if that's correct (just need to add the year):

{
            "recurrentStartDate" : "at 6:00 PM on Tuesday every 2 weeks",
            "recurrentEndDate"   : "at 10:00 AM on Monday every 2 weeks",
            "isWorking"          : false
          },

Re: Recurring Patterns not parsing correctly

Posted: Tue May 16, 2023 1:50 am
by clade_developer1

Hi,

Below calendar intervals do not work between 10 April 2023 to 30 Sep 2023. It works fine before and after mentioned time frame.

    "recurrentStartDate": "at 10:00 AM on Monday and Tuesday every 2 week starting on the 6 week in 2022 through 2024",
    "recurrentEndDate": "at 12:00 PM on Monday and Tuesday every 2 week starting on the 6 week in 2022 through 2024"

Re: Recurring Patterns not parsing correctly

Posted: Mon May 22, 2023 9:22 am
by alex.l

Hi,

What timezone are you in?


Re: Recurring Patterns not parsing correctly

Posted: Tue May 23, 2023 1:43 am
by clade_developer1

Australian Eastern Standard Time (AEST)


Re: Recurring Patterns not parsing correctly

Posted: Tue May 23, 2023 12:28 pm
by alex.l

I tried here with your timezone https://bryntum.com/products/gantt/examples/advanced/
I just replaced default general calendar with your intervals

  "calendars" : {
    "rows" : [
      {
        "id"        : "general",
        "name"      : "General",
        "intervals" : [
          {
            "recurrentStartDate": "at 10:00 AM on Monday and Tuesday every 2 week starting on the 6 week in 2022 through 2024",
            "recurrentEndDate": "at 12:00 PM on Monday and Tuesday every 2 week starting on the 6 week in 2022 through 2024",
            "isWorking"          : false
          }

And zoomed in a bit to see grayed areas. It works well to me in period you mentioned above.
Please try to reproduce it yourself and let us know.
Make sure you used latest released version.

Screenshot 2023-05-23 at 18.28.07.png
Screenshot 2023-05-23 at 18.28.07.png (63.9 KiB) Viewed 808 times

Re: Recurring Patterns not parsing correctly

Posted: Fri May 26, 2023 2:23 am
by clade_developer1

Hi,
It does not seem to be consistent. Is it possible to have it set for one of your example where is can verify it is working? Additionally the "isWorking" property needs to be true as we need to show the availability of the resources for give interval.

"calendars" : {
    "rows" : [
      {
        "id"        : "general",
        "name"      : "General",
        "intervals" : [
          {
            "recurrentStartDate": "at 10:00 AM on Monday and Tuesday every 2 week starting on the 6 week in 2022 through 2024",
            "recurrentEndDate": "at 12:00 PM on Monday and Tuesday every 2 week starting on the 6 week in 2022 through 2024",
            "isWorking"          : true
          }

Below is the whole json in our case -

{
    "revision": 1685058554,
    "success": true,
    "requestId": 168505855319011,
    "resources": {
        "rows": [
            {
                "id": "5e3a87db-140e-ed11-b83d-00224818afe5",
                "name": "Mo Clade 3",
                "calendar": "c-5e3a87db-140e-ed11-b83d-00224818afe5",
                "role": null,
                "eventColor": null,
                "dailyMaxBookHoursWeekday": 10,
                "dailyMaxBookHoursWeekend": 10,
                "acceptNewClient": true,
                "doubleBookable": false,
                "scheduleNotes": "",
                "teamId": null,
                "location": "Bathurst"
            }
        ],
        "total": 1
    },
    "events": {
        "rows": [
            {
                "id": "c18c52bd-8a90-ec11-b400-00224818460e-5e3a87db-140e-ed11-b83d-00224818afe5",
                "eventType": "calendarrules",
                "name": "Easter Monday 2022",
                "resourceId": "5e3a87db-140e-ed11-b83d-00224818afe5",
                "startDate": "2022-04-18",
                "endDate": "2022-04-19",
                "showInTimeline": true,
                "duration": 1,
                "durationUnit": "hours",
                "sessionId": null,
                "appointmentId": null,
                "eventColor": "#FF33CC",
                "sessionStatusId": null,
                "repeatPattern": null,
                "allDay": true,
                "ignoreResourceCalendar": false,
                "CRMBaseUrl": null,
                "CRMFullUrl": ""
            }
        ],
        "total": 1
    },
    "calendars": {
        "rows": [
            {
                "id": "c-5e3a87db-140e-ed11-b83d-00224818afe5",
                "name": "AP03052013 - Week 1 Setup 1",
                "unspecifiedTimeIsWorking": false,
                "intervals": [
                    {
                        "recurrentStartDate": "at 10:00 AM on Monday and Tuesday every 2 week starting on the 6 week in 2022 through 2024",
                        "recurrentEndDate": "at 12:00 PM on Monday and Tuesday every 2 week starting on the 6 week in 2022 through 2024",
                        "isWorking": true
                    }
                ]
            }
        ],
        "total": 1
    }
}

Re: Recurring Patterns not parsing correctly

Posted: Fri May 26, 2023 10:23 am
by alex.l

Thank you, when I switched isWorking time, I was able to reproduce that with data you posted and in Australian timezone.
Here is the ticket https://github.com/bryntum/support/issues/6858
You can subscribe on ticket updates to be notified when status updated.