dragonmantank / cron-expression

CRON for PHP: Calculate the next or previous run date and determine if a CRON expression is due
MIT License
4.57k stars 124 forks source link

twiceMonthly resulting cron #101

Closed jmcguire81 closed 2 years ago

jmcguire81 commented 4 years ago

Hi, I noticed that the resulting cron expression from twiceMonthly() always has an hour & minute at 0, ignoring the time passed. I believe this resolves the issue:

Before: `public function twiceMonthly($first = 1, $second = 16, $time = '0:0') { $daysOfMonth = $first.','.$second;

    $this->dailyAt($time);

    return $this->spliceIntoPosition(1, 0)
        ->spliceIntoPosition(2, 0)
        ->spliceIntoPosition(3, $daysOfMonth);
}`

After: `public function twiceMonthly($first = 1, $second = 16, $time = '0:0') { $daysOfMonth = $first.','.$second;

    $this->dailyAt($time);

    return $this->spliceIntoPosition(3, $daysOfMonth);
}`
dragonmantank commented 2 years ago

Hello!

I am not sure what code this is referring to. This library doesn't have a twiceMonthly() method on any of the objects, so I'm not quite sure what I can do to help.

Feel free to re-open if you have any more information.

jmcguire81 commented 2 years ago

Hello, My mistake, this bug was actually in a task scheduling library in Larvel. I was reviewing your library for processing the resulting cron statements and must have inadvertently submitted the bug to the wrong project. Sorry for the confusion

John

On Tue, Jan 4, 2022 at 9:58 PM Chris Tankersley @.***> wrote:

Hello!

I am not sure what code this is referring to. This library doesn't have a twiceMonthly() method on any of the objects, so I'm not quite sure what I can do to help.

Feel free to re-open if you have any more information.

— Reply to this email directly, view it on GitHub https://github.com/dragonmantank/cron-expression/issues/101#issuecomment-1005382933, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACEHJLYW2WS3OMUHYF6QVOLUUPFWLANCNFSM4TRID52Q . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you authored the thread.Message ID: @.***>