From da8f9c3c731d7511b59b994e47762d6f0770b554 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Sat, 19 Nov 2022 22:53:33 +0300 Subject: Moment -> Day.js --- vnext/package-lock.json | 25 +++++++++++-------------- vnext/package.json | 2 +- vnext/src/ui/Chat.js | 6 ++++-- vnext/src/ui/Feeds.js | 6 ++++-- vnext/src/ui/Message.js | 10 +++++++--- 5 files changed, 27 insertions(+), 22 deletions(-) (limited to 'vnext') diff --git a/vnext/package-lock.json b/vnext/package-lock.json index 237a10b7..8257642c 100644 --- a/vnext/package-lock.json +++ b/vnext/package-lock.json @@ -15,12 +15,12 @@ "config": "^3.3.8", "core-js": "^3.26.1", "cors": "^2.8.5", + "dayjs": "^1.11.6", "esbuild": "^0.15.14", "evil-icons": "^1.10.1", "express": "^4.18.2", "ignore-styles": "^5.0.1", "mailparser": "^3.5.0", - "moment": "^2.29.4", "node-pushnotifications": "^2.0.3", "qs": "^6.11.0", "react": "18.2.0", @@ -5201,6 +5201,11 @@ "url": "https://opencollective.com/date-fns" } }, + "node_modules/dayjs": { + "version": "1.11.6", + "resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.11.6.tgz", + "integrity": "sha512-zZbY5giJAinCG+7AGaw0wIhNZ6J8AhWuSXKvuc1KAyMiRsvGQWqh4L+MomvhdAYjN+lqvVCMq1I41e3YHvXkyQ==" + }, "node_modules/debug": { "version": "4.3.4", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", @@ -11786,14 +11791,6 @@ "node": ">=0.10.0" } }, - "node_modules/moment": { - "version": "2.29.4", - "resolved": "https://registry.npmjs.org/moment/-/moment-2.29.4.tgz", - "integrity": "sha512-5LC9SOxjSc2HF6vO2CyuTDNivEdoz2IvyJJGj6X8DJ0eFyfszE0QiEd+iXmBvUP3WHxSjFH/vIsA0EN00cgr8w==", - "engines": { - "node": "*" - } - }, "node_modules/moo": { "version": "0.5.2", "resolved": "https://registry.npmjs.org/moo/-/moo-0.5.2.tgz", @@ -20936,6 +20933,11 @@ "integrity": "sha512-dDCnyH2WnnKusqvZZ6+jA1O51Ibt8ZMRNkDZdyAyK4YfbDwa/cEmuztzG5pk6hqlp9aSBPYcjOlktquahGwGeA==", "dev": true }, + "dayjs": { + "version": "1.11.6", + "resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.11.6.tgz", + "integrity": "sha512-zZbY5giJAinCG+7AGaw0wIhNZ6J8AhWuSXKvuc1KAyMiRsvGQWqh4L+MomvhdAYjN+lqvVCMq1I41e3YHvXkyQ==" + }, "debug": { "version": "4.3.4", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", @@ -25793,11 +25795,6 @@ } } }, - "moment": { - "version": "2.29.4", - "resolved": "https://registry.npmjs.org/moment/-/moment-2.29.4.tgz", - "integrity": "sha512-5LC9SOxjSc2HF6vO2CyuTDNivEdoz2IvyJJGj6X8DJ0eFyfszE0QiEd+iXmBvUP3WHxSjFH/vIsA0EN00cgr8w==" - }, "moo": { "version": "0.5.2", "resolved": "https://registry.npmjs.org/moo/-/moo-0.5.2.tgz", diff --git a/vnext/package.json b/vnext/package.json index afd54d91..2582edf2 100644 --- a/vnext/package.json +++ b/vnext/package.json @@ -55,12 +55,12 @@ "config": "^3.3.8", "core-js": "^3.26.1", "cors": "^2.8.5", + "dayjs": "^1.11.6", "esbuild": "^0.15.14", "evil-icons": "^1.10.1", "express": "^4.18.2", "ignore-styles": "^5.0.1", "mailparser": "^3.5.0", - "moment": "^2.29.4", "node-pushnotifications": "^2.0.3", "qs": "^6.11.0", "react": "18.2.0", diff --git a/vnext/src/ui/Chat.js b/vnext/src/ui/Chat.js index 2a3e90de..c1151daf 100644 --- a/vnext/src/ui/Chat.js +++ b/vnext/src/ui/Chat.js @@ -1,6 +1,8 @@ import { useEffect, useState, useCallback } from 'react'; import { useParams } from 'react-router-dom'; -import moment from 'moment'; +import dayjs from 'dayjs'; +import utc from 'dayjs/plugin/utc'; +dayjs.extend(utc); import PM from './PM'; import MessageInput from './MessageInput'; @@ -77,7 +79,7 @@ export default function Chat(props) {