Commit 91bef4dd authored by Geovanny's avatar Geovanny

Added wardate to participation table

parent 7e48d4e8
......@@ -177,7 +177,7 @@ class MyHouseController{
async getParticipation(){
try{
const data = await this.sync.getParticipation();
this.view.drawParticipationTable(data);
this.view.updateParticipationView(data);
}catch(error){
console.log(error);
}
......
......@@ -49,7 +49,7 @@
<war-participation>
<table-wrapper>
<div class="table_header">
<p class="header_title">Participation:</p>
<p id="war_date" class="header_title">Participation:</p>
<button id="yes" class="one">Yes</button>
<button id="no" class="two">No</button>
<button id="maybe" class="three">Maybe</button>
......
......@@ -11,6 +11,7 @@ class ParticipationView extends EventTarget{
super();
this.element = element;
this.war_date = element.querySelector("#war_date")
this.yes_button = element.querySelector("#yes");
this.maybe_button = element.querySelector("#maybe");
this.no_button = element.querySelector("#no");
......@@ -27,6 +28,15 @@ class ParticipationView extends EventTarget{
});
}
updateParticipation(data){
this.updateWarDate(data.war);
this.drawTable(data.participation);
}
updateWarDate(war){
const day_str = new Date(war.day).toLocaleDateString();
this.war_date.innerText = 'WarDate: ' + day_str;
}
drawTable(data){
this.table_view.drawTable(data);
}
......
......@@ -50,8 +50,8 @@ class MyHouseController extends EventTarget{
this.hideArea2();
}
drawParticipationTable(data){
this.participation_view.drawTable(data);
updateParticipationView(data){
this.participation_view.updateParticipation(data);
}
drawMemberUnitsTable(data){
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment