Skip to content

Commit

Permalink
Merge pull request #2898 from OpenNeuroOrg/drop-moment
Browse files Browse the repository at this point in the history
deps(server): Drop moment.js in favor of date-fns
  • Loading branch information
nellh authored Sep 18, 2023
2 parents b658c22 + df85aa6 commit 5b4f5e4
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 36 deletions.
10 changes: 0 additions & 10 deletions .pnp.cjs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -1454,7 +1454,7 @@ OCI-1131441 (R. Poldrack, PI) in any publications.
>
Uploaded by
</h2>
Test User on 2021-12-17 - over 1 year ago
Test User on 2021-12-17 - almost 2 years ago
</div>
<div
class="dataset-meta-block undefined"
Expand All @@ -1464,7 +1464,7 @@ OCI-1131441 (R. Poldrack, PI) in any publications.
>
Last Updated
</h2>
2021-12-17 - over 1 year ago
2021-12-17 - almost 2 years ago
</div>
<div
class="dataset-meta-block undefined"
Expand Down
1 change: 0 additions & 1 deletion packages/openneuro-server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@
"jsonwebtoken": "^9.0.0",
"keyv": "^4.5.3",
"mime-types": "^2.1.19",
"moment": "^2.14.1",
"mongoose": "^6.11.3",
"morgan": "^1.6.1",
"node-mailjet": "^3.3.5",
Expand Down
4 changes: 2 additions & 2 deletions packages/openneuro-server/src/handlers/comments.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// @ts-nocheck
import notifications from '../libs/notifications.js'
import moment from 'moment'
import { format } from 'date-fns/format'
import User from '../models/user'
import Comment from '../models/comment'
import MailgunIdentifier from '../models/mailgunIdentifier'
Expand Down Expand Up @@ -63,7 +63,7 @@ export async function reply(req, res, next) {
parentId: parentId,
text: text,
user: flattenedUser,
createDate: moment().format(),
createDate: format(new Date()),
}
Comment.create(comment, (err, response) => {
if (err) {
Expand Down
4 changes: 2 additions & 2 deletions packages/openneuro-server/src/libs/notifications.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { send as emailSend } from './email'
import request from 'superagent'
import User from '../models/user'
import Subscription from '../models/subscription'
import moment from 'moment'
import { format } from 'date-fns'
import url from 'url'
import bidsId from './bidsId'
import { convertFromRaw, EditorState } from 'draft-js'
Expand Down Expand Up @@ -150,7 +150,7 @@ const notifications = {
datasetLabel: datasetLabel,
commentUserId: userId,
commentId: commentId,
dateCreated: moment(comment.createDate).format('MMMM Do'),
dateCreated: format(comment.createDate, 'MMMM Do'),
commentContent: htmlContent,
commentStatus: commentStatus,
siteUrl:
Expand Down
30 changes: 11 additions & 19 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4874,8 +4874,8 @@ __metadata:
"@emotion/react": 11.11.1
"@emotion/styled": 11.11.0
"@niivue/niivue": 0.34.0
"@openneuro/client": ^4.20.0-alpha.3
"@openneuro/components": ^4.20.0-alpha.3
"@openneuro/client": ^4.20.0-alpha.4
"@openneuro/components": ^4.20.0-alpha.4
"@tanstack/react-table": ^8.9.3
"@testing-library/jest-dom": 6.1.3
"@testing-library/react": ^11.1.0
Expand Down Expand Up @@ -4926,7 +4926,7 @@ __metadata:
resolution: "@openneuro/cli@workspace:packages/openneuro-cli"
dependencies:
"@apollo/client": 3.7.2
"@openneuro/client": ^4.20.0-alpha.3
"@openneuro/client": ^4.20.0-alpha.4
"@types/mkdirp": 1.0.2
"@types/node": 18.11.9
bids-validator: 1.13.0
Expand All @@ -4951,14 +4951,14 @@ __metadata:
languageName: unknown
linkType: soft

"@openneuro/client@^4.20.0-alpha.3, @openneuro/client@workspace:packages/openneuro-client":
"@openneuro/client@^4.20.0-alpha.4, @openneuro/client@workspace:packages/openneuro-client":
version: 0.0.0-use.local
resolution: "@openneuro/client@workspace:packages/openneuro-client"
dependencies:
"@apollo/client": 3.7.2
"@graphql-tools/mock": ^9.0.0
"@graphql-tools/schema": ^10.0.0
"@openneuro/server": ^4.20.0-alpha.3
"@openneuro/server": ^4.20.0-alpha.4
core-js: ^3.10.1
crypto-hash: ^1.3.0
graphql: 16.6.0
Expand All @@ -4970,7 +4970,7 @@ __metadata:
languageName: unknown
linkType: soft

"@openneuro/components@^4.20.0-alpha.3, @openneuro/components@workspace:packages/openneuro-components":
"@openneuro/components@^4.20.0-alpha.4, @openneuro/components@workspace:packages/openneuro-components":
version: 0.0.0-use.local
resolution: "@openneuro/components@workspace:packages/openneuro-components"
dependencies:
Expand Down Expand Up @@ -5012,8 +5012,8 @@ __metadata:
dependencies:
"@apollo/client": 3.7.2
"@elastic/elasticsearch": 7.15.0
"@openneuro/client": ^4.20.0-alpha.3
"@openneuro/search": ^4.20.0-alpha.3
"@openneuro/client": ^4.20.0-alpha.4
"@openneuro/search": ^4.20.0-alpha.4
"@types/jsonwebtoken": ^8
"@types/node": 18.11.9
"@types/tsc-watch": ^4
Expand All @@ -5027,7 +5027,7 @@ __metadata:
languageName: unknown
linkType: soft

"@openneuro/search@^4.20.0-alpha.3, @openneuro/search@workspace:packages/openneuro-search":
"@openneuro/search@^4.20.0-alpha.4, @openneuro/search@workspace:packages/openneuro-search":
version: 0.0.0-use.local
resolution: "@openneuro/search@workspace:packages/openneuro-search"
dependencies:
Expand All @@ -5042,7 +5042,7 @@ __metadata:
languageName: unknown
linkType: soft

"@openneuro/server@^4.20.0-alpha.3, @openneuro/server@workspace:packages/openneuro-server":
"@openneuro/server@^4.20.0-alpha.4, @openneuro/server@workspace:packages/openneuro-server":
version: 0.0.0-use.local
resolution: "@openneuro/server@workspace:packages/openneuro-server"
dependencies:
Expand All @@ -5052,7 +5052,7 @@ __metadata:
"@elastic/elasticsearch": 7.15.0
"@graphql-tools/schema": ^10.0.0
"@keyv/redis": ^2.7.0
"@openneuro/search": ^4.20.0-alpha.3
"@openneuro/search": ^4.20.0-alpha.4
"@passport-next/passport-google-oauth2": ^1.0.0
"@sentry/node": ^4.5.3
"@types/cors": ^2
Expand Down Expand Up @@ -5086,7 +5086,6 @@ __metadata:
jsonwebtoken: ^9.0.0
keyv: ^4.5.3
mime-types: ^2.1.19
moment: ^2.14.1
mongoose: ^6.11.3
morgan: ^1.6.1
node-mailjet: ^3.3.5
Expand Down Expand Up @@ -17395,13 +17394,6 @@ fsevents@~2.3.2:
languageName: node
linkType: hard

"moment@npm:^2.14.1":
version: 2.29.1
resolution: "moment@npm:2.29.1"
checksum: 1e14d5f422a2687996be11dd2d50c8de3bd577c4a4ca79ba5d02c397242a933e5b941655de6c8cb90ac18f01cc4127e55b4a12ae3c527a6c0a274e455979345e
languageName: node
linkType: hard

"mongodb-connection-string-url@npm:^2.5.4":
version: 2.5.4
resolution: "mongodb-connection-string-url@npm:2.5.4"
Expand Down

0 comments on commit 5b4f5e4

Please sign in to comment.