'use strict';

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

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

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

let DvnFieldDisplayDate = 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 = moment.hooks(date$1).tz(this.meta.timeZone).format(this.field.dateFormat);
      }
      else {
        formattedDate = moment.hooks(date$1).format(this.field.dateFormat);
      }
    }
    return (index.h(index.Host, null, formattedDate));
  }
};
DvnFieldDisplayDate.style = dvnFieldDisplayDateCss;

exports.dvn_field_display_date = DvnFieldDisplayDate;
