Coder Social home page Coder Social logo

ntucakovic / timesheet-advanced.js Goto Github PK

View Code? Open in Web Editor NEW

This project forked from sbstjn/timesheet.js

6.0 2.0 0.0 534 KB

More customizable version of timesheet.js, with 2 alternative layouts

Home Page: http://ntucakovic.github.io/timesheet-advanced.js/

License: MIT License

JavaScript 73.22% HTML 6.59% CSS 20.19%

timesheet-advanced.js's Introduction

Timesheet-advanced.js

JavaScript library to create HTML time sheets.

https://ntucakovic.github.io/timesheet-advanced.js

You only have to include dist/timesheet-advanced.js and dist/timesheet.min.css in your HTML and initialize time sheet with:

<div id="my-timesheet"></div>
var bubbles = [
  {start: '2002',    end: '09/2002', label: 'First project', type: 'red', data: { technologies: 'php,drupal,mysql,symfony' }},
  {start: '06/2002', end: '09/2003', label: 'Second project', type: 'blue'},
  {start: '2003',    label: 'Still working on'},
  {start: '10/2003', end: '2006',    label: 'Yellow project', type: 'yellow', link: 'http://www.example.com'},
  {start: '02/2005', end: '05/2006', label: 'Green project', type: 'green', link: '#'},
  {start: '07/2005', end: '09/2005', label: 'The shortest project', type: 'purple', link: '#'}
];

new Timesheet(bubbles, {
    container: 'my-timesheet',
    type: 'parallel',
    timesheetYearMin: 2002,
    timesheetYearMax: 2008,
    theme: 'light'
});

Explanation

'Bubbles' array contains information about all the bubbles that will appear in the time sheet. Each bubble can have:

  • start: required; starting date in one of the following formats: mm/yyyy or yyyy
  • end : optional; end date (if no end date is given, bubble is stretched until the end of the timesheet)
  • label: required; name of the bubble (what does it refer to)
  • type : optional; color of the bubble (if nothing is given, default value is used)
  • link : optional; URL (if bubble name should act as a link)
  • data : optional; HTML data attributes of a bubble. Foreach key in data object a data attribute is created in HTML. Values must be STRINGS.

Timesheet object contains information about the time sheet itself. It consists of:

  • bubbles array,
  • timesheetYearMax,
  • timesheetYearMin,
  • container : ID of the HTML element,
  • theme: light or dark,
  • type: serial or parallel.

In parallel mode, every bubble is in its own row.

In serial mode, bubbles are 'packed' in one row without overlapping.

Parallel Dark

https://ntucakovic.github.io/timesheet-advanced.js

Serial Dark

https://ntucakovic.github.io/timesheet-advanced.js

Serial Light

https://ntucakovic.github.io/timesheet-advanced.js

Bower

$ > bower install timesheet-advanced.js

Grunt commands

Use grunt to build all JavaScript and StyleSheet files located inside dist/.

Use grunt server to start a local web server on localhost:8080 to customize Timesheet-advanced.js, afterwards run grunt to compile all needed files.

Use grunt gh to generate the site and files available at ntucakovic.github.io/timesheet-advanced.js into the gh-pages folder.

License

Timesheet-advanced.js is licensed under MIT License.

timesheet-advanced.js's People

Contributors

sbstjn avatar olivierrr avatar aweary avatar stof avatar fay-jai avatar

Stargazers

Brian Surowiec avatar  avatar Sebastien Fourault avatar aoki avatar Toshihiro Nakamura avatar  avatar

Watchers

Nikola Tucaković avatar Jelena Krmar 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.