Skip to content

Commit 052c96b

Browse files
committed
v1.23: fix history grouping to use charge period instead of fallback date, fix Manage Periods calling wrong refresh function, remove App Info from settings
1 parent 1edfd77 commit 052c96b

1 file changed

Lines changed: 17 additions & 13 deletions

File tree

index.html

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,7 @@ <h4>Pending UPI payments <span id="pendingCount" class="pending-badge">0</span><
376376
</main>
377377

378378
<div id="modalRoot"></div>
379-
<footer>New Serchhip North Village Council · v1.22.2</footer>
379+
<footer>New Serchhip North Village Council · v1.23</footer>
380380

381381
<script type="module">
382382
/* ============================================================
@@ -1578,17 +1578,10 @@ <h4>Quick Actions</h4>
15781578
<button class="btn block ghost" id="settingsBackup" style="margin-top:8px">Backup / Restore</button>
15791579
<button class="btn block ghost" id="settingsImport" style="margin-top:8px">Import / Export</button>
15801580
</div>
1581-
<div class="panel" style="margin-bottom:16px">
1581+
<div class="panel">
15821582
<h4>Account</h4>
15831583
<button class="btn block ghost" id="settingsLogout" style="color:var(--due);border-color:var(--due)">Sign out</button>
15841584
</div>
1585-
<div class="panel">
1586-
<h4>App Info</h4>
1587-
<div style="font-size:13px;color:var(--muted);line-height:1.6">
1588-
<div>Version: v1.22.2</div>
1589-
<div>New Serchhip North Village Council</div>
1590-
</div>
1591-
</div>
15921585
`);
15931586
$("settingsPeriods").addEventListener("click", ()=>{ closeSheet(); openPeriods(); });
15941587
$("settingsRename").addEventListener("click", ()=>{ closeSheet(); openRenamePeriod(); });
@@ -1766,7 +1759,7 @@ <h4>App Info</h4>
17661759
excludedPeriods = excluded;
17671760
msg.innerHTML=`<div class="notice info" style="background:var(--green-soft);color:var(--green-dark)">Done — ${excluded.length} periods excluded from calculations.</div>`;
17681761
toast("Periods updated");
1769-
showList();
1762+
renderList();
17701763
}catch(err){ console.error(err); msg.innerHTML=`<div class="notice err">Failed to save. Try again.</div>`; }
17711764
finally{ btn.disabled=false; }
17721765
}
@@ -2156,12 +2149,23 @@ <h4>App Info</h4>
21562149
const groupByMonth = (entries)=>{
21572150
const grouped = {};
21582151
for(const e of entries){
2159-
const d = e.date ? new Date(e.date) : new Date();
2160-
const key = d.toLocaleString('en-IN', {month:'long', year:'numeric'});
2152+
let key;
2153+
if(e.type==="charge" && e.note){
2154+
key = prettyPeriod(e.note) || e.note;
2155+
} else if(e.date){
2156+
const d = new Date(e.date);
2157+
key = isNaN(d.getTime()) ? "Other" : d.toLocaleString('en-IN', {month:'long', year:'numeric'});
2158+
} else {
2159+
key = "Other";
2160+
}
21612161
if(!grouped[key]) grouped[key] = [];
21622162
grouped[key].push(e);
21632163
}
2164-
return Object.entries(grouped).reverse();
2164+
return Object.entries(grouped).sort((a,b)=>{
2165+
const maxA = Math.max(...a[1].map(e=>e.createdAt||0));
2166+
const maxB = Math.max(...b[1].map(e=>e.createdAt||0));
2167+
return maxB - maxA;
2168+
});
21652169
};
21662170

21672171
const monthRows = (entries)=>{

0 commit comments

Comments
 (0)