npm.io
0.0.8 • Published 7 years ago

sometime

Licence
MIT
Version
0.0.8
Deps
5
Size
378 kB
Vulns
0
Weekly
0
Stars
16
calendar visualization

work-in-progress

renders html calendars using spacetime date library

demo:

npm i sometime

image

const sometime = require('sometime')
let el = document.querySelector('body')

let cal = sometime.year.weekAlign('2019')
cal.color('june 5th 2019', 'june 8th 2019', 'red')
el.innerHTML = cal.build()

byMonth() renders a typical calendar-representation:

let cal = sometime.quarter.byMonth('june 1 2019')
cal.color('june 5th 2019', 'june 8th 2019', 'red')
el.innerHTML = cal.build()

image

Output

by default, it returns html strings, but...

output is handled with Jason Miller's htm package, so it can output to a React template, or anything:

const sometime = require('sometime')
const react = require('react')

let c = sometime.year.leftAlign('2019')
c.bind(react.createElement) // anything

See also: