JavaScript library for HTML5 & CSS3 time sheets

Overview

Timesheet.js

Simple JavaScript library to create HTML time sheets. Wrapped in an example project using Middleman …

https://sbstjn.github.io/timesheet.js

You only have to include dist/timesheet.js and dist/timesheet.css in your HTML and initialize Timesheet.js with:

<div id="timesheet"></div>
new Timesheet('timesheet', 2002, 2013, [
  ['2002', '09/2002', 'A freaking awesome time', 'lorem'],
  ['06/2002', '09/2003', 'Some great memories', 'ipsum'],
  ['2003', 'Had very bad luck'],
  ['10/2003', '2006', 'At least had fun', 'dolor'],
  ['02/2005', '05/2006', 'Enjoyed those times as well', 'ipsum'],
  ['07/2005', '09/2005', 'Bad luck again', 'default'],
  ['10/2005', '2008', 'For a long time nothing happened', 'dolor'],
  ['01/2008', '05/2009', 'LOST Season #4', 'lorem'],
  ['01/2009', '05/2009', 'LOST Season #4', 'lorem'],
  ['02/2010', '05/2010', 'LOST Season #5', 'lorem'],
  ['09/2008', '06/2010', 'FRINGE #1 & #2', 'ipsum']
]);

Bower

$ > bower install https://github.com/sbstjn/timesheet.js.git

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.js, afterwards run grunt to compile all needed files.

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

License

Timesheet.js is licensed under MIT License.

Comments
  • Period Classes

    Period Classes

    Cracking work - having loads of fun with it. Had an issue with classes not being parsed correctly for periods with only one time so altered line 88 to read:

    var cat = data[n].length === 4 ? data[n][3] : data[n].length === 3 ? data[n][2] : 'default';
    

    Hope that it helps.

    bug 
    opened by annoyingmouse 4
  • What is the 4th column?

    What is the 4th column?

    In the data, what's the 4th column for? I mean the the lorem one.

    ['2002', '09/2002', 'A freaking awesome time', 'lorem'],

    May be good to add it to the readme

    Thanks for making this fun visualization tool!

    opened by drewrwilson 2
  • Feature Request: Add simple example project that can be used for testing during development.

    Feature Request: Add simple example project that can be used for testing during development.

    I thought it could be a nice idea if there was a simple example project within the repository that could be launched with an express server using a grunt _dev_ task and then edited while debugging.

    Within this dev task, the watch task could be run to rebuild all files on any changes utilising livereload and css injection. This could make for really nice debugging.

    So for example, in the grunt file you could have something like this:

    ....
    
    express: {
          all: {
            options: {
              port: 6080,
              hostname: "0.0.0.0",
              bases: ['example'],  // working on the assumption that the example project is in root/example
            }
          }
        },
    
    watch: {
         options: { livereload: true }
         stylesheets: {
            files: ['dist/timesheet.css'],
          }
          sass: {
            files: ['source/stylesheets/timesheet.css.sass'],
            tasks: ['sass'],
            options: {livereload: false } // dont live reload on sass changes, but on css changes instead for injection
          },
          scripts: {
            files: ['Gruntfile.js', 'source/javascripts/timesheet.bubble.js', 'source/javascripts/timesheet.js'],
            tasks: ['jshint', 'uglify']
          }
        },
      });
    
      grunt.registerTask('lint', 'Perform a lint on all the js source files', ['jshint']);
      grunt.registerTask('build', 'minify all js source files', ['lint', 'uglify']);
      grunt.registerTask('dev', 'Watch all js and css files for changes and rebuld appropriatly',
                        ['lint', 'build', 'express', 'watch']);
    

    Furthermore, a source map could be used in the uglify task for nice in browser debugging in the chrome tools:

     uglify: {
          target: {
            options: {
              sourceMap: true,
              sourceMapIncludeSources: true,
              sourceMapRoot: 'source/javascripts'
            },
            files: { 'dist/timesheet.js': 'source/javascripts/timesheet.bubble.js', 'source/javascripts/timesheet.js' }
          },
        },
    

    I have a js project template i usually use, it has a working build file with these features, here is the gruntfile and a blog post describing it.

    Is this something anybody would want me to implement ?

    opened by adelciotto 2
  • Fixed spacing in README

    Fixed spacing in README

    I fixed an issue in spacing in the README. There was an unnecessary space between "Middleman" and the ellipses. Please see screenshot for the issue:

    image

    opened by wwwillchen 2
  • timesheet-white.min.css not working

    timesheet-white.min.css not working

    Hi timesheet-white.min.css not working, suppose i will see a white color style timesheet on screen. Please help

    
    <link rel="stylesheet" href="<?= plugin_dir_url(__FILE__) ?>/library/timesheet/timesheet-white.min.css">
    <script src="<?= plugin_dir_url(__FILE__) ?>/library/timesheet/timesheet.min.js"></script>
    <div id="timesheet-default"></div>
    <script>
    new Timesheet('timesheet-default', 2002, 2013, [
      ['2002', '09/2002', 'A freaking awesome time', 'lorem'],
      ['06/2002', '09/2003', 'Some great memories', 'ipsum'],
      ['2003', 'Had very bad luck'],
      ['10/2003', '2006', 'At least had fun', 'dolor'],
      ['02/2005', '05/2006', 'Enjoyed those times as well', 'ipsum'],
      ['07/2005', '09/2005', 'Bad luck again', 'default'],
      ['10/2005', '2008', 'For a long time nothing happened', 'dolor'],
      ['01/2008', '05/2009', 'LOST Season #4', 'lorem'],
      ['01/2009', '05/2009', 'LOST Season #4', 'lorem'],
      ['02/2010', '05/2010', 'LOST Season #5', 'lorem'],
      ['09/2008', '06/2010', 'FRINGE #1 & #2', 'ipsum']
    ]);
    </script>
    

    Thanks Peter

    opened by quantrpeter 1
  • Years section misaligned

    Years section misaligned

    Hi there,

    Awesome plugin! I've been trying to use it with bootstrap by inserting the timesheet in a row and the years section is aligned to the center. Need some guidance please?! Any suggestions? screen shot 2016-02-27 at 15 58 17

    opened by franciscoamado 1
  • Why 5400 stars ??

    Why 5400 stars ??

    No support for days, no responsiveness, no scrolling, no export as image. Actually, I am not even mad, its amazing.

    Tried to change to scale to days. too much work for me. So i am using jquery gantt. Not as pretty, but gets the job done.

    opened by amrutraj 1
  • avoid creating several global variables

    avoid creating several global variables

    It would be great if Timesheet could use only a single Timesheet global variable rather than using TimesheetBubble as well. the Bubblecould be stored atTimesheet.Bubble`` if it needs to be exposed

    bug enhancement 
    opened by stof 1
  • Allowing to pass a container rather than a container id

    Allowing to pass a container rather than a container id

    It would be great to allow passing a DOM element for the container rather than forcing to pass an id. This would allow building a timesheet on elements which don't have an id.

    enhancement 
    opened by stof 1
  • Container ID

    Container ID

    Could the container ID be more consistent in the hosted page, or instead mention it in the instruction or readme file? My initial experience was a console error.

    On the GitHub hosted page: <div id='timesheet-default'></div> could just become <div id='timesheet'></div>, or mention you can specify a container ID.

    Edit: Also related to #4, add a note describing what the array values do.

    bug enhancement 
    opened by plfstr 1
  • Handle years less than 100.  (Y2k bug)

    Handle years less than 100. (Y2k bug)

    From the example,

      new Timesheet('timesheet', 100, 105, [
        ['103', 'Had very bad luck'],
        ['10/103', '106', 'At least had fun', 'dolor'],
        ['02/105', '05/106', 'Enjoyed those times as well', 'ipsum'],
        ['07/105', '09/105', 'Bad luck again', 'default'],
        ['10/105', '108', 'For a long time nothing happened', 'dolor'],
        ['01/108', '05/109', 'LOST Season #4', 'lorem'],
        ['01/109', '05/109', 'LOST Season #4', 'lorem'],
        ['02/110', '05/110', 'LOST Season #5', 'lorem'],
        ['09/108', '06/110', 'FRINGE #1 & #2', 'ipsum']
      ]);
    

    works fine, but

      new Timesheet('timesheet', 50, 55, [
        ['53', 'Had very bad luck'],
        ['10/53', '56', 'At least had fun', 'dolor'],
        ['02/55', '05/56', 'Enjoyed those times as well', 'ipsum'],
        ['07/55', '09/55', 'Bad luck again', 'default'],
        ['10/55', '58', 'For a long time nothing happened', 'dolor'],
        ['01/58', '05/59', 'LOST Season #4', 'lorem'],
        ['01/59', '05/59', 'LOST Season #4', 'lorem'],
        ['02/60', '05/60', 'LOST Season #5', 'lorem'],
        ['09/58', '06/60', 'FRINGE #1 & #2', 'ipsum']
      ]);
    

    yields a blank timeline with correct years marked.

    opened by jbaber 1
  • Will you add day support ?

    Will you add day support ?

    Hi,

    Great improvement of TimeSheet.js !

    I'm looking for a "day" feature (not only months). Would you plan to add it ? I found https://github.com/gisce/timesheet.js but I can't manage to make it work...

    Thanks for your answer :)

    opened by SebFourault 0
  • Not issue, just fixed columns width...

    Not issue, just fixed columns width...

    I added these css properties to make years columns equal width... Thanks for you code.

    .timesheet .scale { height: 100%; width: 100%; display: table; table-layout: fixed; } .timesheet .scale section { min-width: 10%; display: table-cell; text-align: center; height: 100%; } .timesheet .data { overflow: hidden; margin-top: 50px; }

    opened by mrquarter81 0
  • About the version tag

    About the version tag

    Hi, I'm going to host this lib on cdnjs.

    Can you add the version tag? It can help me to config git auto-update.

    Thanks! https://github.com/cdnjs/cdnjs/issues/5928

    opened by x09326 2
Owner
Sebastian Müller
Smash Patriarchy & Fight Fascism! AWS Serverless Hero, Certified AWS Solutions Architect, and GraphQL Expert.
Sebastian Müller
Grupprojekt för kurserna 'Javascript med Ramverk' och 'Agil Utveckling'

JavaScript-med-Ramverk-Laboration-3 Grupprojektet för kurserna Javascript med Ramverk och Agil Utveckling. Utvecklingsguide För information om hur utv

Svante Jonsson IT-Högskolan 3 May 18, 2022
Hemsida för personer i Sverige som kan och vill erbjuda boende till människor på flykt

Getting Started with Create React App This project was bootstrapped with Create React App. Available Scripts In the project directory, you can run: np

null 4 May 3, 2022
Kurs-repo för kursen Webbserver och Databaser

Webbserver och databaser This repository is meant for CME students to access exercises and codealongs that happen throughout the course. I hope you wi

null 14 Jan 3, 2023
Modernizr is a JavaScript library that detects HTML5 and CSS3 features in the user’s browser.

Modernizr is a JavaScript library that detects HTML5 and CSS3 features in the user’s browser. Read this file in Portuguese-BR here Our Website is outd

Modernizr 25.4k Jan 3, 2023
Challenge [Frontend Mentor] - In this challenge, JavaScript was used to filter jobs based on the selected categories. Technologies used: HTML5, CSS3 and React.

Getting Started with Create React App This project was bootstrapped with Create React App. Available Scripts In the project directory, you can run: np

Rui Neto 11 Apr 13, 2022
Variation-template - Variation is a PSD template that is covered into a web template using HTML5, CSS3, Bootstrapv4.6, JavaScript.

Variation Template Design Variation is a PSD website template. In this project this template is designed with HTML. Deployment This site is deployed a

Bipronath Saha 1 Jan 1, 2022
Challenge [Frontend Mentor] - In this challenge, JavaScript was used to filter jobs based on the selected categories. Technologies used: HTML5, CSS3 and React.

Frontend Mentor - Job listings with filtering Front-end challenge focused on javascript logic, where a list of fictitious vacancies is presented and t

Rui Neto 11 Apr 13, 2022
Simple To-do list build using HTML5, CSS3, JavaScript and Webpack. You can add new tasks, remove and edit them.

Simple To-do list build using HTML5, CSS3, JavaScript and Webpack. You can add new tasks, remove and edit them.

Esteban Munoz 6 Mar 5, 2022
An HTML5/CSS3 framework used at SAPO for fast and efficient website design and prototyping

Welcome to Ink Ink is an interface kit for quick development of web interfaces, simple to use and expand on. It uses a combination of HTML, CSS and Ja

SAPO 1.9k Dec 15, 2022
This Project is made with HTML5, CSS3, ReactJS, Axios, MetaMask, thirdweb, Rinkeby Test Network, Web 3.0 Technologies, and OpenSea API.

Abstract Collections This Project is made with HTML5, CSS3, ReactJS, Axios, MetaMask, thirdweb, Rinkeby Test Network, Web 3.0 Technologies, and OpenSe

Shobhit Gupta 34 Jan 4, 2023
Project [Personal] - Web application for managing habits. Technologies used: HTML5, CSS3 and React.

TrackIt Habit manager in a dynamic, clear and simple way. TackIt is an application that seeks to make it simple and accessible for any user to control

Rui Neto 13 Dec 31, 2022
HTML5 CSS3 vanilla js QR code generator with download options

QR Code Generator HTML5 CSS3 vanilla js QR code generator with download options Additional description about the project and its features. Built With

yassine joundi 2 May 13, 2022
A webpack based todo list with HTML5, CSS3, JS and linters

Project Name This is a project to track your daily tasks as a todo list. This project doesn't have a backend so data gets saved in you local storage.

Ritobroto Mukherjee 19 Aug 22, 2022
A planetary body simulator with a HTML5/CSS3/JS frontend and simulated using Rust WebAssembly.

Solar Sim ?? A planetary body simulator with a HTML5/CSS3/JS frontend and simulated using Rust WebAssembly. Try the latest version here! Built with ??

Ben Plate 3 Jun 15, 2022
Responsive, interactive and more accessible HTML5 canvas elements. Scrawl-canvas is a JavaScript library designed to make using the HTML5 canvas element a bit easier, and a bit more fun!

Scrawl-canvas Library Version: 8.5.2 - 11 Mar 2021 Scrawl-canvas website: scrawl-v8.rikweb.org.uk. Do you want to contribute? I've been developing thi

Rik Roots 227 Dec 31, 2022
Google Sheets as a Database - Next.js Demo

Google Sheets as a Database Use Google Sheets as a primary database for your Next.js project. Watch on YouTube or follow allong with the full Google S

Fireship 45 Dec 8, 2022
A place for all of my cheat sheets.

Who doesn't love cheat sheets? This repository will behold all of my cheat sheets in the future! At the moment, you will find: Languages Prolog Data S

Amine Haj Ali 24 Jun 9, 2022
How to submit HTML forms to Google Sheets. (Updated for 2021 Script Editor)

Submit a HTML form to Google Sheets How to submit a simple HTML form to a Google Sheet using only HTML and JavaScript. Updated for Google Script Edito

Levi Nunnink 314 Jan 6, 2023
Lightweight basic CSS style sheets.

Styled CSS Base Lightweight basic CSS style sheets. If you get tired of setting up a comprehensive styling scaffold, you may try returning back to thi

Zheeeng 19 Oct 21, 2022