0

I am dynamically implementing the events in calendar using javascript.

Let me tell you how it actually build

  1. Clicking a button opens a BS 4 modal.
  2. Modal container daterangepicker ( I am using it just for date not for time )
  3. For selection of time I have added custom select options.
  4. add event fields name, description etc.
  5. after clicking the add button modal disapper and the event is successfully add.

So what's the problem.

The problem is when I statically add the event it gets me this ( The expected result );

enter image description here

But,,

When I try to do it dynamically it gets me this ( Non Expected result );

enter image description here

So to know that my time is implementing I have used eventClick(); which is in-built in fullcalendar

eventClick: function(info) {
    console.log(info);
    console.log(info.start._i);
    console.log(info.end._i);
}

info.start._i get the date with time as expected and info.end._i get the date with time as expected. So why I am getting non expected result.

ADyson
  • 57,178
  • 14
  • 51
  • 63
Owaiz Yusufi
  • 849
  • 1
  • 14
  • 34
  • 1
    This is all very interesting, but we can't magically guess what you did wrong in your invisible code. We'd like to help you, but without seeing some relevant code and sample data, it's not really possible. I'm sure you would agree you would have the same difficulty if someone else gave you this description and you had never seen their application before. Please can you update your question to contain enough useful detail? Thanks. – ADyson Apr 23 '19 at 14:31
  • P.S. please also tell us your version of fullCalendar, since the way of writing the calendar code is very different in the newly released v4 than it was in v3 and earlier. – ADyson Apr 23 '19 at 14:34
  • Possible duplicate of [Fullcalendar end date wrong by one day](https://stackoverflow.com/questions/27407052/fullcalendar-end-date-wrong-by-one-day) – Owaiz Yusufi May 30 '19 at 04:20

1 Answers1

0

So I have figured it out the issue is allDay is true is should be set to false

Owaiz Yusufi
  • 849
  • 1
  • 14
  • 34