summaryrefslogtreecommitdiff
path: root/graphs/js/replace/replace.js
diff options
context:
space:
mode:
Diffstat (limited to 'graphs/js/replace/replace.js')
-rw-r--r--graphs/js/replace/replace.js8
1 files changed, 8 insertions, 0 deletions
diff --git a/graphs/js/replace/replace.js b/graphs/js/replace/replace.js
new file mode 100644
index 0000000..24b79e4
--- /dev/null
+++ b/graphs/js/replace/replace.js
@@ -0,0 +1,8 @@
+function replace(str) {
+ const captureDateRegex = new RegExp("(\\d{2})/(\\d{2})/(\\d{4})", "g");
+
+ return str.replaceAll(captureDateRegex, "$3-$1-$2");
+}
+module.exports = {
+ replace,
+};