Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP added calculateTimeSinceEdit, moment.js error still needs to be fixed #12

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

evelyn-lo
Copy link
Collaborator

@evelyn-lo evelyn-lo commented Feb 12, 2025

Fixes #14
Tried to display time elapsed (etc: 2 minutes ago, 3 hrs ago, 4 days ago) after edits

Encountered error "moment is not defined" in backend (edit.js) and frontend (event.js)

  1. Confirmed that moment was installed by running npm list moment
    Output:
image
  1. verified moment work in Node.js by running `node -e "console.log(require('moment')().format())"
    Output: node -e "console.log(require('moment')().format())"
    This confirmed that moment was correctly installed but not properly imported in NodeBB

  2. backend fix (src/posts/edit.js) added required moment import: const moment = require('moment'); front end fix (public/src/client/topic/event.js) added const moment = window.moment || require('moment');

@evelyn-lo evelyn-lo changed the title added calculateTimeSinceEdit, moment.js error still needs to be fixed WIP added calculateTimeSinceEdit, moment.js error still needs to be fixed Feb 12, 2025
@evelyn-lo evelyn-lo self-assigned this Feb 12, 2025
evelyn lo and others added 2 commits February 26, 2025 16:19
Fixed moment.js error, timeElapsed since edit displayed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Display Time Elapsed since Edits
1 participant