Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

not able to add events in calendar #12

Open
NetDevM opened this issue Aug 22, 2020 · 0 comments
Open

not able to add events in calendar #12

NetDevM opened this issue Aug 22, 2020 · 0 comments

Comments

@NetDevM
Copy link

NetDevM commented Aug 22, 2020

export default [
{ title: 'DTS STARTS', start: new Date(2020, 8, 20), end: new Date(2020, 8, 23), bgColor: '#D9D9D9' } ];

above is the event data

and below is fullcalendar.js

``import React, { Component } from 'react';
import BigCalendar from 'react-big-calendar';
import moment from 'moment';
import 'react-big-calendar/lib/css/react-big-calendar.css';
import './FullCalendar.css';
import events from './events';

BigCalendar.momentLocalizer(moment);

class FullCalendar extends Component {
render() {
const views = ['month', 'week', 'day'];
const messages = {
previous: 'back',
next: 'next'
};
const eventsdata=events;

return (
  <div className="full-calendar-wrapper">
    <BigCalendar
      events={eventsdata}
      startAccessor="startDate"
      endAccessor="endDate"
      views={views}
      defaultView="month"
      messages={messages}
      selectable
      onSelectEvent={event => alert(event.title)}
      onSelectSlot={slotInfo =>
        alert(
          `selected slot: \n\nstart ${slotInfo.start.toLocaleString()} ` +
            `\nend: ${slotInfo.end.toLocaleString()}` +
            `\naction: ${slotInfo.action}`
        )
      }
    />
  </div>
);

}
}
``

export default FullCalendar;
https://snipboard.io/kMm2EC.jpg

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant