# collaboration-core/utils/getdatetimeformatter

module

<a id="functions">

## Functions

<a id="function-getDateTimeFormatter">

### `getDateTimeFormatter( localeConfig, locale? ) → ( date: string | Date ) => string`

Returns a function that formats the date to the set format.

The default formatting can be changed by setting a custom formatting function to `config.locale.dateTimeFormat`.

```typescript
import { DateTime } from 'luxon';

		ClassicEditor
			.create( {
				attachTo: document.querySelector( '#editor' ),
				toolbar: {
					items: [ 'bold', 'italic', '|', 'comment' ]
				},
				sidebar: {
					container: document.querySelector( '#sidebar' )
				},
				locale: {
					dateTimeFormat: date => DateTime.fromJSDate( date ).toFormat( 'dd/LL/yyyy' )
				}
			} )
			.catch( error => console.error( error ) );
```

#### Parameters

* `localeConfig: LocaleConfig`

  Defaults to `{}`

* `locale?: Locale`

#### Returns

* `( date: string | Date ) => string`

---

Full index of the CKEditor 5 API reference: [llms.txt](llms.txt)
