import { needFullMonth } from "./dateHelper";
import { getOriginalDates } from "./getOriginalDates";
import { normalizeDates } from "./normalizeDates";
export var getFormattedDates = function getFormattedDates(param) {
    var value = param.value, lang = param.lang, format = param.format, includeEdgeDates = param.includeEdgeDates, min = param.min, max = param.max;
    var _getOriginalDates = getOriginalDates(value, lang, format), formattedDate = _getOriginalDates.formattedDate, isoDate = _getOriginalDates.isoDate, originalDate = _getOriginalDates.originalDate;
    if (!originalDate) {
        var innerValue = format && (needFullMonth(format) ? formattedDate : formattedDate.slice(0, format.length));
        return {
            formattedDate: innerValue || '',
            isoDate: isoDate,
            originalDate: originalDate
        };
    }
    var _normalizeDates = normalizeDates({
        originalDate: originalDate,
        lang: lang,
        format: format,
        includeEdgeDates: includeEdgeDates,
        min: min,
        max: max
    }), normalizedDate = _normalizeDates.normalizedDate, formattedNormalizedDate = _normalizeDates.formattedNormalizedDate;
    return {
        formattedDate: formattedNormalizedDate,
        isoDate: normalizedDate.toISOString(),
        originalDate: normalizedDate
    };
};
