GithubHelp home page GithubHelp logo

ng2-fullcalendar's Introduction

Angular 2: FullCalendar component

An Angular 2 component for fullcalendar.

Installation

npm install angular2-fullcalendar --save

Usage

####Import the calendar component

import {CalendarComponent} from "angular2-fullcalendar/src/calendar/calendar";
// other imports 

@NgModule({
  declarations: [
    // other declarations 
    CalendarComponent
  ],
  // ...
})
export class AppModule {}

Add config in my-component.ts

For a full list of options available, please refer to fullcalendar.io documentation at https://fullcalendar.io/docs/

@Component({
  selector: 'my-component',
  templateUrl: 'my-component.html'
})
export class MyComponent{
    calendarOptions:Object = {
        height: 'parent',
        fixedWeekCount : false,
        defaultDate: '2016-09-12',
        editable: true,
        eventLimit: true, // allow "more" link when too many events
        events: [
          {
            title: 'All Day Event',
            start: '2016-09-01'
          },
          {
            title: 'Long Event',
            start: '2016-09-07',
            end: '2016-09-10'
          },
          {
            id: 999,
            title: 'Repeating Event',
            start: '2016-09-09T16:00:00'
          },
          {
            id: 999,
            title: 'Repeating Event',
            start: '2016-09-16T16:00:00'
          },
          {
            title: 'Conference',
            start: '2016-09-11',
            end: '2016-09-13'
          },
          {
            title: 'Meeting',
            start: '2016-09-12T10:30:00',
            end: '2016-09-12T12:30:00'
          },
          {
            title: 'Lunch',
            start: '2016-09-12T12:00:00'
          },
          {
            title: 'Meeting',
            start: '2016-09-12T14:30:00'
          },
          {
            title: 'Happy Hour',
            start: '2016-09-12T17:30:00'
          },
          {
            title: 'Dinner',
            start: '2016-09-12T20:00:00'
          },
          {
            title: 'Birthday Party',
            start: '2016-09-13T07:00:00'
          },
          {
            title: 'Click for Google',
            url: 'http://google.com/',
            start: '2016-09-28'
          }
        ]
      };
  }
}

Add selector in template file my-component.html

<angular2-fullcalendar [options]="calendarOptions"></angular2-fullcalendar>

Import the fullcalendar css

If you're using Angular CLI, this is as simple as including one line in your style.css file:

@import "fullcalendar/dist/fullcalendar.min.css";

Alternatively, you can just reference the file directly. This would look something like

<link href="node_modules/fullcalendar/dist/fullcalendar.min.css" rel="stylesheet">

TODO's

  • Tests

ng2-fullcalendar's People

Contributors

lbertenasco avatar nekken avatar derzyklop avatar geirmarius avatar pcassis avatar xuantan97 avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.