import { getYear, getQuarter, startOfWeek, endOfWeek } from 'date-fns';
import { formatDate, formatDateRange } from './index';
export function formatText(selected, format) {
    return selected ? formatDate(format, selected) : '';
}
export function quarterFormatText(selected, i18n) {
    return selected
        ? i18n.panel.yearQuarterName({
            year: getYear(selected),
            quarter: getQuarter(selected) - 1,
        })
        : '';
}
export function weekFormatText(selected, format, options) {
    var dates = selected &&
        [startOfWeek(selected, options), endOfWeek(selected, options)];
    return dates ? formatDateRange(dates, format) : ['', ''];
}
export function formatTextRange(selected, format) {
    return formatDateRange(selected, format);
}
