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

New article: tracker lists #115

Open
josecelano opened this issue Nov 14, 2024 · 0 comments
Open

New article: tracker lists #115

josecelano opened this issue Nov 14, 2024 · 0 comments
Labels
Blog Post New blog post

Comments

@josecelano
Copy link
Member

Relates to: torrust/torrust-tracker#650

LIst sources to get tracker lists from.

@josecelano josecelano added the Blog Post New blog post label Nov 14, 2024
da2ce7 pushed a commit to da2ce7/torrust-website that referenced this issue Nov 21, 2024
…t to getStars function

d127462 Update date.ts (Graeme Byrne)
d5ad4a5 add new date.ts module and argument to getStars function (grmbyrn)

Pull request description:

  ## Enhancements to Date Formatting and `getStars` Function

  ### Changes Made:

  1. **Date Formatting Module:**
     - Moved the `formatDate` function into a separate module located at `lib/utils/date.ts`.
     - Implemented in `lib/components/molecules/BlogPostCard.svelte`, `routes/(blog-article)/+layout.svelte` and `routes/rss.xml/+server.ts`
     - The motivation is to centralise the date and time formatting logic and provide a single source of truth for date formatting across all components.
     - By using this helper function, we can easily update the date format in one place, affecting all components simultaneously.
     - This approach facilitates testing of date formatting independently of specific components.

     ```typescript
     // src/lib/utils/date.ts
     import dateFormat from 'dateformat';

     export function formatDate(date: string): string {
       return dateFormat(date, 'UTC:dd/mm/yyyy');
     }

     export function formatTime(date: string): string {
  return dateFormat(date, 'UTC:HH:MM:ss');
     }

  2. `getStars` Function Modification:

     - Added an argument to the `getStars` function in the `ProjectCard` component (`lib/components/molecules/ProjectCard.svelte`).
     - The argument (`repoName`) replaces the previous usage of a global variable.
     - This change promotes better code organisation and maintainability by explicitly defining function inputs.
     - The modification improves the function's reusability and makes it more self-contained.

ACKs for top commit:
  josecelano:
    ACK d127462

Tree-SHA512: 32883a9a97720a5375ad521b52e0e4cdf2bb79f310134d9435bf9ee9f3aab10287366cadcd3f6161dc5b6d4aa5e3a95dd7ce3c2ed1bde6de6706fd2b7fb478c0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Blog Post New blog post
Projects
None yet
Development

No branches or pull requests

1 participant