Files
node-realtime-chat-app/src/utils/messages.js
apiboomer 4bd3c48010 Redesign chat UI and remove location sharing
Modernizes the chat and join pages with new styles, improved layouts, and enhanced user experience using custom CSS and FontAwesome icons. Removes location sharing functionality from both frontend and backend, including related templates and code. Adds connection status indicators, notification system, and keyboard shortcuts for better usability.
2025-08-27 03:14:15 +03:00

16 lines
404 B
JavaScript

// Date time :: getDate, getTime, setDate and so on...
// getTime gives a positive number starting from 1 which depicts the time after 1970
// if we try to access before 1970 in JS than it would gives a negative number
const generateMessage = (username, text) => {
return {
username: username,
text: text,
createdAt: new Date().getTime(),
};
};
module.exports = {
generateMessage,
};