From 2267747fcd05ca003eb1a0c289de39c80062c8fb Mon Sep 17 00:00:00 2001 From: Francesco Esposito <33671357+frsposito@users.noreply.github.com> Date: Thu, 25 Jul 2019 09:53:57 +0200 Subject: [PATCH] feat: add helper module --- src/utils/helper.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 src/utils/helper.js diff --git a/src/utils/helper.js b/src/utils/helper.js new file mode 100644 index 0000000..b58fbdf --- /dev/null +++ b/src/utils/helper.js @@ -0,0 +1,15 @@ +import moment from 'moment'; + +export const formatDate = (dateString) => { + + if (dateString) { + const date = moment(dateString); + return date.format('DD-MM-YYYY HH:mm'); + } + + return ''; +} + +export const decode = (value) => { + return value.replace(/_/g, " "); +}