Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Wrong dates returnd #16

@codepiper

Description

@codepiper

rrule i have : FREQ=YEARLY;DTSTART=20120229T023000Z;COUNT=5

I didn't make any (config) changes to library and assuming see the below comments in library code.

/**
 * By default, January 30 + 1 month results in March 30 because February doesn't have 30 days.
 *
 * Enabling this fix tells Recurr that +1 month means "last day of next month".
 */
public function enableLastDayOfMonthFix()
{
    $this->lastDayOfMonthFix = true;
}

I was expecting every 4 years as it was on feb29, but it gives below, am i missing any configuration.

array(

[0] => DateTime Object
    (
        [date] => 2012-02-29 08:00:00
        [timezone_type] => 3
        [timezone] => Asia/Kolkata
    )

[1] => DateTime Object
    (
        [date] => 2013-02-28 08:00:00
        [timezone_type] => 3
        [timezone] => Asia/Kolkata
    )

[2] => DateTime Object
    (
        [date] => 2014-02-28 08:00:00
        [timezone_type] => 3
        [timezone] => Asia/Kolkata
    )

[3] => DateTime Object
    (
        [date] => 2015-02-28 08:00:00
        [timezone_type] => 3
        [timezone] => Asia/Kolkata
    )

[4] => DateTime Object
    (
        [date] => 2016-02-29 08:00:00
        [timezone_type] => 3
        [timezone] => Asia/Kolkata
    )

)

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions