import { useBlockProps, RichText } from "@wordpress/block-editor";
export default function save({ attributes }) {
	const { date } = attributes;
	const formattedDate = date && date.formattedTime ? date.formattedTime : "";
	const savedDate = date && date.time ? date.time : new Date().toString();

	return (
		<time
			{...useBlockProps.save({
				className: `homegrade-blocks-date`,
			})}
			datetime={savedDate}
		>
			{formattedDate}
		</time>
	);
}
