Calendar customization - healthcare

Hello! I’ve been trying to customize the calendar of the Patient Appointment. I’m new to programming, so I’ve been using fullcalendar as a reference to modify the patient_appointment_calendar.js file, but I can’t make it work.

Basically, I need the calendar to show only the working hours of the company (from 9 AM to 7 PM) and to reduce the slot duration to 10 minutes (currently is 30 minutes), which is the minimum appointment duration. With that in mind, I’ve made the following changes, with no result:

image

What should I change to make it work?

Also, Is it possible to set the appointment date and time by selecting a calendar slot? Currently, It takes you to the appointment creation screen, where you have to select those values again. I understand that the schedules depends on the Practitioner, but maybe if we filter that on the calendar view so the values of those fields are already selected when the appointment is being created?

I think this feature would be great to make the appointment creation quicker for the user.

Any help will be greatly appreciated!

1 Like

Try this

field_map: {
    'start': 'start',
    'end': 'end',
    'id': 'name',
    'title': 'title',
    'allDay': 'allDay',
    'eventColor': 'color'
  },
  options: {
    minTime: '09:00:00',
    maxTime: '19:00:00'
  }
};
5 Likes

Thanks you! It worked great

Welcome. Glad to help.

1 Like

Hi again! I have another question, and is related to calendar customization in general.

I’ve made a calendar view for a custom doctype, and I need to change the hours visualization (with the minTime and maxTime).

To achieve this, do I have to create a ***_calendar.js file on the custom doctype folder or when a calendar view is created, a calendar.js file is also created and I can work on it?

I’ve been looking through the folders and I couldn’t find any calendar.js file for the custom doctype, so I suppose the first option is the way to go, but maybe I didn’t look on the right places (I went to desk/doctype/calendar_view, and also to the custom doctype folder).

Thanks

Can i add another time period that repeated every year ?