Module

comments/utils/getdatetimeformatter

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

module

Filtering

Interfaces

  • LocaleConfig

Functions

  • getDateTimeFormatter( localeConfig ) → function

    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 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