Comments (1)
Hello,
Thanks for your message. So DTEND indicates the end of an event, and is not part of the RRULE property. Since every event in the recurrence is supposed to be the same duration, it doesn't impact the recurrence,. I am not aware of a way in the RFC 5545 to describe a recurring event, with some occurrences having a different DTEND.
Therefore in theory you can just calculate the DTEND by adding the duration of the event to the occurrence start date generated by the library. Years ago I wrote a small convenience wrapper with an Event class and a Proxy class as a proof of concept (here - note the branch is outdated). The goal is exactly to do that, simply adding the duration automatically.
my issue is that i dont know which occurrence was created with each rule... RSet includes alot of rules.
That's indeed not really possible, but I'm not sure - what would be your use case for this? Are your including rules referring to different events maybe? The RSet is modelled after the "recurrence set" described in RFC 5545 and is supposed to be used to combine multiple RRULE, RDATE and EXDATE for the same event. Therefore you can apply the same technique describe above to just add the duration to each occurrence and have your DTEND.
If you're trying to use it for multiple different events... then it's indeed a bit tricky, because internally RSet works with DateTime objects (returned by RRule). If you wanted to "track" what occurrence comes from what rule, it would need to work with a higher level object containing not only the DateTime but also a reference to the rule that generated it (or the duration itself, to calculate the dtend). It might be possible to build on the PoC from the branch I linked above. Instead of giving RRule objects to RSet, using proxy class that implements the right interface and returns custom objects instead of DateTime, but those objects need to be comparable with each other like DateTime so RSet can sort the occurrences (and exclude ExDate...). Again, maybe possible, but not really designed to work like that.
Another possible approach I guess is to simply implement your own "event set" class so you can keep track of each DTEND for each occurrence generated. Internally RSet is using standard heap and iterators, and the entire logic is less than 100 lines, so it's quite straightforward to replicate.
Hope that helps!
from php-rrule.
Related Issues (20)
- 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
- Exrul not working
- Add alias methods for better reading of code HOT 1
- Legacy Code - Can I 'require_once' instead of composer ? HOT 2
- Danish translation file attached
- Typo in french translations for human readable output
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.