import { DesignSystem } from '@ni/fast-foundation';
import { template } from '../../text-base/cell-view/template';
import { styles } from '../../text-base/cell-view/styles';
import { TableColumnTextCellViewBase } from '../../text-base/cell-view';
import { formatNumericDate } from '../models/format-helper';
/**
 * A cell view for displaying date/time fields as text
 */
export class TableColumnDateTextCellView extends TableColumnTextCellViewBase {
    updateText() {
        if (this.columnConfig) {
            this.text = formatNumericDate(this.columnConfig.formatter, this.cellRecord?.value);
        }
        else {
            this.text = '';
        }
    }
}
const dateTextCellView = TableColumnDateTextCellView.compose({
    baseName: 'table-column-date-text-cell-view',
    template,
    styles
});
DesignSystem.getOrCreate().withPrefix('nimble').register(dateTextCellView());
export const tableColumnDateTextCellViewTag = 'nimble-table-column-date-text-cell-view';
//# sourceMappingURL=index.js.map