@chayns-components/date
Version:
A set of beautiful React components for developing your own applications with chayns.
28 lines • 752 B
JavaScript
import React, { useMemo } from 'react';
import { useDateInfo } from '../../hooks/useDateInfo';
const DateInfo = _ref => {
let {
date,
preText = '',
shouldShowYear,
shouldShowTime,
shouldShowRelativeDayOfWeek,
shouldUseShortText,
shouldShowDayOfWeek,
shouldShowDateToNowDifference
} = _ref;
const formattedDate = useDateInfo({
date,
preText,
shouldShowYear,
shouldShowTime,
shouldUseShortText,
shouldShowDayOfWeek,
shouldShowRelativeDayOfWeek,
shouldShowDateToNowDifference
});
return useMemo(() => /*#__PURE__*/React.createElement("span", null, formattedDate), [formattedDate]);
};
DateInfo.displayName = 'DateInfo';
export default DateInfo;
//# sourceMappingURL=DateInfo.js.map