Skip to content

danilomilano/cycle-calendar

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cycle-calendar

Usage

Installation

npm install cycle-calendar

Props

cycle-calendar requires the following props:

  • value: Initial date value
  • start: Day the calendar week starts on (Sunday == 0)
  • monthNames: An array of names for months
  • dayNames: An array of names for days

Example

const calendar = Calendar({
  DOM,
  props: xs.of({
      value: new Date(),
      start: 1,
      monthNames: ['January', 'February', 'March', 'April', …],
      dayNames: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
    })
    .remember()
})

return {
  DOM: xs.combine(calendar.DOM, calendar.value)
    .map(([vdom, value]) =>
      div([
        vdom,
        div(`Selected: ${value.toString()}`)
      ])
    )
}

Development

Demo

npm run dev

Building

Node Module

make lib

Outputs transpiled js files to lib.

Browser Module

make dist

Outputs browserified and minified files to dist.

About

Simple calendar component for Cycle.js apps

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 70.2%
  • CSS 27.1%
  • Makefile 2.7%