# TtsSpan.DateBuilder

Added in[API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

# DateBuilder

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/android/text/style/TtsSpan.DateBuilder "View this page in Java")  

```
open class DateBuilder : TtsSpan.SemioticClassBuilder<TtsSpan.DateBuilder!>
```

|---|---|---|----------------------------------------------------------------------------------------------------------------------------------|
| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)                                                         ||||
| ↳ | [android.text.style.TtsSpan.Builder](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan.Builder)\<C\>           |||
|   | ↳ | [android.text.style.TtsSpan.SemioticClassBuilder](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan.SemioticClassBuilder)\<[android.text.style.TtsSpan.DateBuilder](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan.DateBuilder#)\> ||
|   |   | ↳ | [android.text.style.TtsSpan.DateBuilder](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan.DateBuilder#) |

A builder for TtsSpans of type[TYPE_DATE](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan#TYPE_DATE:kotlin.String).

## Summary

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Public constructors                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     ||
|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| [DateBuilder](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan.DateBuilder#DateBuilder())`()` Creates a builder for a TtsSpan of type[TYPE_DATE](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan#TYPE_DATE:kotlin.String).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| [DateBuilder](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan.DateBuilder#DateBuilder(kotlin.Int,%20kotlin.Int,%20kotlin.Int,%20kotlin.Int))`(`weekday:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)!`, `day:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)!`, `month:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)!`, `year:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)!`)` Creates a builder for a TtsSpan of type[TYPE_TIME](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan#TYPE_TIME:kotlin.String)and possibly sets the[ARG_WEEKDAY](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan#ARG_WEEKDAY:kotlin.String),[ARG_DAY](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan#ARG_DAY:kotlin.String),[ARG_MONTH](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan#ARG_MONTH:kotlin.String)and[ARG_YEAR](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan#ARG_YEAR:kotlin.String)arguments. |

|                                                                                                                                                                                                                                Public methods                                                                                                                                                                                                                                 ||
|--------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| open[TtsSpan.DateBuilder](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan.DateBuilder#)! | [setDay](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan.DateBuilder#setDay(kotlin.Int))`(`day:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` Sets the[ARG_DAY](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan#ARG_DAY:kotlin.String)argument.                     |
| open[TtsSpan.DateBuilder](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan.DateBuilder#)! | [setMonth](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan.DateBuilder#setMonth(kotlin.Int))`(`month:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` Sets the[ARG_MONTH](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan#ARG_MONTH:kotlin.String)argument.           |
| open[TtsSpan.DateBuilder](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan.DateBuilder#)! | [setWeekday](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan.DateBuilder#setWeekday(kotlin.Int))`(`weekday:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` Sets the[ARG_WEEKDAY](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan#ARG_WEEKDAY:kotlin.String)argument. |
| open[TtsSpan.DateBuilder](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan.DateBuilder#)! | [setYear](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan.DateBuilder#setYear(kotlin.Int))`(`year:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` Sets the[ARG_YEAR](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan#ARG_YEAR:kotlin.String)argument.                |

| Inherited functions ||
|---|---|
| From class[Builder](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan.Builder) |---------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | [TtsSpan](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan)! | [build](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan.Builder#build())`()` <br /> Returns a TtsSpan built from the parameters set by the setter methods. <br />                                                                                                                                                                                                            | | C                                                                                     | [setIntArgument](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan.Builder#setIntArgument(kotlin.String,%20kotlin.Int))`(`arg:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!`, `value:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` <br /> Sets an argument to an int value. <br />                   | | C                                                                                     | [setLongArgument](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan.Builder#setLongArgument(kotlin.String,%20kotlin.Long))`(`arg:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!`, `value:` `[Long](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html)`)` <br /> Sets an argument to a long value. <br />              | | C                                                                                     | [setStringArgument](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan.Builder#setStringArgument(kotlin.String,%20kotlin.String))`(`arg:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!`, `value:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!`)` <br /> Sets an argument to a string value. <br /> | ||
| From class[SemioticClassBuilder](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan.SemioticClassBuilder) |---|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | C | [setAnimacy](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan.SemioticClassBuilder#setAnimacy(kotlin.String))`(`animacy:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!`)` <br /> Sets the animacy information for this instance. <br />                     | | C | [setCase](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan.SemioticClassBuilder#setCase(kotlin.String))`(`grammaticalCase:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!`)` <br /> Sets the grammatical case information for this instance. <br />          | | C | [setGender](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan.SemioticClassBuilder#setGender(kotlin.String))`(`gender:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!`)` <br /> Sets the gender information for this instance. <br />                         | | C | [setMultiplicity](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan.SemioticClassBuilder#setMultiplicity(kotlin.String))`(`multiplicity:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!`)` <br /> Sets the multiplicity information for this instance. <br /> | ||

## Public constructors

### DateBuilder

Added in[API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
DateBuilder()
```

Creates a builder for a TtsSpan of type[TYPE_DATE](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan#TYPE_DATE:kotlin.String).  

### DateBuilder

Added in[API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
DateBuilder(
    weekday: Int!, 
    day: Int!, 
    month: Int!, 
    year: Int!)
```

Creates a builder for a TtsSpan of type[TYPE_TIME](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan#TYPE_TIME:kotlin.String)and possibly sets the[ARG_WEEKDAY](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan#ARG_WEEKDAY:kotlin.String),[ARG_DAY](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan#ARG_DAY:kotlin.String),[ARG_MONTH](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan#ARG_MONTH:kotlin.String)and[ARG_YEAR](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan#ARG_YEAR:kotlin.String)arguments. Pass null to any argument to leave it unset.

## Public methods

### setDay

Added in[API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
open fun setDay(day: Int): TtsSpan.DateBuilder!
```

Sets the[ARG_DAY](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan#ARG_DAY:kotlin.String)argument.

|                                                                                                          Parameters                                                                                                           ||
|-------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `day` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html):The value to be set for day. See[ARG_DAY](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan#ARG_DAY:kotlin.String). |

|                                                             Return                                                             ||
|----------------------------------------------------------------------------------------------------------------|----------------|
| [TtsSpan.DateBuilder](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan.DateBuilder#)! | This instance. |

**See Also**

- [#ARG_DAY](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan#ARG_DAY:kotlin.String)  

### setMonth

Added in[API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
open fun setMonth(month: Int): TtsSpan.DateBuilder!
```

Sets the[ARG_MONTH](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan#ARG_MONTH:kotlin.String)argument.

|                                                                                                              Parameters                                                                                                               ||
|---------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `month` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html):The value to be set for month. See[ARG_MONTH](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan#ARG_MONTH:kotlin.String). |

|                                                             Return                                                             ||
|----------------------------------------------------------------------------------------------------------------|----------------|
| [TtsSpan.DateBuilder](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan.DateBuilder#)! | This instance. |

**See Also**

- [#ARG_MONTH](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan#ARG_MONTH:kotlin.String)  

### setWeekday

Added in[API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
open fun setWeekday(weekday: Int): TtsSpan.DateBuilder!
```

Sets the[ARG_WEEKDAY](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan#ARG_WEEKDAY:kotlin.String)argument.

|                                                                                                                  Parameters                                                                                                                   ||
|-----------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `weekday` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html):The value to be set for weekday. See[ARG_WEEKDAY](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan#ARG_WEEKDAY:kotlin.String). |

|                                                             Return                                                             ||
|----------------------------------------------------------------------------------------------------------------|----------------|
| [TtsSpan.DateBuilder](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan.DateBuilder#)! | This instance. |

**See Also**

- [#ARG_WEEKDAY](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan#ARG_WEEKDAY:kotlin.String)  

### setYear

Added in[API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
open fun setYear(year: Int): TtsSpan.DateBuilder!
```

Sets the[ARG_YEAR](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan#ARG_YEAR:kotlin.String)argument.

|                                                                                                            Parameters                                                                                                             ||
|--------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `year` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html):The value to be set for year. See[ARG_YEAR](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan#ARG_YEAR:kotlin.String). |

|                                                             Return                                                             ||
|----------------------------------------------------------------------------------------------------------------|----------------|
| [TtsSpan.DateBuilder](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan.DateBuilder#)! | This instance. |

**See Also**

- [#ARG_YEAR](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan#ARG_YEAR:kotlin.String)