Open this example in the interactive library
Live preview
Source code
// components/QuarterIdentifier.tsx
export default function QuarterIdentifier({
day = "2028-02-29",
}: { day?: string } = {}) {
const d = new Date(day + "T00:00Z");
return (
<time dateTime={day}>
Q{1 + Math.floor(d.getUTCMonth() / 3)} {d.getUTCFullYear()}
</time>
);
}
