import { format, formatDistanceToNow } from 'date-fns';
import * as Locale from 'date-fns/locale';
import { getSupportedDateLocale } from './getSupportedDateLocale.js';
export const formatDate = (date, pattern, locale)=>{
    const theDate = new Date(date);
    const currentLocale = Locale[getSupportedDateLocale(locale)];
    return format(theDate, pattern, {
        locale: currentLocale
    });
};
export const formatTimeToNow = (date, locale)=>{
    const theDate = new Date(date);
    const currentLocale = Locale[getSupportedDateLocale(locale)];
    return formatDistanceToNow(theDate, {
        locale: currentLocale
    });
};

//# sourceMappingURL=index.js.map