본문으로 건너뛰기

캘린더

Description

작업 캘린더 객체의 인터페이스

calendar: Calendar

Details

작업 달력에 대한 자세한 정보는 Work Time Calculation 문서를 참조하십시오.

calendar 객체는 다음 메서드 및 속성을 갖습니다:

Methods

  • setWorkTime (config): boolean - Gantt 차트의 근무 시간을 설정합니다
    • config - (object) - 시간 간격의 구성 객체
      • day? - (string | number) - 선택사항: 요일의 숫자 [0(일요일) - 6(토요일)]. 주의: 한 번에 1일만 설정할 수 있습니다
      • date? - (Date) - 선택사항: 근무일 또는 휴무일로 설정할 특정 날짜
      • hours? - (string[] | number[] | boolean) - 선택사항: 'from'-'to' 쌍으로 된 근무 시간 배열. 'false' 값은 휴무일을 설정하고, 'true'(기본값)은 기본 근무 시간(["8:00-17:00"])를 적용합니다
      • customWeeks? - (object) - 선택사항: 서로 다른 기간에 대한 근무 시간 규칙을 담은 객체. 이 객체에는 시간 간격의 이름이 키이며 값은 속성 목록이 들어 있는 객체입니다.
        • [timespan: string] - (object) - 근무 시간 설정이 있는 시간 간격 객체. 해당 객체의 이름이 시간 간격의 이름으로 사용됩니다
          • from - (Date) - 시간 간격이 시작될 날짜
          • to - (Date) - 시간 간격이 완료될 날짜
          • hours? - (string[] | number[]) - 선택사항: 'from'-'to' 쌍으로 된 근무 시간 배열. 'false' 값은 휴무일, 'true'(기본값)는 기본 시간(["8:00-17:00"])를 적용합니다
          • days? - (WorkDaysTuple | boolean) - 선택사항: 7일 간의 요일 배열(0은 일요일, 6은 토요일). 1/true는 근무일, 0/false는 비근무일
calendar.setWorkTime({ hours:["9:00-18:00"] });
calendar.setWorkTime({ hours:["9:00-18:00"] });
calendar.setWorkTime({ day: 5, hours: ["9:00-18:00"] });
calendar.setWorkTime({ day: 5, hours: false });
calendar.setWorkTime({ date: new Date(2025, 5, 6), hours: ["9:00-18:00"] });
calendar.setWorkTime({ date: new Date(2025, 5, 6), hours: false });
calendar.setWorkTime({ hours: false });
calendar.setWorkTime({
customWeeks: {
winter: {
from: new Date(2025, 11, 1),
to: new Date(2026, 2, 1),
hours: ["8:00-13:00", "14:00-16:00"],
days: [1, 1, 1, 1, 1, 0, 0]
},
summer: {
from: new Date(2026, 5, 1),
to: new Date(2026, 7, 1),
hours: ["10:00-13:00", "14:00-16:00"],
days: [1, 1, 0, 1, 1, 0, 0]
}
}
});
calendar.setWorkTime({
customWeeks: {
winter: {
from: new Date(2025, 11, 1),
to: new Date(2026, 2, 1),
hours: ["8:00-13:00", "14:00-16:00"],
days: [1, ["8:00-13:00"], 1, 1, ["14:00-16:00"], 0, 0]
},
summer: {
from: new Date(2026, 5, 1),
to: new Date(2026, 7, 1),
hours: ["10:00-13:00", "14:00-16:00"],
days: false
}
}
});
  • unsetWorkTime (config): void - Gantt 차트에서 근무 시간을 해제합니다
    • config - (object) - 시간 간격의 구성 객체
      • day? - (string | number) - 선택사항: 요일의 숫자 [0(일요일) - 6(토요일)]. 주의: 한 번에 1일만 설정할 수 있습니다
      • date? - (Date) - 선택사항: 근무일 또는 휴무일로 설정할 특정 날짜
      • hours? - (string[] | number[] | boolean) - 선택사항: 'from'-'to' 쌍으로 된 근무 시간 배열. 'false' 값은 근무 시간을 해제하고, 'true' (기본값)는 기본 근무 시간(["8:00-17:00"])를 적용합니다
calendar.unsetWorkTime({ hours: ["9:00-18:00"] });
calendar.unsetWorkTime({ day: "5", hours: ["9:00-18:00"] });
calendar.unsetWorkTime({ day: 5, hours: false });
calendar.unsetWorkTime({ date: new Date(2025, 5, 6), hours: true });
  • isWorkTime (config, time_unit): boolean - 주어진 날짜가 근무 시간인지 확인합니다
    • config - (Date | object) - 확인하려는 날짜 또는 시간 간격의 구성 객체:
      • date - (Date) - 확인할 날짜
      • unit? - (string) - 선택사항: 시간 단위: "minute", "hour", "day", "week", "month", "year"
    • time_unit? - (string) - 선택사항: 시간 단위: "minute", "hour", "day", "week", "month", "year". 첫 번째 매개변수가 객체로 지정된 경우 전혀 필요하지 않습니다
const calendar = gantt.getTaskCalendar(task);
if (calendar.isWorkTime({date: date})){
alert("작업의 근무 시간" + task.text);
}

calendar.isWorkTime(new Date(2025, 5, 6));
calendar.isWorkTime(new Date(2025, 5, 6), "hour");
calendar.isWorkTime({ date: new Date(2025, 5, 6), unit: "hour" });
  • getClosestWorkTime (config): Date - 가장 가까운 근무 시간을 반환합니다
    • config - (Date | object) - 가장 가까운 근무 시간을 얻기 위한 구성 객체:
      • date - (Date) - 가장 가까운 근무 시간을 얻을 날짜
      • dir? - (string) - 선택사항: 가장 가까운 시간의 방향을 지정합니다: "future" 또는 "past"
      • unit? - (string) - 선택사항: 가장 가까운 근무 시간을 검색할 시간 단위
calendar.getClosestWorkTime(new Date(2025, 5, 6));
calendar.getClosestWorkTime({
date: new Date(2025, 5, 6),
unit: "hour",
dir: "past"
});
  • calculateEndDate (config, duration, unit): Date - 작업의 종료 날짜를 계산합니다
    • config - (Date | object) - 작업이 시작될 예정인 날짜 또는 시간 간격의 구성 객체:
      • start_date - (Date) - 작업이 시작될 예정인 날짜
      • duration - (number) - 작업의 기간
      • unit? - (string) - 선택사항: 기간의 시간 단위: "minute", "hour", "day", "week", "month", "year"
    • duration? - (number) - 선택사항: 작업의 기간. 첫 번째 매개변수가 객체로 지정된 경우 필요하지 않습니다
    • unit? - (string) - 선택사항: 기간의 시간 단위. 첫 번째 매개변수가 객체로 지정된 경우 필요하지 않습니다
calendar.calculateEndDate(new Date(2025, 5, 6), 2, "hour");
calendar.calculateEndDate({
start_date: new Date(2025, 5, 6),
duration: 2,
unit: "hour"
});
  • calculateDuration (config, end): number - 작업의 소요 시간을 계산합니다
    • config - (Date | object) - 시작일 또는 시간 간격의 구성 객체:
      • start_date - (Date) - 작업이 시작될 날짜
      • end_date - (Date) - 작업이 완료될 예정인 날짜
    • end? - (Date) - 작업이 완료될 예정인 날짜. 첫 번째 매개변수가 객체로 지정된 경우 필요하지 않습니다
calendar.calculateDuration(new Date(2025, 5, 6), new Date(2025, 5, 17));
calendar.calculateDuration({
start_date: new Date(2025, 5, 6),
end_date: new Date(2025, 5, 17)
});

Properties

  • id - (string | number) - 작업의 캘린더 ID
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.