explaingit

sbstjn/timesheet.js

6,982JavaScriptAudience · developerComplexity · 2/5LicenseSetup · easy

TLDR

A lightweight JavaScript library that renders horizontal timeline charts on a web page, showing dated events and periods as color-coded bars with no external dependencies.

Mindmap

mindmap
  root((repo))
    What it does
      Timeline charts on web
      Shows events and date ranges
      Color-coded categories
    Tech used
      JavaScript
      CSS
      Grunt build tool
    Features
      Month or year precision
      No external dependencies
      Customizable colors
    Setup
      Include JS and CSS files
      Add a div element
      Call Timesheet function
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Display your work history as a horizontal timeline on a personal portfolio web page.

USE CASE 2

Visualize a project's milestones and phases as a chart embedded in a dashboard or report.

USE CASE 3

Show a team member's assignment history with color-coded project categories.

Tech stack

JavaScriptCSSGrunt

Getting it running

Difficulty · easy Time to first run · 5min
Use freely in any personal or commercial project as long as you keep the copyright notice.

In plain English

Timesheet.js is a small JavaScript library for displaying timeline charts on a web page. A timeline chart shows events or periods spread across a horizontal time axis, which makes it useful for visualizing work history, project history, or any sequence of dated events. To use it, you include two files in your HTML page: a JavaScript file and a CSS file, both found in the project's dist folder. You then add a single empty div element to your page, give it an ID, and call the Timesheet function in JavaScript, passing in a start year, an end year, and an array of events. Each event is a row in the chart, with a start date, an optional end date, a label, and an optional color category. Dates can be specified as just a year or as a month and year. The library renders the chart using standard HTML and CSS, with no external charting dependencies. Color categories let you visually group related events using different colors, which the included CSS defines using named classes like lorem, ipsum, and dolor (placeholder names from the example, which you would replace with your own category names). The project is packaged with Grunt, a JavaScript build tool. Running grunt builds the files in the dist folder. There is also a local development server command for previewing and customizing the output. The library is released under the MIT license, meaning it can be used freely in personal or commercial projects.

Copy-paste prompts

Prompt 1
Using timesheet.js, write the HTML and JavaScript to display a career timeline with three jobs: Designer at Acme 2019 to 2021, Developer at Beta 2021 to 2023, each in a different color category.
Prompt 2
I have a list of project milestones with start and end dates as month and year strings. Write the timesheet.js array format I need to pass to the Timesheet constructor.
Prompt 3
How do I replace the placeholder color class names like lorem and ipsum in timesheet.js with my own category names and custom CSS colors?
Open on GitHub → Explain another repo

← sbstjn on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.