day_date display

Hello,

i would like to display the day_date (scheduler.templates.day_date) as another than default format something like "%l %d %F %Y but i can’t get it :confused:

Can anyone help me ?

You can redefine day_date config, it will change the format of displayed date.
Code like following should work:
scheduler.config.day_date = “%l %d %F %Y”;
docs.dhtmlx.com/scheduler/api__s … onfig.html

Hello Thx for answering,
but no i dit it already, and it change the date onthe week view only, i cant find the way to change it on unit view


Hi,
each view has it’s own config and template, that defines date format and content of the header. They all named by following pattern
scheduler.config.{viewName}_date, e.g. scheduler.config.week_date
scheduler.template.{view_name}_date, e.g. scheduler.template.timeline_date

Template is a function that returns HTML string to be placed into header, the default implementation returns active date in format defined in {viewName}_date config

If you want to change format of units view, you should override related config as well:
scheduler.config.day_date = scheduler.config.unit_date = “%l %d %F %Y”;

it may miss something, i tryed this already and it’s not changing, i copy pasted your code, and it’s not working aswell.

Any idea ?

Here is my config code

		scheduler.locale.labels.unit_tab = "Salarié"
		scheduler.locale.labels.section_custom="Salarié";
		scheduler.locale.labels.section_client="Client";
		scheduler.locale.labels.section_time="Heure";
		scheduler.config.first_hour = 8;
      scheduler.config.last_hour = 18;
      scheduler.config.multi_day = true;
		/*scheduler.locale.labels.section_time="Heure";*/
		scheduler.config.details_on_create=true;
		scheduler.config.details_on_dblclick=true;
		/*scheduler.config.drag_resize = false;
      scheduler.config.drag_move = false;
      scheduler.config.drag_create = false;*/
		scheduler.config.xml_date="%Y-%m-%d %H:%i";

		scheduler.config.day_date = scheduler.config.unit_date = "%l %d %F %Y";
		
scheduler.templates.week_date_class=function(date,today){
			return "custom_color";	
		}

		
		scheduler.config.lightbox.sections=[	
			{name:"description", height:25, map_to:"text", type:"select", options:interventions , focus:true},
			{name:"custom", height:25, type:"select", options:sections, map_to:"section_id" },
			{name:"client", height:25, type:"select", options:sections2, map_to:"section2_id" },
			{name:"time", height:25, type:"time", map_to:"auto"}
		]
		
		scheduler.createUnitsView({
			name:"unit",
			property:"section_id",
			list:sections
		});
		
		scheduler.config.multi_day = true;

scheduler.init('scheduler_here',new Date(),"unit");

Try to change it as

scheduler.config.default_date = "%l %d %F %Y";

docs.dhtmlx.com/scheduler/api__s … onfig.html

You can also override templates directly

scheduler.templates.unit_date = scheduler.templates.day_date = function(date){ return scheduler.date.date_to_str("%l %d %F %Y")(date); };make sure to specify .unit_date template after scheduler.createUnitsView call

Finnaly it works ! Thx

scheduler.config.default_date = “%l %d %F %Y”;