Ignore:
Timestamp:
06/20/24 11:57:13 (5 months ago)
Author:
223021 <daniel.ilievski.2@…>
Branches:
main
Children:
0f0add0
Parents:
befb988
Message:

Did more refactoring

Location:
jobvista-frontend/src/utils
Files:
1 added
1 edited

Legend:

Unmodified
Added
Removed
  • jobvista-frontend/src/utils/utils.js

    rbefb988 r08f82ec  
    77}
    88
    9 export const sortElementsBySubmissionDate = (array) => {
    10     return array.slice().sort((a, b) => {
    11         return new Date(b).getTime() - new Date(a.postedOn).getTime()
    12     });
    13 }
    14 
    159export const formatRelativeTime = (dateString) => {
    1610    const date = new Date(dateString);
     
    1812    const diffTime = now - date;
    1913
    20     // Define time intervals in milliseconds
    2114    const minute = 60 * 1000;
    2215    const hour = minute * 60;
     
    2518    const month = day * 30;
    2619
    27     // Calculate the relative time
    2820    if (diffTime < minute) {
    2921        return 'just now';
Note: See TracChangeset for help on using the changeset viewer.