@kadconsulting/dry
Version:
KAD Reusable Component Library
15 lines • 725 B
JavaScript
// TODO-p3: We need to combine this with formattedDisplayTime and use the same function for both
const formattedDisplayTimeMonth = (timeString) => {
const date = new Date(timeString);
// Specify the locale as 'en-US' for United States date format
// and set options to display a full month name, and numeric day and year
const options = {
month: 'long', // 'long' for the full month name
day: 'numeric', // 'numeric' for the day of the month
year: 'numeric', // 'numeric' for the year
};
const formattedDate = date.toLocaleDateString('en-US', options);
return formattedDate;
};
export default formattedDisplayTimeMonth;
//# sourceMappingURL=formattedDisplayTimeMonth.js.map