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

Generating Recurrence Programmatically or Via Field #171

Open
bobozar opened this issue Jun 29, 2020 · 0 comments
Open

Generating Recurrence Programmatically or Via Field #171

bobozar opened this issue Jun 29, 2020 · 0 comments

Comments

@bobozar
Copy link

bobozar commented Jun 29, 2020

From the API, the frontend will send me, start_date, end_date and time with each having a datetime obj. The interval should be rrule text. example, FREQ=DAILY;INTERVAL=2;COUNT=4 . Now, how do I pass the interval text value, alongside the start and end datetime to get the recurrence between the two dates?

Something like below example.

  start_rdt = utc_start_date_time
  end_rde = utc_end_date_time
  interval =  "FREQ=DAILY;INTERVAL=2;COUNT=4"
  mypattern = recurrence.Recurrence(rrules=[recurrence.Rule(interval)])]).between(start_rdt, end_rde,
  dtstart=start_rdt, inc=True)
  return mypattern

Or can I merge the interval text string with start and end datetime as value to the RecurrenceField?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants