Default time Full day


#1

Hello,

I’m an intern, and I need more explication for an option : full day.

How I can change the time in full day ? Instead of having 00:00 as time by default, I shall like having 08:30 - 17:30. http://prntscr.com/f8sb3h

I add the option “full-day” to true.
I am using dhtmlxscheduler MVC sample
Thanks a lot,
Dargie


#2

Hello,

You need to redefine source code to set another values for start and end dates instead of 00:00
github.com/DHTMLX/scheduler/blo … r.js#L5283


#3

Thanks you, I’ll check that !


#4

mmh, I think we haven’t the same source code :neutral_face: . I don’t find the code source.

EDIT : I think I found the source code, but, I don’t undestand what I have to change :blush:.
I think that that’s it :

scheduler.config.wide_form||(h=e.previousSibling.innerHTML+h),e.previousSibling.innerHTML=h,e._full_day=!0}var _=e.previousSibling.getElementsByTagName("input")[0];_.checked=0===scheduler.date.time_part(i.start_date)&&0===scheduler.date.time_part(i.end_date),o[l[0]].disabled=_.checked,o[l[0]+o.length/2].disabled=_.checked,_.onclick=function(){if(_.checked){var t={};scheduler.form_blocks.time.get_value(e,t,s),n=scheduler.date.date_part(t.start_date),r=scheduler.date.date_part(t.end_date),(+r==+n||+r>=+n&&(0!==i.end_date.getHours()||0!==i.end_date.getMinutes()))&&(r=scheduler.date.add(r,1,"day"));


#5

I did not manage to solve my problem… :frowning:


#6

Hello,

Please, check in the sample how to redefine function, lines 26-36:
docs.dhtmlx.com/scheduler/snippet/11a710eb


#7

Thanks that helped me a lot. However, it seem I haven’t the same source code as you. Even, when I create a new function with that, it doesn’t work.
Did I badly understand the procedure?


#8

You need to put this function “scheduler.form_blocks.time.set_value” from the snippet before the settings of Scheduler (changing the source file is not good idea if you will update Scheduler).
Have you done it in such way?


#9

Hello,

Thanks you for your patience. I followed the code you gave me, I forgot put the function (“scheduler.form_blocks.time.set_value” ) thats why I’m getting an error.
Now, I haven’t error, but it’s still not working.

[code]scheduler.form_blocks.time.set_value = function (node, value, ev, config) {
var cfg = scheduler.config;
var s = node.getElementsByTagName(“select”);
var map = config._time_format_order;
var start_date, end_date;

scheduler.form_blocks.time.get_value(node, obj, config);

start_date = scheduler.date.date_part(obj.start_date);
end_date = scheduler.date.date_part(obj.end_date);

start_date.setHours(9);
start_date.setMinutes(00);

end_date.setHours(17);
end_date.setMinutes(30);

}[/code]

(as you can see : prntscr.com/f9mieg )


#10

Hi,
Which version of Scheduler do you use?
It wiil be nice if you could provide with the access to your application.


#11

Hello,

I am using the 3.3.257 version DHTMLX.Scheduler.NET.(prntscr.com/fanxx4) I don’t use the sample mvc 3 dhtmlxscheduler.

How can I do that ?


#12

It’s working now ! it seem was a conflict with calendar picker. So I modified this property :

{ name: "time", height: 200, type: "calendar_time", map_to: "auto" },

to : { name: "time", height: 200, type: "time", map_to: "auto" },

There is a possibility to keep the calendar picker with the full day ?


#13

Hello,

i have the same question.
What is with type calender_time???

The Script is excelent but this full day plus one day is really confusing the end users.


#14

Hello @IFM,

There is no public API for that, but you can change the initial/end time of the full day events by redefining the “set_value” method of the extension.

It may look like in the following demo:
http://snippet.dhtmlx.com/5/078ab11f3

Here is the important part:

        nulledStart_date = scheduler.date.date_part(obj.start_date);
        nulledEnd_date = scheduler.date.date_part(obj.end_date);
        start_date = new Date(scheduler.date.add(nulledStart_date, 8, "hour"));
        end_date = new Date(scheduler.date.add(nulledEnd_date, 19, "hour"));

nulledStart_date/nulledEnd_date are dates of the event with zero time part(hours, minutes). So you can add the required count of hours/minutes to make the initial values you want.


#15

Hello,

thanks for the response.
I changed now the mini calender script.

BR