# DurationTextBindingObjectAPI (widget methods): World of Warcraft Forever API

Forever 1.60.1 (70959), Interface 16001, Lua 5.1, from Blizzard's own API documentation. Page: https://wowaddons.gg/forever-api/DurationTextBindingObjectAPI

## Functions

### Assign

```lua
self:Assign(other)
```

Copies another duration text binding and assigns it to this one.

Arguments:
- `other`: DurationTextBinding

### CanFormatText

```lua
canFormatText = self:CanFormatText()
```

Returns true if this binding has enough configuration to produce formatted text.

Returns:
- `canFormatText`: bool

### CanUpdateFontString

```lua
canUpdateText = self:CanUpdateFontString()
```

Returns true if this binding has enough configuration to update its font string with formatted text.

Returns:
- `canUpdateText`: bool

### ClearTextColorCurve

```lua
self:ClearTextColorCurve()
```

Clears the text color curve used by this binding.

### Copy

```lua
copy = self:Copy()
```

Returns a copy of this duration text binding.

Returns:
- `copy`: DurationTextBinding

### Disable

```lua
self:Disable()
```

Disables automatic updates for this duration text binding.

### Enable

```lua
self:Enable()
```

Enables automatic updates for this duration text binding.

### GetDuration

```lua
duration = self:GetDuration()
```

Returns the duration object used by this duration text binding.

Returns:
- `duration`: LuaDurationObject, may be nil

### GetExpiredText

```lua
text = self:GetExpiredText()
```

Returns the text shown when the duration has fully expired.

Returns:
- `text`: string, may be nil

### GetFontString

```lua
fontString = self:GetFontString()
```

Returns the font string updated by this duration text binding.

Returns:
- `fontString`: SimpleFontString, may be nil

### GetFormattedText

```lua
text = self:GetFormattedText()
```

Returns the text that would currently be assigned to the configured font string.

Returns:
- `text`: string

### GetFormattedTextColor

```lua
color = self:GetFormattedTextColor()
```

Returns the text color that would currently be assigned to the configured font string.

May return nothing.

Returns:
- `color`: colorRGBA

### GetTextColorCurve

```lua
curve, property = self:GetTextColorCurve()
```

Returns the text color curve used by this binding.

May return nothing.

Returns:
- `curve`: LuaColorCurveObject
- `property`: DurationTextBindingProperty

### GetTimeModifier

```lua
modifier = self:GetTimeModifier()
```

Returns the time modifier used when sampling duration values for this binding.

Returns:
- `modifier`: DurationTimeModifier

### GetUpdateInterval

```lua
updateInterval = self:GetUpdateInterval()
```

Returns the minimum number of seconds between automatic text updates. A value of zero updates every game tick.

Returns:
- `updateInterval`: number

### GetZeroDurationText

```lua
text = self:GetZeroDurationText()
```

Returns the text shown when the duration is not configured, or represents a zero-duration time span.

Returns:
- `text`: string, may be nil

### HasSecretValues

```lua
hasSecretValues = self:HasSecretValues()
```

Returns true if the duration text binding has been configured with any secret values.

Returns:
- `hasSecretValues`: bool

### IsEnabled

```lua
enabled = self:IsEnabled()
```

Returns true if this duration text binding updates its font string automatically.

Returns:
- `enabled`: bool

### SetDuration

```lua
self:SetDuration(duration)
```

Configures the duration object used by this duration text binding.

Arguments:
- `duration`: LuaDurationObject

### SetEnabled

```lua
self:SetEnabled(enabled)
```

Configures whether this duration text binding updates its font string automatically.

Arguments:
- `enabled`: bool

### SetExpiredText

```lua
self:SetExpiredText([text])
```

Configures the text shown when the duration has fully expired.

Arguments:
- `text`: string, may be nil

### SetFontString

```lua
self:SetFontString(fontString)
```

Configures the font string updated by this duration text binding.

Arguments:
- `fontString`: SimpleFontString

### SetFormatter

```lua
self:SetFormatter(formatter)
```

Configures the text format used by this duration text binding to display the remaining duration using the supplied formatter.

Arguments:
- `formatter`: NumericFormatter

### SetTextColorCurve

```lua
self:SetTextColorCurve(curve, property)
```

Configures this duration text binding to adjust fontstring text color by evaluating a duration property through a curve.

Arguments:
- `curve`: LuaColorCurveObject
- `property`: DurationTextBindingProperty

### SetTextFormat

```lua
self:SetTextFormat(formatString, components)
```

Configures the text format used by this duration text binding. The format string may contain '{}' placeholders, each of which is substituted by the corresponding component in the supplied array.

Arguments:
- `formatString`: stringView
- `components`: DurationTextBindingFormatComponent[]

### SetTimeModifier

```lua
self:SetTimeModifier(modifier)
```

Configures the time modifier used when sampling duration values for this binding.

Arguments:
- `modifier`: DurationTimeModifier

### SetToDefaults

```lua
self:SetToDefaults()
```

Resets this duration text binding to its default state, clearing the configured font string, duration, format, formatter, and fallback text.

### SetUpdateInterval

```lua
self:SetUpdateInterval(updateInterval)
```

Configures the minimum number of seconds between automatic text updates. A value of zero updates every game tick.

Arguments:
- `updateInterval`: number

### SetZeroDurationText

```lua
self:SetZeroDurationText([text])
```

Configures the text shown when the duration is not configured, or represents a zero-duration time span.

Arguments:
- `text`: string, may be nil

### UpdateFontString

```lua
self:UpdateFontString()
```

Immediately updates the configured font string from the current duration state.

---
Make an addon with your AI: tell it "Read https://wowaddons.gg/agents.md, then make me a World of Warcraft Forever addon that …, try it with me in the game, and publish it."
