1010// Get the updated field of an entry of the feed and format it like "Jan 1, 1970"
1111function formatDate ( updated ) {
1212 // Extract the date and create a Date object
13- var date = new Date ( updated ) ;
13+ const date = new Date ( updated ) ;
1414
1515 // Names for the months (we do not need an external library just for this)
16- var monthNames = [ "Jan" , "Feb" , "Mar" , "Apr" , "May" , "Jun" , "Jul" , "Aug" , "Sep" , "Oct" , "Nov" , "Dec" ] ;
16+ const monthNames = [ "Jan" , "Feb" , "Mar" , "Apr" , "May" , "Jun" , "Jul" , "Aug" , "Sep" , "Oct" , "Nov" , "Dec" ] ;
1717
1818 // Returns e.g. "Jan 1, 1970"
1919 return monthNames [ date . getMonth ( ) ] + ' ' + date . getDate ( ) + ', ' + date . getFullYear ( ) ;
@@ -22,14 +22,14 @@ function formatDate(updated) {
2222// Wait until the complete page has loaded (so that the latest-release exists)
2323document . addEventListener ( "DOMContentLoaded" , function ( ) {
2424
25- var github_api_endpoint = 'https://api.github.com/repos/precice/precice/releases'
25+ const github_api_endpoint = 'https://api.github.com/repos/precice/precice/releases'
2626
2727 fetch ( github_api_endpoint ) . then ( function ( response ) {
2828 if ( response . ok ) {
2929 response . json ( ) . then ( function ( data ) {
30- var tag = data [ 0 ] . name ;
31- var published_at = data [ 0 ] . published_at ;
32- var url = data [ 0 ] . html_url ;
30+ const tag = data [ 0 ] . name ;
31+ const published_at = data [ 0 ] . published_at ;
32+ const url = data [ 0 ] . html_url ;
3333
3434 var link = document . createElement ( 'a' ) ;
3535 link . setAttribute ( 'href' , url ) ;
@@ -60,12 +60,12 @@ var github_api_endpoint = 'https://api.github.com/repos/precice/precice/releases
6060// Exact copy of the script to get latest release, but this time we get the number of stars, or 'stargazers_count' in Github lingo
6161document . addEventListener ( "DOMContentLoaded" , function ( ) {
6262
63- var github_api_endpoint = 'https://api.github.com/repos/precice/precice'
63+ const github_api_endpoint = 'https://api.github.com/repos/precice/precice'
6464
6565 fetch ( github_api_endpoint ) . then ( function ( response ) {
6666 if ( response . ok ) {
6767 response . json ( ) . then ( function ( data ) {
68- var count = data . stargazers_count ;
68+ const count = data . stargazers_count ;
6969
7070 var link = document . createElement ( 'a' ) ;
7171 link . setAttribute ( 'href' , 'https://github.com/precice/precice/' ) ;
0 commit comments