Giter Club home page Giter Club logo

cron-translator's People

Contributors

alexmartinfr avatar asika32764 avatar brainformatik avatar chris53897 avatar chris8934 avatar impeck avatar kbond avatar limingxinleo avatar lorisleiva avatar michaeldyrynda avatar nphuly avatar ousid avatar pierreboissinot avatar reyostallenberg avatar salvisb avatar saurabhsharma2u avatar szepeviktor avatar tiagof avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cron-translator's Issues

FR expression error

Hi,

I think there is a mistake in one of the french translation of the crons. When a cron expression return "times per day", it says two times the word "fois" in french.

Example :
This cron expression : 00 2,8,14,20 * * * returns "4 fois fois par jour" when it should be "4 fois par jour"

I think the mistake is with your "times" array in lang/fr/times.php :

return [ 'default' => ':number fois', ];

Mixed with your "times_per_day" key in the "hours" array in lang/fr/fields.php :

'times_per_day' => ':times fois par jour',

Next run

Is only an idea but can be interesting to add two methods: one to validate valid(): bool and one to determinate the next and previus run. What do you think?

Problem with cron

Hi, there is such a cron:
*/15 0-8,21-23 * * *
And i get the error:
Failed to parse the following CRON expression: */15 0-8,21-23 * * * {"userId":205,"exception":"[object] (Lorisleiva\CronTranslator\CronParsingException(code: 0): Failed to parse the following CRON expression: */15 0-8,21-23 * * * at /var/www/vendor/lorisleiva/cron-translator/src/CronTranslator.php:33)
How to fix it?
On https://crontab.guru/ such this cron is recognized...

Many open PR's

There are many PR's open that are just translations, I think these people deserve a reaction on their effort to improve this library.

Can I help somehow to check (and maybe pull) the PR's.

Undefined property: DaysOfMonthField::$expression

<?php
 
 class DaysOfMonthField extends Field {
 
     public $position = 2;
 
     /**
      * @throws CronParsingException
      */
     public function translateEvery() {
         **if ($this->expression->weekday->hasType('Once')) {**
             return $this->lang('days_of_week.every', [
                         'weekday' => $this->expression->weekday->format(),
             ]);
         }
 
         return $this->lang('days_of_month.every');
     }

Support for @reboot and others

Hi

Would the @reboot and other be supported in future?
string meaning @reboot Run once, at startup. @yearly Run once a year, "0 0 1 1 *". @annually (sames as @yearly) @monthly Run once a month, "0 0 1 * *". @weekly Run once a week, "0 0 * * 0". @daily Run once a day, "0 0 * * *". @midnight (same as @daily) @hourly Run once an hour, "0 * * * *".

Crontab Man page

Incorrect description on ranges/fixed time elements

While this may seem human readable it actually simplifies it too much.
1-5 for hours does not mean 5 times a day as that would imply its spread out over the whole 24 hours ie 4,8,12,16,20,0. Same applies for the mins/days/months etc. Its can actually be very misleading.

0 1-5 * * * would be better represented as Hourly between 1-5am
0 1-5,12 * * * would be better represented as Hourly between 1-5am/12pm
0 1-5,12 * * * would be better represented as Hourly between 1-5am/12pm

CronTranslator::translate('0 1-5 * * *');     // => 5 times a day
CronTranslator::translate('0 1 1-5 * *');     // => 5 days a month at 1:00am

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.