# GC.Spread.Sheets.GanttSheet.Calendar

## Content

# Class: Calendar

[Sheets](../modules/GC.Spread.Sheets).[GanttSheet](../modules/GC.Spread.Sheets.GanttSheet).Calendar

## Table of contents

### Constructors

- [constructor](GC.Spread.Sheets.GanttSheet.Calendar#constructor)

### Properties

- [customWorkWeeks](GC.Spread.Sheets.GanttSheet.Calendar#customworkweeks)
- [defaultWorkWeek](GC.Spread.Sheets.GanttSheet.Calendar#defaultworkweek)
- [name](GC.Spread.Sheets.GanttSheet.Calendar#name)
- [hours24](GC.Spread.Sheets.GanttSheet.Calendar#hours24)
- [nightShift](GC.Spread.Sheets.GanttSheet.Calendar#nightshift)
- [standard](GC.Spread.Sheets.GanttSheet.Calendar#standard)

### Methods

- [copyTo](GC.Spread.Sheets.GanttSheet.Calendar#copyto)

## Constructors

### <a id="constructor" name="constructor"></a> constructor

• **new Calendar**(`name`, `defaultWorkWeek?`, `customWorkWeeks?`)

Creates a calendar with the provided work weeks.

**`classdesc`** Represents a calender for scheduling, which defines the work times of each day.

#### Parameters

| Name | Type | Description |
| :------ | :------ | :------ |
| `name` | `string` | A string value specifies the name of this calendar. |
| `defaultWorkWeek?` | [`WorkWeek`](GC.Spread.Sheets.GanttSheet.WorkWeek) | - |
| `customWorkWeeks?` | [`CustomWorkWeek`](GC.Spread.Sheets.GanttSheet.CustomWorkWeek)[] | - |

## Properties

### <a id="customworkweeks" name="customworkweeks"></a> customWorkWeeks

• **customWorkWeeks**: [`CustomWorkWeek`](GC.Spread.Sheets.GanttSheet.CustomWorkWeek)[]

Gets or sets the custom work weeks for this calendar.
Note do not modify a calendar in use. Instead, you could copy a calendar and make changes, then replace the original one.

___

### <a id="defaultworkweek" name="defaultworkweek"></a> defaultWorkWeek

• **defaultWorkWeek**: [`WorkWeek`](GC.Spread.Sheets.GanttSheet.WorkWeek)

Gets or sets the default work week for this calendar.
Note do not modify a calendar in use. Instead, you could copy a calendar and make changes, then replace the original one.

___

### <a id="name" name="name"></a> name

• **name**: `string`

Gets or sets the calendar name.

___

### <a id="hours24" name="hours24"></a> hours24

▪ `Static` **hours24**: [`Calendar`](GC.Spread.Sheets.GanttSheet.Calendar)

The 24 hours calendar, which defines the work time as 24 hours by 7 days in a week.

**`readonly`**

___

### <a id="nightshift" name="nightshift"></a> nightShift

▪ `Static` **nightShift**: [`Calendar`](GC.Spread.Sheets.GanttSheet.Calendar)

The night-shift calendar, which defines the work time as 23:00 to 3:00 and 4:00 to 8:00 from Monday evening to Saturday morning.

**`readonly`**

___

### <a id="standard" name="standard"></a> standard

▪ `Static` **standard**: [`Calendar`](GC.Spread.Sheets.GanttSheet.Calendar)

The standard calendar, which defines the work time as 8:00 to 12:00 and 13:00 to 17:00 for Monday to Friday.

**`readonly`**

## Methods

### <a id="copyto" name="copyto"></a> copyTo

▸ **copyTo**(`newName`): [`Calendar`](GC.Spread.Sheets.GanttSheet.Calendar)

Copies the work weeks of this calendar to a new calendar.

#### Parameters

| Name | Type | Description |
| :------ | :------ | :------ |
| `newName` | `string` | A string indicates the name of the new calendar. |

#### Returns

[`Calendar`](GC.Spread.Sheets.GanttSheet.Calendar)

The copy result.
