Giter VIP home page Giter VIP logo

dateval's Introduction

Dateval library

Build Status

Create new events, and see when they will repeat by generating results

First you need to create an event like this

$event = new Event("06 January 2014");

Example 1:
  $event->repeat("Weekly")
        ->maxRepeats(11);
        
  Event date will be set to 06 January 2014 and i will be repeated every week for limit of 11, which is 11 weeks.
  
  To generate reports on this example run:
    constructor: $report = new Report($event); // report constructor is taking Event object as argument
    usage:       $report->generateDates(from, to, pattern);
    ex:          $report->generateDates("01 March 2014", "31 March 2014");
    
    Pattern is set to default "d M Y", but you can change it any time just passing argument to function like this
    ex:         $report->generateDates("01 March 2014", "31 March 2014", "d m y");
Example 2:
  $event->repeat("Daily")
        ->until("15 March 2014");
        
  Event date is set and by generating reports with:
      $report->generateDates("01 March 2014", "31 March 2014");
  
  We will get dates from 01 March 2014 to 15 March 2014, Since event is happening every day starting from 06 January 2014 but we are generating reporst just for dates between 01 March and 31 March
Example 3:
  $event->repeat("Monday,Wednesday,Friday")
        ->maxRepeats();

  Event date is set and by generating reports with:
      $report->generateDates("01 March 2014", "31 March 2014");

  When repeat have provided argument days separated by commas that means we are searching for event that occurs just on provided days, and with maxRepeats() with not provided argument we are searching it with no limits and that will mean from 01 March to 31 March

There is some more examples and functionalities on this:

  $event->repeat("Monday,Wednesday,Friday")
        ->maxRepeats(11);

  $event->repeat("Monday,Wednesday,Friday")
        ->until("15 March 2014");

  $event->repeat(5) // event happens on every fifth day
        ->until("15 March 2014");

dateval's People

Contributors

kilgaloon avatar

Stargazers

 avatar

Watchers

James Cloos avatar  avatar

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.