bryntum / support

An issues-only repository for the Bryntum project management component suite which includes powerful Grid, Scheduler, Calendar, Kanban Task Board and Gantt chart components all built in pure JS / CSS / TypeScript
https://www.bryntum.com
55 stars 6 forks source link

Repeat event error when selecting option first day in month #10396

Open quoclotus opened 5 days ago

quoclotus commented 5 days ago

https://github.com/bryntum/support/issues/9949

This issue has not been fixed.

I tested with version 6.1.3. When I select the option first day in a month, the displayed value is the selected date in the selected month.

I expect it to be the first day when I choose the option first day in a month, regardless of the date I selected to open the popup. Pls take a look my video.

https://github.com/user-attachments/assets/6090c3d4-863e-48bf-8431-41b6fd433d68

ExtAnimal commented 2 days ago

I don't think our recurrence UI allows you to choose the pattern that you are thinking of.

The UI line with "ON THE" and then selecting days, is the UI which drives the BYSETPOS part of the rule which it seems governs weeks in the month. It's limited to 1 to 5 (plus "last") for this purpose. It's intended to make a pattern like "On the second Sunday in the month"

We do not have the UI to request BYMONTHDAY (An actual date in a month) in the Yearly UI. Neither does our yearly recurrence iterator have the ability to process BYMONTHDAY definitions in a `YEARLY rule.

It should be able to. See the two lines here:

Screenshot 2024-11-28 at 12 48 32

I suggest we add a new widget to the yearly widget set which allows choosing a BYMONTHDAY set of dates for the month(s) selected which could look like this:

Screenshot 2024-11-28 at 12 51 23

That would just be a Combo like

const
    day       = DateHelper.getLocalizedNameOfUnit('day'),
    monthDays = (()=>{
        const r = [{
                  id : -1,
                  text : 'Last'
              }];
        for (let i = 1; i < 32; i++) {
            r.push({ id : 1, text : `${day} ${i}`}) // "Day 1" to "Day 31"
        }
        return r;
    })();

then

{
    type       : 'combo',
    label       : 'Every',
    weight      : 59,
    multiSelect : true,
    items       : monthDays
})

It would contribute BYMONTHDAY=1,15 to the rule.

Our YearlyRecurrenceIterator would have to be upgraded to handle this. @arcady-zherdev would be best to handle that task.

@matsbryntse this is quite a large upgrade to the Scheduler's recurrence system. Will need to be scheduled.

Actually, on edit, if that second dropdown is just "day" as opposed to a day of the week, then the first combo should offer the 1st to 31st options and create the BYMONTHDAY.

Our Year iterator has bugs

'FREQ=YEARLY;BYDAY=MO,TU,WE,TH,FR;BYMONTH=10;BYSETPOS=1,2' should mean all weekdays in the first and second weeks of the month(s). It doesn't produce that pattern.

'FREQ=YEARLY;BYDAY=MO;BYMONTH=10;BYSETPOS=1,2' works OK, it hits Monday in the first two weeks of the month.

So some inconsistency there.

ExtAnimal commented 2 days ago

To simply repeat on the first day of May every year, just create the base event on May 1st and select YEARLY in the UI. That will work.