0

I am using the Fullcalendar library, and I have an array of JavaScript objects:

arr = [{"monday":{"start_time":9,"end_time":10.5},"title":"English for Beginer"},{"tuesday":{"start_time":8.5,"end_time":10},"title":"English for Beginer"},{"wednesday":{"start_time":8.5,"end_time":10},"title":"English for Beginer"}]

According to the doc, I can set up my event sources like this:

{
    events: [
        {
            title: 'Event1',
            start: '2011-04-04T09:30',
            end: '2011-04-04T10:30',

        },
        {
            title: 'Event2',
            start: '2011-05-05T9:30',
            end: '2011-04-04T10:30',
        }
        // etc...
    ],
    color: 'yellow',   // an option!
    textColor: 'black' // an option!
}

However, I only have the days in a week in my JavaScript objects, like monday, tuesday, wednesday, etc as you can see. Therefore, I am wondering if there is a way for me to configure my event sources like the following:

{
        events: [
            {
                title: 'Event1',
                start: 'MondayT09:30',
                end: 'MondayT10:30',

            },
            {
                title: 'Event2',
                start: 'TuesdayT9:30',
                end: 'TuesdayT10:30',
            }
            // etc...
        ],
        color: 'yellow',   // an option!
        textColor: 'black' // an option!
    }

I have been looking for a solution for a while, but still can't find one. Any suggestions or idea would be appreciated.

Fatima
  • 345
  • 1
  • 5
  • 15

1 Answers1

0

without date set in event.start variable fullcalendar will not be able to display your event. Please see fullCalendar documentation

Event.Start date is required field. Your JSON needs some information about date when your event starts.

When you want to create recurring event, you can use event.dow parameter like this:

events: [
  {
    title: 'All Day Event',
    start: '2017-05-22'
  }, 
        {
    title: 'Sviatok práce',
    start: '00:00 ',
    end: '24:00',
          dow: [1,2,3,4,5]
  },
  • Thank you for your answer. However, I already know this. So, that is only option I have? Do you know any other schedulers/calendar javascripts working with just days? – Fatima May 23 '17 at 18:12
  • no ... i am using FullCalendar where Date is required. In fact i don't understand how you want to display in any calendar event using only weekday without exact date. – user8054524 May 23 '17 at 18:15
  • Cool. It is understandable when I just want to generate a timetable for students. There is no need to specify dates for their courses since these courses will repeat until the students finish them. – Fatima May 23 '17 at 18:18
  • 1
    ok, so this maybe helps you. https://stackoverflow.com/questions/15161654/recurring-events-in-fullcalendar – user8054524 May 23 '17 at 19:06