Skip to content

alexandreGUY/envoc.simple-calendar

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

simple-calendar

app.module('foo', ['envoc.simpleCalendar'])

app.controller('MainCtrl', function($scope) {
    $scope.events = [
        {
            name: 'foo',
            date: '5-2-15'
        },
        {
            name: 'bar',
            date: new Date()
        }
    ];
});
<simple-calendar date="date" events="events"></simple-calendar>

// or

<simple-calendar date="date" events="events">
  <simple-calendar-day>{{$day.day}}</simple-calendar-day> <!-- optional -->
  <simple-calendar-event>{{$event.name}}</simple-calendar-event> <!-- optional -->
</simple-calendar>

simpleCalendarConfig constant that allows setting config values.

  • simpleCalendarConfig.weekStart = 1 set start date = Monday. respects Date.prototype.getDay (default 0, Sunday)

  • simpleCalendarConfig.onDayClick = function onDayClick(day){}

  • simpleCalendarConfig.onEventClick = function onEventClick(event, day){}

  • The calendar simply displays the month of the date is it bound to.

  • Adds a has-events class on days with events if you pass in an event collection

  • Does not implement month title or next/prev. You can accomplish this by showing the date it is bound to or manuipulating the bound date. See demo for example.

  • If you care to display the events, you can include the simple-calendar-event referenced above

Demo

simple calendar

customized calendar

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 72.4%
  • HTML 16.6%
  • CSS 11.0%