mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ADF-3494] date format fix (#3762)
* fix date formats for columns * fix date formatting for columns * fix data binding support
This commit is contained in:
committed by
Eugenio Romano
parent
1ff4b3a322
commit
5b534c409f
@@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { Component, ViewEncapsulation, OnInit } from '@angular/core';
|
||||
import { Component, ViewEncapsulation } from '@angular/core';
|
||||
import { DataTableCellComponent } from './datatable-cell.component';
|
||||
import {
|
||||
UserPreferencesService,
|
||||
@@ -40,9 +40,15 @@ import {
|
||||
encapsulation: ViewEncapsulation.None,
|
||||
host: { class: 'adf-date-cell' }
|
||||
})
|
||||
export class DateCellComponent extends DataTableCellComponent implements OnInit {
|
||||
export class DateCellComponent extends DataTableCellComponent {
|
||||
currentLocale;
|
||||
format = 'medium';
|
||||
|
||||
get format(): string {
|
||||
if (this.column) {
|
||||
return this.column.format || 'medium';
|
||||
}
|
||||
return 'medium';
|
||||
}
|
||||
|
||||
constructor(userPreferenceService: UserPreferencesService) {
|
||||
super();
|
||||
@@ -55,12 +61,4 @@ export class DateCellComponent extends DataTableCellComponent implements OnInit
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
super.ngOnInit();
|
||||
|
||||
if (this.column) {
|
||||
this.format = this.column.format || 'medium';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user