Giter Site home page Giter Site logo

bunkat / schedule Goto Github PK

View Code? Open in Web Editor NEW
426.0 22.0 87.0 459 KB

Automatically schedules tasks, work items, meetings, reservations, etc. Schedule takes into account working hours, holidays/days off, people's work schedule/vacation time, as well as task dependencies.

Home Page: http://bunkat.github.io/schedule/

License: MIT License

JavaScript 42.88% Makefile 0.53% HTML 56.59%

schedule's Introduction

This code is no longer being actively maintained. It should not be used in production. It may or may not work for your particular use case.

Schedule is a library for scheduling a set of tasks with complex dependencies that require a set of resources to complete. Takes advantage of Later schedules to provide incredible flexibility on when tasks are scheduled and when resources can be reserved.

Types of schedules supported by Schedule:

  • Schedule a set of work items across developers with different schedules
  • Manage elevator reservations for an apartment building
  • Schedule the company ping pong tournment

####For complete documentation visit http://bunkat.github.io/schedule/.

Installation

Using npm:

$ npm install schedulejs

Using bower:

$ bower install later
$ bower install schedule

Building

To build the minified javascript files for schedule, run npm install to install dependencies and then:

$ make build

Running tests

To run the tests for schedule, run npm install to install dependencies and then:

$ make test

Versioning

Releases will be numbered with the following format:

<major>.<minor>.<patch>

And constructed with the following guidelines:

  • Breaking backward compatibility bumps the major (and resets the minor and patch)
  • New additions without breaking backward compatibility bumps the minor (and resets the patch)
  • Bug fixes and misc changes bumps the patch

For more information on SemVer, please visit http://semver.org/.

Bug tracker

Have a bug or a feature request? Please open a new issue.

Change Log

Schedule v0.6.0

  • First documented release.

schedule's People

Contributors

billscheidel 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

schedule's Issues

bower dependency on later 1.1.3 fails

When running bower install schedule, it fails because of a non-existing dependency in bower json to Later version 1.1.3.

Console log:

bower install schedule
bower not-cached git://github.com/bunkat/schedule.git#*
bower resolve git://github.com/bunkat/schedule.git#*
bower checkout schedule#master
bower resolved git://github.com/bunkat/schedule.git#7698978c94
bower not-cached git://github.com/bunkat/later.git#1.1.3
bower resolve git://github.com/bunkat/later.git#1.1.3
bower ENORESTARGET No tag found that was able to satisfy 1.1.3

push your tags?

Hi,
I'm trying to bower install a specifc version, but it seems that requires a version git tag, branch, etc., but there are no tags on the Schedule repository at all (nor on Later). Perhaps you have the tags already and can use git push --tags ?

Current Task Status

Hi, I enjoy using Schedulejs, however I want to know if there is a feature that enables me to know what task is currently busy and how long duration is left?

is it possible to avoid certain absolute dates?

I'm looking at a use case where I defined availabilities, tasks and generate them.

However, sometime in the future I might come back and with those same availabilities try to generate more tasks, being aware of the previous batch of tasks.

So say , for an elevator that is available between 16:00 - 20:00, I would like to be able to input and "remember" that there is a reservation already on Monday 14:00 - 14:15

work item example calling wrong function

I just saw this awesome project and tried to copy the Work item example code, pasted it to a js file.
Then, I run node "myfilename".js

It came out with the following error:

D:\nodejs>node test.js
D:\nodejs\test.js:94
          .schedule(function(d) { return d.availability ? p(d.availability) :
           ^
TypeError: undefined is not a function
    at Object.<anonymous> (D:\nodejs\test.js:94:12)
    at Module._compile (module.js:460:26)
    at Object.Module._extensions..js (module.js:478:10)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Function.Module.runMain (module.js:501:10)
    at startup (node.js:129:16)
    at node.js:814:3

D:\nodejs>node test.js
D:\nodejs\test.js:105
          .schedule(function(d) { return d.availability ? p(d.availability) :
           ^
TypeError: undefined is not a function
    at Object.<anonymous> (D:\nodejs\test.js:105:12)
    at Module._compile (module.js:460:26)
    at Object.Module._extensions..js (module.js:478:10)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Function.Module.runMain (module.js:501:10)
    at startup (node.js:129:16)
    at node.js:814:3

I think the demo code calls the wrong function at Line:94 , 105

89 var t = schedule.tasks()
90           .id(function(d) { return d.name; })
91           // our length is in hours, convert to minutes
92           .duration(function(d) { return d.length * 60; })
93           // use later.parse.text to parse text into a usable schedule
94          .schedule(function(d) { return d.availability ? p(d.availability) : undefined; })
95           // convert minSchedule to minutes
96           .minSchedule(function(d) { return d.minSchedule ? d.minSchedule * 60 : undefined; })
97           // resources are the people the tasks have been assigned to
98           .resources(function(d) { return d.assignedTo; });
.
.
.
105         .schedule(function(d) { return d.availability ? p(d.availability) : undefined; });


I changed all the ".schedule" to ".available", then it works fine.

dynamic scheduling

I would like to manage scheduling dynamically, so that new resources and tasks appear/disappear on the fly.

something like:

var scheduler = schedule.create(initial_tasks, initial_resources, null, start);
setInterval( function() {
     //add one more task every 1 second
    scheduler.add_task(..)
}, 1000);
setInterval( function() {
     //add one more resource every 5 second
     scheduler.add_resource()
     //remove one resource from resources pool
     scheduler.remove_resource(<id>)
}, 5000);

for(var task in scheduler.get_next_scheduled_task()) {
    ...
}

Is this already possible, and if not, how much it needs effort to implement this kind of feature ?

Issue running example in browser

Hello,

I'm trying to test out the example schedule on browser.html but I'm getting the following error:

Uncaught TypeError: Object function tasks(data) {
var items = [], fid = schedule.functor(id), fduration = schedule.functor(duration), favailable = schedule.functor(available), fresources = schedule.functor(resources), fdependsOn = schedule.functor(dependsOn), fminschedule = schedule.functor(minSchedule), fpriority = schedule.functor(priority);
for (var i = 0, len = data.length; i < len; i++) {
var task = data[i], item = {
id: fid.call(this, task, i),
duration: fduration.call(this, task, i),
available: favailable.call(this, task, i),
resources: fresources.call(this, task, i),
dependsOn: fdependsOn.call(this, task, i),
minSchedule: fminschedule.call(this, task, i),
priority: fpriority.call(this, task, i)
};
items.push(item);
}
return items;
} has no method 'schedule' browser.html:75
(anonymous function) browser.html:75

Any idea what might be the cause?

Add demo to documentation

If there's a quick way to contribute this I'm happy to do so, it would be great to have a working demo right on the documentation site.

Cannot chain windows of availability

I am using Schedule.js to try to set a schedule for teachers for standardized testing weeks and I am running into a problem when I try to chain the windows of availability. I am almost getting what I need back, but the schedule results are still spilling into the windows that I have specified the teachers as unavailable. My teacher availability is as follows:

var teacherSchedules = [

{name: 'teacher3a', length: .5, availability: 'after 9:30am and before 11:10am, after 12:45 and before 2:15pm, after 2:30pm and before 3:55pm'},

{name: 'teacher3b', length: .5, availability: 'after 9:30am and before 11:10am, after 12:45 and before 2:15pm, after 2:30pm and before 3:55pm'},

{name: 'teacher3c', length: .5, availability: 'after 9:30am and before 11:10am, after 12:45 and before 2:15pm, after 2:30pm and before 3:55pm'},

{name: 'teacher3d', length: .5, availability: 'after 9:30am and before 11:10am, after 12:45 and before 2:15pm, after 2:30pm and before 3:55pm'},

{name: 'teacher4a', length: .5, availability: 'after 9:30am and before 10:20am, after 11:05am and before 12:15, after 12:45 and before 2:15, after 2:30 and before 3:55pm'}, 

{name: 'teacher4b', length: .5, availability: 'after 9:30am and before 10:20am, after 11:05am and before 12:15, after 12:45 and before 2:15, after 2:30 and before 3:55pm'},

{name: 'teacher4c', length: .5, availability: 'after 9:30am and before 10:20am, after 11:05am and before 12:15, after 12:45 and before 2:15, after 2:30 and before 3:55pm'},

{name: 'teacher5a', length: .5, availability: 'after 10:15am and before 12:30, after 1:00pm and before 2:10pm, after 2:25pm and before 3:55pm'},

{name: 'teacher5b', length: .5, availability: 'after 10:15am and before 12:30, after 1:00pm and before 2:10pm, after 2:25pm and before 3:55pm'},

{name: 'teacher5c', length: .5, availability: 'after 10:15am and before 12:30, after 1:00pm and before 2:10pm, after 2:25pm and before 3:55pm'}

];

Is there a way to appropriately chain the availability windows so that all are considered when the schedule is generated?

Error in Work Item example

It appears that 'schedule' is no longer a function.

$ node test.js
.../test.js:94
          .schedule(function(d) { return d.availability ? p(d.availability) : undefined; })
           ^

TypeError: schedule.tasks(...).id(...).duration(...).schedule is not a function
    at Object.<anonymous> (/Users/bmiller/src/clockwork.js/test.js:94:12)
    at Module._compile (module.js:573:30)
    at Object.Module._extensions..js (module.js:584:10)
    at Module.load (module.js:507:32)
    at tryModuleLoad (module.js:470:12)
    at Function.Module._load (module.js:462:3)
    at Function.Module.runMain (module.js:609:10)
    at startup (bootstrap_node.js:158:16)
    at bootstrap_node.js:578:3

Resource or condition is not working?

      // Define a set of tasks
    var testTasks = [
      {id: 1, duration: 60},
      {id: 2, duration: 30, dependsOn: [1], resources: ['A']},
      {id: 3, duration: 30, dependsOn: [1], resources: [['A','B']]}
    ];

    // Define a set of resources
    var testResources = [
      {id: 'A'},
      {id: 'B'}
    ];
    var testS = schedule.create(testTasks, testResources, null, new Date());

Task id3 need resource A or B.
I want to be scheduled task id2 and id3 going simultaneously.
But only resource A is used.
Why?

1 task simultanously by 1 or 2 resources

Is it possible to schedule 2 resources to 1 task, when they are available, but when only 1 resource is available, it can also work on the same task? Like now I only see 2 options:

schedule.tasks().resources( [ [ 'res1', 'res2' ] ] )
in this setup 'res2' will work on this task only when 'res1' will not be available (I want them to work together)

schedule.tasks().resources( [ 'res1', 'res2' ] )
in this setup they will start work only when both will be available. I want them to start work even if the second resource is unavailable.

Get un-available dates

Is there a way to create a list of ressources with available times, and create a query with a task
say: {task:'sometask',duration:'120Min'}

and then get unavailable dates (in days) back, meaning getting a negative result where you only extract dates where the task does not fit in. ?

scheduling two tasks at the same time.

Hi, I'm trying to schedule two tasks at the same time on the same date that both require a particular resource whose isNotReservable field is set to true. As far as I understand, these two tasks should not conflict with one another; however, I can't get something like this to work. To be more explicit, the following data results in the scheduler successfully scheduling t2, but failing to schedule t1:

let tasks = [{
    id: "t1",
    duration: 1,
    minLength: 1,
    resources: ["r1"],
    available: later.parse.text("after 1:00am and before 1:01am")
}, {
    id: "t2",
    duration: 1,
    minLength: 1,
    resources: ["r1"],
    available: later.parse.text("after 1:00am and before 1:01am")
}];

let resources = [{
    id: "r1",
    available: later.parse.text("after 1:00am and before 1:01am"),
    isNotReservable: true
}];

let start = new Date("2020-01-01");
let frequency = later.parse.text("on the 1 day of January in 2020");
let s = schedule.create(tasks, resources, frequency, start);

Is this expected behavior? Or, perhaps I'm doing something wrong?

Alternatives to this library

Hi
This library looks exactly what I need but it seems to have bugs and is not being maintained.

Does anyone know of something similar?

Thanks very much!

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.