jinkela-schedule
v1.0.0
Published
A Schedule on Jinkela
Downloads
3
Readme
Jinkela-Schedule
Install
npm install jinkela-schedule
Usage
new Schedule([args])
args
Object Set of configurable options to set. Can have the following fields:defaultValue
Any The default value.readonly
Bool Disable it.left
Object<Date> The left edge of the schedule, defaults now.right
Object<Date> The right edge of the schedule, defaults now + 2day.step
Object<Number> The moving step, defaults (right - left) / 24.points
Object<Date> Show specials time point in schedule.
Demo
<script src="https://unpkg.com/[email protected]/umd.js"></script>
<script src="https://unpkg.com/[email protected]/index.js"></script>
<script>
addEventListener('DOMContentLoaded', () => {
let schedule = new Schedule({
width: 500,
left: new Date(2017, 7, 1),
right: new Date(2017, 8, 1),
step: 864E5,
points: {
立秋: new Date(2017, 7, 7),
处暑: new Date(2017, 7, 23),
九月: new Date(2017, 8, 1)
},
defaultValue: [ new Date(2017, 7, 5), new Date(2017, 7, 18) ]
}).to(document.body);
});
</script>