collaboration-core/utils/getdatetimeformatter
module
Functions
-
getDateTimeFormatter( localeConfig, [ locale ] ) → ( date: string | Date ) => string
module:collaboration-core/utils/getdatetimeformatter~getDateTimeFormatter
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
.import { DateTime } from 'luxon'; ClassicEditor .create( 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