BoldSignA modern eSignature application with affordable pricing. Sign up today for unlimited document usage!
Version @syncfusion/ej2-vue-spreadsheet 19.1.59
When loaded file, date format is 'mm/dd/yyyy'.
How change 'Short date' format on 'dd.mm.yyyy'
Thank you.
Hi,
Your requirement can be achieved by using the custom number formatting option in the UI level through the toolbar button. To apply this format programmatically, you can use the numberFormat method. Please find the sample link below.
Sample Link: https://stackblitz.com/edit/lb7nsg?file=index.ts
Demo Link: https://ej2.syncfusion.com/vue/demos/#/bootstrap5/spreadsheet/number-formatting.html
Documentation Link: https://ej2.syncfusion.com/vue/documentation/spreadsheet/formatting/#number-formatting
We opened file by URL, and we don`t know where date cells been.
How overide ShortDate globaly.
Thanks.
Hi,
Your requirement to apply the custom number formats for imported excel file can be achieved by using the actionComplete and openComplete event as shown below.
openComplete: (): void => { applyFormat(); }, actionComplete: (args): void => { if (args.action == 'gotoSheet') applyFormat();// apply number format for multiple sheets while tab switching. },
function applyFormat() { let sheet = spreadsheet.getActiveSheet(); let range = sheet.usedRange; for (var i = 0; i <= range.rowIndex; i++) { for (var j = 0; j <= range.colIndex; j++) { let cell = getCell(i, j, sheet); if (cell && cell.format === 'mm-dd-yyyy') { let address = getCellAddress(i, j); spreadsheet.numberFormat('dd.mm.yyyy', address); // apply number format } } } }
|
Sample Link: https://stackblitz.com/edit/lb7nsg-dm8xlp?file=index.ts