Renaming Days and Default View

Hi, I had some questions I hope people could help with!

How can I change it so that the full day names headers (Monday, Tuesday) etc get changed to Mon, Tue, Wed, etc on mobile?

How can I change default to land on Monthly?

Lastly, is there a way to input a new date using syntax such as

{ id:1, start_date:"2017-05-13 6:00", end_date:"2017-05-13 8:00", text:"Event 1"}

I’m hoping to grab the data from a db, store in local variables and then loop it to create as many dates as needed.

Hello @jbrown88

Yes, all requested functionality is possible but I don’t have enough info to provide a detailed reply for your case.

To change the format from Monday to Mon, please use Date Format Specification.

There are several templates to configure labels of various elements and in different views, please choose the required one on the page here https://docs.dhtmlx.com/scheduler/templates.html

To get access to the data of the event object, there are API events to get the event id.
Then please use the getEvent method to return the event object by id parameter.

Thank you a lot for your help.

I’m trying to add the functionality for creating an event now, but running into an issue. I keep getting an error when trying to create an appointment using the below:

<script>scheduler.addEvent({
    start_date: '16-06-2020 09:00',
    end_date:   '16-06-2020 12:00',
    text:   'Meeting',
  });</script>

The error

Uncaught TypeError: this.templates.api_date is not a function
    at Object.g.addEvent (dhtmlxscheduler.js:219)
    at appointments.php:169 

My initialisation of the scheduler is as such. Am I doing something wrong?

scheduler.config.drag_create = false;
scheduler.config.responsive_lightbox = true;

scheduler.templates.api_date = function(date){
  return scheduler.date.str_to_date(scheduler.config.api_date);

}

function resetConfig(){
  let header;
  if (window.innerWidth < 1000) {
      header = compactHeader;
  } else {
      header = fullHeader;

  }
  scheduler.config.header = header;
  return true;
}
resetConfig();
scheduler.attachEvent("onBeforeViewChange", resetConfig);
scheduler.attachEvent("onSchedulerResize", resetConfig);


scheduler.init("scheduler_here");

@jbrown88

Please pay attention that you should call addEvent() after init(). Check the sample where the error doesn’t occur: http://snippet.dhtmlx.com/5/c2b309118

Most likely no. It is not 100% because I can’t see how it works and it is only part of your code.
I see that the first call of resetConfig() is before the initialization. Does it make sense in your implementation?