Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions js/github-queries.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
// Get the updated field of an entry of the feed and format it like "Jan 1, 1970"
function formatDate(updated) {
// Extract the date and create a Date object
date = new Date(updated);
const date = new Date(updated);

// Names for the months (we do not need an external library just for this)
var monthNames = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
Expand All @@ -27,9 +27,9 @@ var github_api_endpoint = 'https://api.github.com/repos/precice/precice/releases
fetch(github_api_endpoint).then(function(response) {
if (response.ok) {
response.json().then(function(data) {
tag = data[0].name;
published_at = data[0].published_at;
url = data[0].html_url
const tag = data[0].name;
const published_at = data[0].published_at;
const url = data[0].html_url
Copy link
Contributor

@hanzalahwaheed hanzalahwaheed Mar 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

semicolon missing here. I noticed rest of the file uses semicolons at the end. lets follow a common syntax.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ya thanks for help @hanzalahwaheed

// Format the text, which contains the link, the title, and the date.
var text = '<a href="' + url + '" class="btn btn-secondary no-icon action-button" role="button" target="_blank" rel="noopener noreferrer">Latest ' + tag + ' (' + formatDate(published_at) + ') &nbsp;<i class="fas fa-download"></i></a>';
document.getElementById('latest-release').innerHTML = text;
Expand All @@ -54,7 +54,7 @@ document.addEventListener("DOMContentLoaded", function() {
fetch(github_api_endpoint).then(function(response) {
if (response.ok) {
response.json().then(function(data) {
count = data.stargazers_count
const count = data.stargazers_count
var text = '<a href="https://github.com/precice/precice/" class="btn btn-default no-icon action-button" role="button" target="_blank" rel="noopener noreferrer">Star on GitHub &nbsp;<i class="fas fa-star"></i><span id="stargazers"> ' + count + '</span></a>';
document.getElementById('github-button').innerHTML = text;
});
Expand Down