Interface

LocaleConfig (comments/utils)

@ckeditor/ckeditor5-comments/src/utils/getdatetimeformatter

interface

The localization configuration.

	ClassicEditor
		.create( {
 			language: '',
			locale: {
				// The localization configuration.
			}
		} )
		.then( ... )
		.catch( ... );

See all editor configuration options.

Filtering

Methods

  • dateTimeFormat( date ) → String

    A function that formats date to the custom format.

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

    import format from 'date-fns/format';
    
    	ClassicEditor
    		.create( document.querySelector( '#editor' ), {
    			toolbar: {
    				items: [ 'bold', 'italic', '|', 'comment' ]
    			},
    			sidebar: {
    				container: document.querySelector( '#sidebar' )
    			},
    			locale: {
    				dateTimeFormat: date => format( date, 'dd/MM/yyyy' )
    			}
    		} )
    		.catch( error => console.error( error ) );
    

    Parameters

    date : Date

    Returns

    String

    The generated date.