aboutsummaryrefslogtreecommitdiff
path: root/components/DateFormatter.js
diff options
context:
space:
mode:
authorAndrew Lee <alee14498@protonmail.com>2023-07-15 20:22:10 -0400
committerAndrew Lee <alee14498@protonmail.com>2023-07-15 20:22:10 -0400
commit8c1cf540c998d554b10282292edeb28b74349297 (patch)
tree1553070a4c5b6a555b96c71a98b4b5406dd87c76 /components/DateFormatter.js
parentf4abb8200e49024311d9fd8f5130ed189e139fe3 (diff)
downloadalure-website-8c1cf540c998d554b10282292edeb28b74349297.tar.gz
alure-website-8c1cf540c998d554b10282292edeb28b74349297.tar.bz2
alure-website-8c1cf540c998d554b10282292edeb28b74349297.zip
Getting ready to properly add travel advisory; Added additional cities
Diffstat (limited to 'components/DateFormatter.js')
-rw-r--r--components/DateFormatter.js9
1 files changed, 9 insertions, 0 deletions
diff --git a/components/DateFormatter.js b/components/DateFormatter.js
new file mode 100644
index 0000000..11f3bf3
--- /dev/null
+++ b/components/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