MCPcopy Create free account
hub / github.com/DHTMLX/scheduler / _round_minutes

Function _round_minutes

codebase/sources/dhtmlxscheduler.js:14581–14598  ·  view source on GitHub ↗
(date)

Source from the content-addressed store, hash-verified

14579 _init_once = function() {
14580 };
14581 function _round_minutes(date) {
14582 var time_values = config._time_values;
14583 var direct_value = date.getHours() * 60 + date.getMinutes();
14584 var fixed_value = direct_value;
14585 var value_found = false;
14586 for (var k = 0; k < time_values.length; k++) {
14587 var t_v = time_values[k];
14588 if (t_v === direct_value) {
14589 value_found = true;
14590 break;
14591 }
14592 if (t_v < direct_value)
14593 fixed_value = t_v;
14594 }
14595 if (!(value_found || fixed_value))
14596 return -1;
14597 return value_found ? direct_value : fixed_value;
14598 }
14599 selects[0].value = _round_minutes(ev.start_date);
14600 selects[1].value = _round_minutes(ev.end_date);
14601 }, get_value: function(node, ev) {

Callers 1

minicalFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected