mirror of
https://github.com/appen-isen/site-interpromo-2023.git
synced 2026-03-18 21:50:39 +01:00
add week day + always 2 digits minutes
This commit is contained in:
@@ -77,7 +77,7 @@ function getSportNextMatchText(sport){
|
||||
return "Pas de match prévu";
|
||||
}
|
||||
const time_start = new Date(match.heure_debut);
|
||||
return "Prochain match : " + match.expand.team1.name + " vs " + match.expand.team2.name + " à " + time_start.getHours() + "h" + time_start.getMinutes();
|
||||
return "Prochain match : " + match.expand.team1.name + " vs " + match.expand.team2.name + ' ' + time_start.toLocaleString('fr', { weekday: 'long' }) + " à " + time_start.toLocaleString('fr', { hour: 'numeric', minute: 'numeric' });
|
||||
}
|
||||
|
||||
function getSportCard(sport){
|
||||
|
||||
@@ -94,7 +94,7 @@ function getPromoCard(promo, teamsList){
|
||||
const nextMatch = matchList.find(match => match.expand.team1.promo === promo.id || match.expand.team2.promo === promo.id);
|
||||
if(nextMatch){
|
||||
const time_start = new Date(nextMatch.heure_debut);
|
||||
cardHtml += `<div class="card-footer bg-light-subtle text-emphasis-light">Prochain match : ${nextMatch.expand.team1.name} vs ${nextMatch.expand.team2.name} à ${time_start.getHours()}h${time_start.getMinutes()}</div>`
|
||||
cardHtml += `<div class="card-footer bg-light-subtle text-emphasis-light">Prochain match : ${nextMatch.expand.team1.name} vs ${nextMatch.expand.team2.name} ${time_start.toLocaleString('fr', { weekday: 'long' })} à ${time_start.toLocaleString('fr', { hour: 'numeric', minute: 'numeric' })}</div>`
|
||||
}
|
||||
cardHtml += `</div>`
|
||||
return cardHtml
|
||||
@@ -136,7 +136,7 @@ function getTeamCard(teamBySport){
|
||||
const nextMatch = matchList.find(match => match.expand.team1.name === equipe.name || match.expand.team2.name === equipe.name);
|
||||
if(nextMatch){
|
||||
const time_start = new Date(nextMatch.heure_debut);
|
||||
cardHtml += `<div class="card-footer bg-light-subtle text-emphasis-light">Prochain match : ${nextMatch.expand.team1.name} vs ${nextMatch.expand.team2.name} à ${time_start.getHours()}h${time_start.getMinutes()}</div>`
|
||||
cardHtml += `<div class="card-footer bg-light-subtle text-emphasis-light">Prochain match : ${nextMatch.expand.team1.name} vs ${nextMatch.expand.team2.name} ${time_start.toLocaleString('fr', { weekday: 'long' })} à ${time_start.toLocaleString('fr', { hour: 'numeric', minute: 'numeric' })}</div>`
|
||||
}
|
||||
cardHtml += `</div>`
|
||||
return cardHtml
|
||||
|
||||
Reference in New Issue
Block a user