Giter Site home page Giter Site logo

Comments (6)

rlanvin avatar rlanvin commented on August 25, 2024 2

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.

rlanvin avatar rlanvin commented on August 25, 2024 1

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.

priyankoctal avatar priyankoctal commented on August 25, 2024

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.

rlanvin avatar rlanvin commented on August 25, 2024

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.

priyankoctal avatar priyankoctal commented on August 25, 2024

Hi rlanvin

Your library is really very great and I like him. Thanks for your contribution for developer community.

THanks

from php-rrule.

priyankoctal avatar priyankoctal commented on August 25, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.