diff options
| author | Andrew Lee <alee14498@protonmail.com> | 2023-07-17 15:08:57 -0400 |
|---|---|---|
| committer | Andrew Lee <alee14498@protonmail.com> | 2023-07-17 15:08:57 -0400 |
| commit | ddbe4fa61425f6a871a23238ce15a0929e201e6e (patch) | |
| tree | c1d5c2a0674bcbf2cf79180445d8d26518b7009d /components/updates/DateFormatter.js | |
| parent | 8fbaca0d8ec9dc1323facb7f4c0029e32cfe5223 (diff) | |
| download | alure-website-ddbe4fa61425f6a871a23238ce15a0929e201e6e.tar.gz alure-website-ddbe4fa61425f6a871a23238ce15a0929e201e6e.tar.bz2 alure-website-ddbe4fa61425f6a871a23238ce15a0929e201e6e.zip | |
Modularizing certain elements; Working information section
Diffstat (limited to 'components/updates/DateFormatter.js')
| -rw-r--r-- | components/updates/DateFormatter.js | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/components/updates/DateFormatter.js b/components/updates/DateFormatter.js new file mode 100644 index 0000000..11f3bf3 --- /dev/null +++ b/components/updates/DateFormatter.js @@ -0,0 +1,9 @@ + +import { parseISO, format } from 'date-fns' + +const DateFormatter = (dateString) => { + const date = parseISO(dateString) + return <time dateTime={dateString}>{format(date, 'LLLL d, yyyy')}</time> +} + +export default DateFormatter
\ No newline at end of file |
