Date format problem in angular

Tags: #<Tag:0x00007f8b28cf2aa0>

i want the dates to be formatted like that DD/MM/YYYY at the nitinitialisation of the table but unfortunately nothing is happened.
// ----------------------------------------------------------------------------------------------
this is my html
<hot-table id=“hot” [hotId]=“idTableau” class=“hot” [data]=“majStocksArray” [settings]=“hotSettings” >

// ----------------------------------------------------------------------------------------------
this is my settings

hotSettings: Handsontable.GridSettings = {

height: MajStockComponent.HANDSON_TABLE_HEIGHT,

width: MajStockComponent.HANDSON_TABLE_WIDTH,

stretchH: 'all',

rowHeaderWidth: MajStockComponent.HANDSON_TABLE_ROW_HEADER_WIDTH,

colWidths: MajStockComponent.HANDSON_TABLE_COL_WIDTH, 

colHeaders: MajStockComponent.HANDSON_TABLE_IS_COL_HEADER,

licenseKey: ConstantesNuc.LICENCE_KEY_TABLE_HANDSOME_TABLE,

language: ConstantesNuc.HANDSOME_FR,

columns: [

  {

    data: "code",

    type: 'text',

    readOnly: true

  },

  {

    data: "num",

    type: 'text',

    readOnly: true

  },



  {

    data: "date",

    type: 'date',

    readOnly: true,

    dateFormat: 'DD/MM/YYYY',

    correctFormat: true,

  

  },

  

],

nestedHeaders: [

  [{ label: '', colspan: 3 }],

  ['Code ', 'Num ', 'Date']

],

afterLoadData:(bool)=>{

    this.afterRender();

},

}
// ----------------------------------------------------------------------------------------------
this is the method afterRender:
private afterRender( ) {

console.log("rendere")

this.hotRegisterer.getInstance(this.idTableau).render();

this.hotRegisterer.getInstance(this.idTableau).validateCells();

}

// ----------------------------------------------------------------------------------------------
and even when i use the hooks (afterViewInit of angular it says that cannot execute render of undefined

Hi @fatmaedf

Here is a tutorial on how to reference the Handsontable instance from the Angular wrapper component - https://handsontable.com/docs/7.4.2/frameworks-wrapper-for-angular-hot-reference.html

Without a wrapper, your date format is available, as you can see on this demo - https://jsfiddle.net/4ozwjfvL/

If you can prepare a demo in which we can reproduce the issue, it would be easier to work on it

in the demo dates are string but in my case it s date oject so it must be formatted

I’m not sure.
In your code sample, we have dateFormat: 'DD/MM/YYYY', just as in my demo dateFormat: 'DD/MM/YYYY',.

If I’m wrong please create a demo in which exactly reproduced your issue.

I believe that we can close this topic as solved as there are no new comments within 2 weeks.

However, if you need anything please send us an email to support@handsontable.com