Divino
Divino

Reputation: 47

Django-recurrence Parsing

I have a recurrence in the database from Django-recurrence - http://django-recurrence.readthedocs.io/en/latest/index.html Note: This utility provide a Jscript UI interface to dateutil.rrule - It is used for working with recurring dates in Django.

'RRULE:FREQ=WEEKLY;INTERVAL=2;UNTIL=20170511T050000Z;BYDAY=MO,TU,WE,TH,FR,SA,SU\n'
 'RDATE:20170224T060000Z\n'
 'EXDATE:20170228T060000Z', 

How do I parse this?

Upvotes: 1

Views: 955

Answers (1)

AALAP JETHWA
AALAP JETHWA

Reputation: 160

As per given Documentation of django-recurrence, you can use occurrences() to generate range of dates.
Here is general syntax:

date_obj = Project.objects.get(id=1).start_date_recurrence_field.occurrences()

for i in date_obj:
    print(i)

Here you will get list of your dates printed.
Let me know if you still didn't get that.

Upvotes: 3

Related Questions