fedect1 / graduation-project-fedect1

graduation-project-fedect1 created by GitHub Classroom
MIT License
1 stars 0 forks source link

Refactoring classes #2

Closed fedect1 closed 1 year ago

fedect1 commented 1 year ago

Implemented index.js to manage class instances of User, creating and populating user objects with methods and setters to add properties and data to each instance. Developed methods in the User class to add and delete Posts, set profile data, follow and unfollow other users, and created setters to edit user profiles. Added getters in the User class to retrieve user information, profile data, and posts created by the user. Designed the Post class with methods to add and delete comments and a feature to like the post of the user. Implemented a system to update post expiration time when comments are added (15 minutes) or likes are given (5 minutes). Created getters in the Post class to obtain comment and like data related to a specific post. Implemented a method in the Post class to display the post's creation date in a human-readable format, showing "Today" for posts made on the same day, "Yesterday" for posts made one day before, and "X days"/"Y weeks" for posts older than that. The post expiration time is shown in hours, minutes, and seconds.