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