Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Typescript] Incorrect RecurrenceModel typing in schedulerpro.d.ts #7818

Closed
egorkel-altexsoft opened this issue Nov 7, 2023 · 1 comment
Closed
Assignees
Labels
resolved Fixed but not yet released (available in the nightly builds)
Milestone

Comments

@egorkel-altexsoft
Copy link

The type of the field positions should be number[] and not number (see docs)

If I use number I get the wrong rule string

const model = new RecurrenceModel({ 
  count: 2,
  days: ['SU', 'MO', 'TU', 'WE', 'TH', 'FR', 'SA'],
  frequency: 'MONTHLY',
  interval: 1,
  positions: 4 // <- wrong
});
console.log(model.rule); // FREQ=MONTHLY;BYDAY=SU,MO,TU,WE,TH,FR,SA;COUNT=2

But if I use number[] I get the correct rule string

const model = new RecurrenceModel({ 
  count: 2,
  days: ['SU', 'MO', 'TU', 'WE', 'TH', 'FR', 'SA'],
  frequency: 'MONTHLY',
  interval: 1,
  positions: [4] // <- correct
});
console.log(model.rule); // FREQ=MONTHLY;BYDAY=SU,MO,TU,WE,TH,FR,SA;COUNT=2;BYSETPOS=4
@matsbryntse matsbryntse added the resolved Fixed but not yet released (available in the nightly builds) label Jan 6, 2024
@matsbryntse matsbryntse added this to the 5.6.5 milestone Jan 6, 2024
@matsbryntse matsbryntse self-assigned this Jan 6, 2024
@matsbryntse
Copy link
Member

Good catch, fixed now for next patch!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
resolved Fixed but not yet released (available in the nightly builds)
Projects
None yet
Development

No branches or pull requests

2 participants