'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

const index = require('./index-1ee80297.js');
const index$1 = require('./index-1f95aafc.js');
const date = require('./date-25b104f6.js');
require('./_commonjsHelpers-206db00d.js');
require('./moment-d48a0164.js');
require('./BaseField-d019ade6.js');

const dvnFieldDisplayCellDateCss = ".sc-dvn-field-display-cell-date-h{display:block;padding:6px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}";

let DvnFieldDisplayCellDate = class {
  constructor(hostRef) {
    index.registerInstance(this, hostRef);
  }
  render() {
    let date$1 = this.value;
    if (this.field.dateDataType === date.DateDataType.ISO) {
      date$1 = new Date(this.value);
    }
    else if (this.field.dateDataType === date.DateDataType.Unix) {
      date$1 = new Date(this.value * 1000);
    }
    let formattedDate = '';
    if (this.value) {
      if (this.meta.timeZone) {
        formattedDate = index$1.momentTimezone(date$1).tz(this.meta.timeZone).format(this.field.dateFormat);
      }
      else {
        formattedDate = index$1.momentTimezone(date$1).format(this.field.dateFormat);
      }
    }
    return (index.h(index.Host, null, formattedDate));
  }
};
DvnFieldDisplayCellDate.style = dvnFieldDisplayCellDateCss;

exports.dvn_field_display_cell_date = DvnFieldDisplayCellDate;
