> ## Documentation Index
> Fetch the complete documentation index at: https://docs.superoffice.com/llms.txt
> Use this file to discover all available pages before exploring further.

# WeekSchedule

> This class is used to represent a week schedule - what hours a day are 'active' for each day, etc.

This class is used to represent a week schedule - what hours a day are "active" for each day, etc.

## Constructors

### WeekSchedule()

```crmscript theme={null}
WeekSchedule
```

This class is used to represent a week schedule - what hours a day are "active" for each day, etc.

## Methods

## addTimeSpan(DateTime,TimeSpan)

Adds a time span to the schedule.

```crmscript theme={null}
DateTime addTimeSpan(DateTime start, TimeSpan add)
```

**Returns:** [CRMScript.Native.DateTime](CRMScript.Native.DateTime)

## getDifference(DateTime,DateTime)

Returns difference between two DateTime as a TimeSpan.

```crmscript theme={null}
TimeSpan getDifference(DateTime start, DateTime stop)
```

**Returns:** [CRMScript.Native.TimeSpan](CRMScript.Native.TimeSpan)

## getFriStart()

This function returns the start time (object) of "active" mode for Friday.

```crmscript theme={null}
Time getFriStart()
```

**Returns:** [CRMScript.Global.Time](CRMScript.Global.Time)

## getFriStop()

This function returns the end time (object) of "active" mode for Friday.

```crmscript theme={null}
Time getFriStop()
```

**Returns:** [CRMScript.Global.Time](CRMScript.Global.Time)

## getMonStart()

This function returns the start time (object) of "active" mode for Monday.

```crmscript theme={null}
Time getMonStart()
```

**Returns:** [CRMScript.Global.Time](CRMScript.Global.Time)

## getMonStop()

This function returns the end time (object) of "active" mode for Monday.

```crmscript theme={null}
Time getMonStop()
```

**Returns:** [CRMScript.Global.Time](CRMScript.Global.Time)

## getNonDates()

This function returns the dates that are closed, comma separated.

```crmscript theme={null}
String getNonDates()
```

**Returns:** [CRMScript.Global.String](CRMScript.Global.String)

## getSatStart()

This function returns the start time (object) of "active" mode for Saturday.

```crmscript theme={null}
Time getSatStart()
```

**Returns:** [CRMScript.Global.Time](CRMScript.Global.Time)

## getSatStop()

This function returns the end time (object) of "active" mode for Saturday.

```crmscript theme={null}
Time getSatStop()
```

**Returns:** [CRMScript.Global.Time](CRMScript.Global.Time)

## getSunStart()

This function returns the start time (object) of "active" mode for Sunday.

```crmscript theme={null}
Time getSunStart()
```

**Returns:** [CRMScript.Global.Time](CRMScript.Global.Time)

## getSunStop()

This function returns the end time (object) of "active" mode for Sunday.

```crmscript theme={null}
Time getSunStop()
```

**Returns:** [CRMScript.Global.Time](CRMScript.Global.Time)

## getThuStart()

This function returns the start time (object) of "active" mode for Thursday.

```crmscript theme={null}
Time getThuStart()
```

**Returns:** [CRMScript.Global.Time](CRMScript.Global.Time)

## getThuStop()

This function returns the end time (object) of "active" mode for Thursday.

```crmscript theme={null}
Time getThuStop()
```

**Returns:** [CRMScript.Global.Time](CRMScript.Global.Time)

## getTueStart()

This function returns the start time (object) of "active" mode for Tuesday.

```crmscript theme={null}
Time getTueStart()
```

**Returns:** [CRMScript.Global.Time](CRMScript.Global.Time)

## getTueStop()

This function returns the end time (object) of "active" mode for Tuesday.

```crmscript theme={null}
Time getTueStop()
```

**Returns:** [CRMScript.Global.Time](CRMScript.Global.Time)

## getWedStart()

This function returns the start time (object) of "active" mode for Wednesday.

```crmscript theme={null}
Time getWedStart()
```

**Returns:** [CRMScript.Global.Time](CRMScript.Global.Time)

## getWedStop()

This function returns the end time (object) of "active" mode for Wednesday.

```crmscript theme={null}
Time getWedStop()
```

**Returns:** [CRMScript.Global.Time](CRMScript.Global.Time)

## loadFromPriority(Integer)

load a WeekSchedule object using the given priority's week schedule. Be aware that this method will clear all settings you may have on the WeekSchedule object.

```crmscript theme={null}
Void loadFromPriority(Integer p_id)
```

**Returns:** [CRMScript.Global.Void](CRMScript.Global.Void)

## setFriStart(Time)

This function sets the start time (object) of "active" mode for Friday.

```crmscript theme={null}
Void setFriStart(Time t)
```

**Returns:** [CRMScript.Global.Void](CRMScript.Global.Void)

## setFriStop(Time)

This function sets the end time (object) of "active" mode for Friday.

```crmscript theme={null}
Void setFriStop(Time t)
```

**Returns:** [CRMScript.Global.Void](CRMScript.Global.Void)

## setMonStart(Time)

This function sets the start time (object) of "active" mode for Monday.

```crmscript theme={null}
Void setMonStart(Time t)
```

**Returns:** [CRMScript.Global.Void](CRMScript.Global.Void)

## setMonStop(Time)

This function sets the end time (object) of "active" mode for Monday.

```crmscript theme={null}
Void setMonStop(Time t)
```

**Returns:** [CRMScript.Global.Void](CRMScript.Global.Void)

## setNonDates(String)

This function sets the dates that are inactive.

Example date string: "1/10/2004,24/12". If the year is not specified, the date is inactive every year.

```crmscript theme={null}
Void setNonDates(String dates)
```

**Returns:** [CRMScript.Global.Void](CRMScript.Global.Void)

## setSatStart(Time)

This function sets the start time (object) of "active" mode for Saturday.

```crmscript theme={null}
Void setSatStart(Time p_0)
```

**Returns:** [CRMScript.Global.Void](CRMScript.Global.Void)

## setSatStop(Time)

This function sets the end time (object) of "active" mode for Saturday.

```crmscript theme={null}
Void setSatStop(Time t)
```

**Returns:** [CRMScript.Global.Void](CRMScript.Global.Void)

## setSunStart(Time)

This function sets the start time (object) of "active" mode for Sunday.

```crmscript theme={null}
Void setSunStart(Time t)
```

**Returns:** [CRMScript.Global.Void](CRMScript.Global.Void)

## setSunStop(Time)

This function sets the end time (object) of "active" mode for Sunday.

```crmscript theme={null}
Void setSunStop(Time t)
```

**Returns:** [CRMScript.Global.Void](CRMScript.Global.Void)

## setThuStart(Time)

This function sets the start time (object) of "active" mode for Thursday.

```crmscript theme={null}
Void setThuStart(Time t)
```

**Returns:** [CRMScript.Global.Void](CRMScript.Global.Void)

## setThuStop(Time)

This function sets the end time (object) of "active" mode for Thursday.

```crmscript theme={null}
Void setThuStop(Time t)
```

**Returns:** [CRMScript.Global.Void](CRMScript.Global.Void)

## setTueStart(Time)

This function sets the start time (object) of "active" mode for Tuesday.

```crmscript theme={null}
Void setTueStart(Time p_0)
```

**Returns:** [CRMScript.Global.Void](CRMScript.Global.Void)

## setTueStop(Time)

This function sets the end time (object) of "active" mode for Tuesday.

```crmscript theme={null}
Void setTueStop(Time t)
```

**Returns:** [CRMScript.Global.Void](CRMScript.Global.Void)

## setWedStart(Time)

This function sets the start time (object) of "active" mode for Wednesday.

```crmscript theme={null}
Void setWedStart(Time t)
```

**Returns:** [CRMScript.Global.Void](CRMScript.Global.Void)

## setWedStop(Time)

This function sets the end time (object) of "active" mode for Wednesday.

```crmscript theme={null}
Void setWedStop(Time t)
```

**Returns:** [CRMScript.Global.Void](CRMScript.Global.Void)


## Related topics

- [YearSchedule](/en/automation/crmscript/reference/CRMScript.Native.YearSchedule.md)
- [Namespace CRMScript.Native](/en/automation/crmscript/reference/CRMScript.Native.md)
- [CRMScript Reference](/en/automation/crmscript/reference/index.md)
- [schedule table](/en/database/tables/schedule.md)
- [Schedule repeating follow-up](/en/diary/learn/recurrence/create.md)
- [Diary](/en/diary/learn/index.md)
