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
Add start date in a rule in admin widget #54
Comments
You can't do this with the JavaScript widget - if you need to do this, add a |
You mean i have to do something like this ?
But like this how can i deal with complex recurrences? In this case i dont find the utility of the JavaScript widget if i have to create my own api if i want a start date for my recurrences... Thanks |
No, you can just modify the way you get recurrences back to specify a start date, not the actual recurrence that is saved. |
an automatic dtstart is set to datetime.now() when i save my models, there is no way to override this by my start date? |
Sure there is - with something like this on your
If you don't want an end date, then you can use |
Sry i dont understand, if i have this (no end date) :
|
When you save your model, you create a recurrence rule. You can (and should) override So, in your case, if you want to get a generator of occurrences beginning at the
|
Hi, Thanks,i find a way with the between method, in my case i have a date from a datepicker and want list events with an occurrences for this date so : models
views
But i have a little problem, i dont find a way for include the until date in occurrences, if i set same start_date and until date i got the event at the date, but if my start_date is a 2015-10-02 and until at 2015-10-09, my event stop at 2015-10-08. Thanks |
I'm not quite sure what you're asking here. If your pattern doesn't match 9th October, you won't get 9th October. If you want to manually add the date 9th October, you can always add the date onto your array manually. Or am I misunderstanding what you're trying to do? |
sry hard to explain my problems... I assume that when i enter a daily recurrences for example from 2015-10-02 to 2015-10-09 my event finish at 2015-10-09 not at 2015-10-08. Or i do something wrong, like you see i add a timedelta(days=1) at dtend parameter in my views when i call event.occurrences_between (i got nothing if i dont add it), and in the Event model method i add it to the dtstart or my event begin 1 day before my start_date... |
I have find why i have to add timedelta (days=1) when i call occurrences_between, if my own date_start is at 2015-10-02 00:00 and if i do raise ValueError(self.date_start) during occurences_between, thats return me this : 2015-10-01 22:00:00+00:00 , but if i show my date_start in the templates that return me 2015-10-02, i think i have a timezone problem or something like that... in my settings i have this : but that change nothing if i delete these lines, i mayble should read some docs for this^^ |
Problem solve, timezone problem, i set default timezone to utc and just will convert output if needed. Sry for these incomprehensible questions i was so confused with dates and time :p Last question, set a datetime.now() as default dtstart create so much usless occurrences in my case and i think many others, It would not be better to give us the possibility to set our own dtstart, and if the user want datetime.now he just set himself? Thanks |
Glad you worked it out. As to changing dtstart, that'd be backwards incompatible, and I'm not convinced it's worth the effort, personally. If someone can come up with a good way to make the change without making upgrading django-recurrence hard, I'd be happy to take a look, but let's handle that elsewhere. |
Hi,
i want to set event recurrences in the admin widget with a start date but i dont find how to do this, start date of my rules automatically take a datetime.now()
It thats i want, i got an event started a 2october with daily recurences to 9 october, i check to python dateutil and its easy to do this directly with it too. In your app i really enjoy the admin widget, my users can easy enter complex recursive events with it, but if they can't set a start date will difficult.
in recurrence.fields we can see this : " Field that stores a
recurrence.base.Recurrence
object to thedatabase."
Ok i go in base.Recurrence i see this :
Im in this case, it generate me an automatic start date.
In recurrences.forms.RecurrenceField :
Im really confuse, how to set a dtstart in the input?
Thanks for your help
The text was updated successfully, but these errors were encountered: