import { r as registerInstance, h, H as Host } from './index-b6f10a81.js';
import './BaseField-d94c5b14.js';
import { a as DateDataType } from './date-b270be76.js';
import { h as hooks } from './moment-6f6ab70c.js';

const dvnFieldDisplayDateCss = ".sc-dvn-field-display-date-h{display:block;height:20px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}";

const DvnFieldDisplayDate = class {
  constructor(hostRef) {
    registerInstance(this, hostRef);
  }
  render() {
    let date = this.value;
    if (this.field.dateDataType === DateDataType.Unix) {
      date = new Date(this.value * 1000);
    }
    return (h(Host, null, this.value ? hooks(date).format(this.field.dateFormat) : '-'));
  }
};
DvnFieldDisplayDate.style = dvnFieldDisplayDateCss;

export { DvnFieldDisplayDate as dvn_field_display_date };
