First Commit

This commit is contained in:
yuvraj0028
2024-01-04 20:11:35 +05:30
commit 7a876d2d84
13 changed files with 3054 additions and 0 deletions

24
src/utils/messages.js Normal file
View File

@@ -0,0 +1,24 @@
// 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(),
};
};
const generateLocationMessage = (username, url) => {
return {
username: username,
url: url,
createdAt: new Date().getTime(),
};
};
module.exports = {
generateMessage,
generateLocationMessage,
};