Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Weekdays recurring function


Go to End


7 Posts   1430 Views

Avatar
nzstephenf

Community Member, 63 Posts

3 November 2014 at 2:26am

Hey guys, need a bit of a hand again.

So I'm working on a website at the moment, and one of the things I need to do is have an event that allows users to have it to recur from the day it starts but from then on-wards it recurs every day of a weekday (Monday through to Friday) excl. weekends until the event ends. Each day becomes a saved event session. So I'd have to $EventSession->write(); it at the end.

What are some ways to get this going without a hiccup?

I've attached a screenshot to help depict what my situation is.

Avatar
UncleCheese

Forum Moderator, 4102 Posts

3 November 2014 at 11:03am

My EventCalendar module does this out of the box: https://github.com/unclecheese/silverstripe-event-calendar

For a lower level solution, you can look at PHP's DateInterval class.

Avatar
nzstephenf

Community Member, 63 Posts

3 November 2014 at 11:07am

Thanks UncleCheese,
I'll have a look!

Avatar
nzstephenf

Community Member, 63 Posts

3 November 2014 at 11:39am

I've just had a look, unless I'm blind like a bat. I can't find what lets you create events that recur every day except the weekend until the event ends. Could you please give me a bit more help? Thanks! :)

Avatar
UncleCheese

Forum Moderator, 4102 Posts

3 November 2014 at 11:45am

http://modules.unclecheeseproductions.com/admin/pages/edit/show/14 (admin/password)

Here's a quick screen grab:

Attached Files
Avatar
nzstephenf

Community Member, 63 Posts

3 November 2014 at 11:49am

Right now, you're a bit of a Jesus. Because now I see the light! Cheers dude :)

Avatar
nzstephenf

Community Member, 63 Posts

12 January 2015 at 1:03pm

I seemed to have read back on this and I failed to explain much clearly the solution I was looking for. Seemed very vague. My bad!

The website I work on doesn't use the event calendar module as a previously existing system is in place which appears to be successful as a solution.

What I was hoping was that an event session dataobject is created for every day from Monday to Friday from a selected date to the end of the weekday. E.g. Somebody wants to select a weekday recurring event from today (12th January) til Friday (16th January). Or start a weekday recurring event that begins from Thursday (15th January) til like 4th June in example.

All these dataobjects would be written on the spot and not run as a task and not literally created on the day of when such dataobject is needed.

Does this make things much clearer or have I dig a bigger hole? Haha!

Cheers,
Stephen