본문으로 건너뛰기

getClosestWorkTime

Description

가장 가까운 근무 시간을 반환합니다

getClosestWorkTime: (config: object) => Date

Parameters

  • config - (required) object - 구성 객체 또는 날짜

Returns

  • date - (Date) - 가장 가까운 근무 시간의 Date 객체

Example

// 지정된 날짜가 전역 설정의 근무일인지 확인합니다
gantt.getClosestWorkTime({date:new Date(2019,04,26)});
// or
gantt.getClosestWorkTime(new Date(2019,04,26));

// 지정된 날짜가 특정 작업의 근무일인지 확인합니다
gantt.getClosestWorkTime({ date: new Date(2019,04,26), task:task });

Details

노트

work_time 옵션이 비활성화되어 있으면, 메서드는 날짜를 원래대로 반환합니다.

설정 객체 속성

구성 객체에는 다음 속성이 포함될 수 있습니다:

Property

Description

date가장 가까운 근무 시간을 얻으려는 날짜
gantt.getClosestWorkTime({
date:new Date(2019,04,26),
dir:"future"
});
// -> Mon May 27 2019 00:00:00 if duration_unit="day"
// -> Mon May 27 2019 08:00:00 if duration_unit="hour"
dir ('future' or 'past') 가장 가까운 시간의 방향을 지정합니다
gantt.getClosestWorkTime({
date:new Date(2019,04,18),
dir:"past"
});
// -> Sat May 18 2019 00:00:00
unit 가장 가까운 근무 시간을 찾기 위한 시간 단위
//가장 가까운 근무 시간을 찾습니다
gantt.getClosestWorkTime({
date:new Date(2019,04,18),
dir:"future",
unit:"hour"
});
// -> Mon May 20 2019 08:00:00
task선택 사항, 기간 계산에 사용할 작업 객체
var closestTime = gantt.getClosestWorkTime({
date:date,
task:task
});
gantt.getClosestWorkTime({
date:new Date(2019,04,26),
dir:"future"
});
// -> Mon May 27 2019 00:00:00 if duration_unit="day"
// -> Mon May 27 2019 08:00:00 if duration_unit="hour"

dir ('future' or 'past') 방향을 지정합니다

gantt.getClosestWorkTime({
date:new Date(2019,04,18),
dir:"past"
});
// -> Sat May 18 2019 00:00:00

unit 가장 가까운 근무 시간을 찾기 위한 시간 단위

//가장 가까운 근무 시간을 찾습니다
gantt.getClosestWorkTime({
date:new Date(2019,04,18),
dir:"future",
unit:"hour"
});
// -> Mon May 20 2019 08:00:00

task optional, the object of the task the duration of which should be calculated

var closestTime = gantt.getClosestWorkTime({
date:date,
task:task
});
Need help?
Got a question about the documentation? Reach out to our technical support team for help and guidance. For custom component solutions, visit the Services page.