Module

comments/utils/getdatetimeformatter

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

module

Filtering

Interfaces

  • LocaleConfig

    The localization configuration.

Functions

  • getDateTimeFormatter( localeConfig ) → function

    Returns a function that formats date to the set format.

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

    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

    localeConfig : Object

    Returns

    function