# Javascript: DateFormField.getSupportedDateFormats Method

> Gets an array of format picture strings which can be used to format the date. The returned format strings depend on the culture set for the date field's text. A TextControl uses Day, Month, Year, and Era Format Picture strings to format a date.

- **Product:** DS Server
- **Section:** Reference
- **Kind:** Method
- **Introduced:** 28.0
- **Path:** DS Server > Reference > JavaScript API > Javascript: DateFormField.getSupportedDateFormats Method
- **408 words**
- **Web URL:** https://docs.textcontrol.com/ds-server/reference/javascript/dateformfield/getsupporteddateformats-method/
- **LLMs URL:** https://docs.textcontrol.com/ds-server/reference/javascript/dateformfield/getsupporteddateformats-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/ds-server/reference/javascript/dateformfield/getsupporteddateformats-method/llms-full.txt

---

### Description

Gets an array of format picture strings which can be used to format the date. The returned format strings depend on the culture set for the date field's text. A TextControl uses Day, Month, Year, and Era Format Picture strings to format a date.

### Syntax

```javascript
<void> DateFormField.getSupportedDateFormats(<RequestStringsCallback> callback, [<ErrorCallback> errorCallback])
```

### Parameters

| Parameter | Description |
|---|---|
| callback | Receives the supported format strings. |
| errorCallback | Optional. Is called when the operation failed with an error. |

### Examples

The following example demonstrates `DateFormField.getSupportedDateFormats` in a practical document-editing workflow. It gets an array of format picture strings which can be used to format the date. The returned format strings depend on the culture set for the date field's text. A TextControl uses Day, Month, Year, and Era Format Picture strings to format a date.

```javascript
function onTxError(error) {
    console.error("TX Text Control error:", error.msg);
    error.handled = true;
}

function inspectSupportedDateFormats(dateFormField) {
    dateFormField.getSupportedDateFormats(
        function(result) {
            console.log("get supported date formats result:", result);
        },
        onTxError
    );
}
```

---

## Nearby

- **Previous:** [Javascript: DateFormField.getEmptyWidth Method](https://docs.textcontrol.com/ds-server/reference/javascript/dateformfield/getemptywidth-method/llms-full.txt)
- **Next:** [Javascript: DateFormField.setDate Method](https://docs.textcontrol.com/ds-server/reference/javascript/dateformfield/setdate-method/llms-full.txt)
