diff --git a/js/app.js b/js/app.js
index a205967..b648609 100644
--- a/js/app.js
+++ b/js/app.js
@@ -5,8 +5,6 @@ import '@popperjs/core'
import $ from 'jquery'
import Josh from 'joshjs'
-let dates = require('./dates')
-
new Josh()
$(function () {
@@ -19,7 +17,3 @@ $(function () {
.html("Selected File:
" + fileName + '
')
})
})
-
-document.querySelectorAll('.date-time').forEach((d) => {
- d.innerHTML = dates.formatDateTime(d.innerHTML)
-})
diff --git a/js/dates.js b/js/dates.js
deleted file mode 100644
index 6e25249..0000000
--- a/js/dates.js
+++ /dev/null
@@ -1,24 +0,0 @@
-const moment = require('moment')
-
-const formatDateTime = datetime => {
- /*
- Safari wants strict iso8601 format "YYYY-MM-DDTHH:MM:SSZ",
- but elixir to_string default supplies as "YYYY-MM-DD HH:MM:SSZ".
- So this attempts to transform the dates if needed
- */
- datetime = datetime
- .trim()
- .split(' ')
- .join('T')
-
- if (datetime === 'never' || datetime === '') {
- return datetime
- } else {
- return moment
- .utc(datetime)
- .local()
- .format('MMM Do, YYYY [at] h:mma')
- }
-}
-
-module.exports = { formatDateTime }
diff --git a/js/dates.test.js b/js/dates.test.js
deleted file mode 100644
index ca0cc7f..0000000
--- a/js/dates.test.js
+++ /dev/null
@@ -1,22 +0,0 @@
-const dates = require('./dates')
-const moment = require('moment')
-
-describe('formatDateTime', () => {
- test('formats ISO 8601 dates', () => {
- let date = new Date()
- let testDate = moment
- .utc(date)
- .local()
- .format('MMM Do, YYYY [at] h:mma')
-
- expect(dates.formatDateTime(date.toISOString())).toBe(testDate)
- })
-
- test('preserves "never" value', () => {
- expect(dates.formatDateTime('never')).toBe('never')
- })
-
- test('handles white space around "never" value', () => {
- expect(dates.formatDateTime(' never ')).toBe('never')
- })
-})
diff --git a/package-lock.json b/package-lock.json
index cf575b4..36f774d 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -10,7 +10,6 @@
"bootstrap": "^5.1.3",
"joshjs": "^1.0.7",
"jquery": "^3.6.0",
- "moment": "^2.29.2",
"xterm": "^4.18.0",
"xterm-addon-fit": "^0.5.0"
},
@@ -8656,14 +8655,6 @@
"node": ">=10"
}
},
- "node_modules/moment": {
- "version": "2.29.2",
- "resolved": "https://registry.npmjs.org/moment/-/moment-2.29.2.tgz",
- "integrity": "sha512-UgzG4rvxYpN15jgCmVJwac49h9ly9NurikMWGPdVxm8GZD6XjkKPxDTjQQ43gtGgnV3X0cAyWDdP2Wexoquifg==",
- "engines": {
- "node": "*"
- }
- },
"node_modules/ms": {
"version": "2.1.2",
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
@@ -18438,11 +18429,6 @@
"integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==",
"dev": true
},
- "moment": {
- "version": "2.29.2",
- "resolved": "https://registry.npmjs.org/moment/-/moment-2.29.2.tgz",
- "integrity": "sha512-UgzG4rvxYpN15jgCmVJwac49h9ly9NurikMWGPdVxm8GZD6XjkKPxDTjQQ43gtGgnV3X0cAyWDdP2Wexoquifg=="
- },
"ms": {
"version": "2.1.2",
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
diff --git a/package.json b/package.json
index 0c0b4c9..e216da9 100644
--- a/package.json
+++ b/package.json
@@ -14,7 +14,6 @@
"bootstrap": "^5.1.3",
"joshjs": "^1.0.7",
"jquery": "^3.6.0",
- "moment": "^2.29.2",
"xterm": "^4.18.0",
"xterm-addon-fit": "^0.5.0"
},