Comments (6)
The lib will only calculate the start date of each event. The duration of the event is up to you. You do not need the lib to calculate the duration, since the duration is a constant (the same for every occurrence).
So the lib returns a start date as a DateTime
object, you simply need to add 10 days e.g. $date->modify('+10days')
to get the end date of the event.
NB. I don't mind answering support requests or questions, but please create separate issues when you have different questions (this question was originally about getting occurrences for a specific year). It makes it easier for other users to search through the list if they have a similar question. Thank you.
from php-rrule.
if I ignore other year recurrence in loop then it would not be best practice
No it's actually the right way to do it. Ignore the occurrences before 1 January 2018 and break the loop once you reached 1 January 2019 to stop computing. You can use the method getOcurrencesBetween
that does that automatically.
I'm closing this but feel free to reopen it if you have an issue with this method.
from php-rrule.
Hi,
Thanks for quick reply, I managed to fix this already from your one of reply at https://stackoverflow.com/questions/37100930/php-getting-the-next-occurrence-of-a-date-between-a-period
Now I am suffering from another issue, I set a rule
$rrule = new RRule([
'FREQ' => 'WEEKLY',
'INTERVAL' => '12',
'BYDAY' => 'SU,MO,TU,FR',
'DTSTART' => '2018-05-30',
'UNTIL' => '2018-12-31'
]);
every 12 weeks on Sunday, Monday, Tuesday and Friday, starting from 5/30/18, until 12/31/18
so we have results as below
Fri 01 Jun 2018
Sun 03 Jun 2018
Mon 20 Aug 2018
Tue 21 Aug 2018
Fri 24 Aug 2018
Sun 26 Aug 2018
Mon 12 Nov 2018
Tue 13 Nov 2018
Fri 16 Nov 2018
Sun 18 Nov 2018
which seems fine but I am afraid if i set an event on google calender it generate different dates like below
30th May 2018
19 Aug 2018
20 Aug 2018
21 Aug 2018
I tried with timezone changes in php but still its a problem for me which i can not catch.
is it something which depend on weekday ?
THanks
from php-rrule.
The first set of dates is obtained with a week start (WKST
) set to Monday (the default value specified in the RFC, and in most countries), while the second set of dates is obtained with a week start set to Sunday.
from php-rrule.
Hi rlanvin
Your library is really very great and I like him. Thanks for your contribution for developer community.
THanks
from php-rrule.
Hi rlanvin,
from your library i understand that we can generate all recurrences from parsing rrule, now I am worried how to work around if a event start on 25th many 2018 and end by 05th june 2018 (10 day event ) and it get repeat untill 10 month/
then I learned event should be started at
25th may
25th june and so on
but event instance which is started on 25th may is running till 5th june
and instance which is created on 25th june is running till 5th July 2018
Please let me know how I can get these ranges
thanks
from php-rrule.
Related Issues (20)
- Humanreadable gets monthly wrong HOT 4
- addExRule not working for me HOT 4
- Drop support for PHP < 7.3 HOT 2
- Daylight Savings Time issue with PHP 8.1 HOT 13
- How to create Rrule for every day from X to Y? HOT 4
- How to use exdate with byhour? HOT 3
- Question: Performance optimization when calculating occurrences using multiple rules HOT 3
- exRule and addRule conflict HOT 3
- More forgiving DTSTART behavior when using only date for UNTIL HOT 2
- Nested exrules HOT 2
- occursAt sometimes failing HOT 2
- Problem with getOccurrencesAfter HOT 9
- Removing all dates that are inside a DatePeriod from Rset HOT 1
- bi-weekly occurance wrong HOT 3
- dtstart vs. Repeat Dates / Current Time Not Considered in Calculation HOT 5
- humanreadable not so much HOT 2
- Looking for a way to add DTEND HOT 1
- Exrul not working
- Add alias methods for better reading of code HOT 1
- Legacy Code - Can I 'require_once' instead of composer ? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from php-rrule.