scheduler.date.units_start = function (date) {
return scheduler.date.week_start(date);
};
this code now work for me in units view. I want always interval start from start of week
Hello @sergii.khilchuk13,
As I understand from question, your requirement is to force the Unit
view always start from Monday and something goes wrong in your case, am I right?
If so, it’s hard to suppose what exactly goes wrong in your case, as the issue isn’t reproduces on my end, with the following config:
scheduler.createUnitsView({
name:"unit",
property:"unit_id", //the mapped data property
list:[ //defines the units of the view
{key:1, label:"Section A"},
{key:3, label:"Section C"}
],
days: 7
});
scheduler.date.unit_start = function (date) {
return scheduler.date.week_start(date);
};
Here is a demo:
https://snippet.dhtmlx.com/k3hwov12
As you can see, the view always starts from the monday
, regardless of the date passed to the scheduler.init
method.
The issue could be connected with the incorrect name in the unit_start
as the first part should be the same, that you used as the name
of the createUnitsView
config, so you can check this point.
If the issue still exists, could you please reproduce it in the demo above(open the demo => reproduce the issue => click “Save” button => send me the new link).
Kind regards,
Hello, thank you for your feedback. I get problem then I use scheduler.date.unit_start = function (date) {
return scheduler.date.week_start(date); and scheduler.config.mark_now=true;
};
This problem is only in week with today but on other weeks all it is ok.
I always get error. And I solved that set value false for scheduler.config.mark_now=false and created custom red line in addTimeSpan() function it worked nice for me.
My custom solution
scheduler.config.mark_now = false;
scheduler.addMarkedTimespan({
days: [DateTime.now().weekday],
zones: [DateTime.now().hour * 60 + DateTime.now().minute],
css: “custom_now”,
});
Hello @sergii.khilchuk13,
This issue looks quite similar to the existed issue with unit
view + limit
plugin, that was fixed in the 7.0.1
version.
If the issue still exists, could you please reproduce it in the snippet below:
https://snippet.dhtmlx.com/kcvsti0j
(open the snippet => reproduce the issue => click the “Save” button => post here the new link)?
Kind regards,