import React__default from 'react';

function FormatDate({ date: inputDate, showYear = true, }) {
    let dateObject;
    if (inputDate instanceof Date) {
        dateObject = inputDate;
    }
    else {
        dateObject = new Date(inputDate);
    }
    return React__default.createElement(React__default.Fragment, null, strFormatDate(dateObject, showYear));
}
function strFormatDate(date, showYear = true) {
    let formatOptions = {
        month: "short",
        day: "numeric",
    };
    if (showYear) {
        formatOptions = Object.assign(Object.assign({}, formatOptions), { year: "numeric" });
    }
    return date.toLocaleDateString(undefined, formatOptions);
}

export { FormatDate as F, strFormatDate as s };
