rsnext/examples/cms-wordpress/components/date.tsx
Chaiwat Trisuwan 5f483b9743
Examples/cms-wordpress migrate to TypeScript (#39250)
## Documentation / Examples

Not sure that I need to provide type to all of components or not?
Let me know if you want me to provide.
- [x] Closes #38752
- [x] Make sure the linting passes by running `pnpm lint`
- [x] The examples guidelines are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing.md#adding-examples)
2022-08-05 16:44:19 +00:00

6 lines
205 B
TypeScript

import { parseISO, format } from 'date-fns'
export default function Date({ dateString }) {
const date = parseISO(dateString)
return <time dateTime={dateString}>{format(date, 'LLLL d, yyyy')}</time>
}