"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.timeFormatValue = exports.getTimeFormatPlaceholder = exports.TimeFormat = exports.getRangePlaceholder = exports.getPlaceholder = exports.prefixCls = void 0;
exports.prefixCls = 'dmc-date-picker';

function getPlaceholder(picker, locale, customizePlaceholder) {
  if (customizePlaceholder !== undefined) {
    return customizePlaceholder;
  }

  if (picker === 'year' && locale.lang.yearPlaceholder) {
    return locale.lang.yearPlaceholder;
  }

  if (picker === 'quarter' && locale.lang.quarterPlaceholder) {
    return locale.lang.quarterPlaceholder;
  }

  if (picker === 'month' && locale.lang.monthPlaceholder) {
    return locale.lang.monthPlaceholder;
  }

  if (picker === 'week' && locale.lang.weekPlaceholder) {
    return locale.lang.weekPlaceholder;
  }

  if (picker === 'time' && locale.timePickerLocale.placeholder) {
    return locale.timePickerLocale.placeholder;
  }

  return locale.lang.placeholder;
}

exports.getPlaceholder = getPlaceholder;

function getRangePlaceholder(picker, locale, customizePlaceholder) {
  if (customizePlaceholder !== undefined) {
    return customizePlaceholder;
  }

  if (picker === 'year' && locale.lang.yearPlaceholder) {
    return locale.lang.rangeYearPlaceholder;
  }

  if (picker === 'month' && locale.lang.monthPlaceholder) {
    return locale.lang.rangeMonthPlaceholder;
  }

  if (picker === 'week' && locale.lang.weekPlaceholder) {
    return locale.lang.rangeWeekPlaceholder;
  }

  if (picker === 'time' && locale.timePickerLocale.placeholder) {
    return locale.timePickerLocale.rangePlaceholder;
  }

  return locale.lang.rangePlaceholder;
}

exports.getRangePlaceholder = getRangePlaceholder;
var TimeFormat;

(function (TimeFormat) {
  TimeFormat["no"] = "no";
  TimeFormat["hm"] = "hm";
  TimeFormat["hms"] = "hms";
})(TimeFormat = exports.TimeFormat || (exports.TimeFormat = {}));

function getTimeFormatPlaceholder(val, locale) {
  if (val === TimeFormat.hms) {
    return locale.lang.TimeFormatYMDHmS;
  }

  if (val === TimeFormat.hm) {
    return locale.lang.TimeFormatYMDHm;
  }

  return locale.lang.TimeFormatYMD;
}

exports.getTimeFormatPlaceholder = getTimeFormatPlaceholder;

function timeFormatValue(f) {
  var NO_DATE_FORMATTER = 'YYYY-MM-DD';
  var HM_DATE_FORMATTER = 'YYYY-MM-DD HH:mm';
  var HMS_DATE_FORMATTER = 'YYYY-MM-DD HH:mm:ss';

  if (!f || f === TimeFormat.no) {
    return NO_DATE_FORMATTER;
  }

  if (f === TimeFormat.hm) {
    return HM_DATE_FORMATTER;
  }

  if (f === TimeFormat.hms) {
    return HMS_DATE_FORMATTER;
  }
}

exports.timeFormatValue = timeFormatValue;

