Sunday Worship Count
ci-cd-vm / ci-cd (push) Failing after 1m28s

This commit is contained in:
Chris Chen
2026-06-23 17:24:12 -07:00
parent a298d0ee1c
commit b1e3e23325
2 changed files with 15 additions and 3 deletions
@@ -5,7 +5,7 @@
<header class="ac__head">
<span class="ac__eyebrow">River of Life · 生命河靈糧堂</span>
<h1 class="ac__title">Sunday Worship Count<span>主日崇拜人數統計</span></h1>
<div class="ac__date">{{ today | date:'fullDate' }}</div>
<div class="ac__date">{{ worshipSunday | date:'fullDate' }}</div>
<div class="ac__status" [class.is-on]="connected">
<span class="ac__dot"></span>
{{ connected ? 'Live · 即時連線中' : 'Connecting… · 連線中' }}
@@ -19,8 +19,20 @@ interface CounterRow {
styleUrls: ['./attendance-counter-page.component.scss'],
})
export class AttendanceCounterPageComponent implements OnInit, OnDestroy {
/** Auto-selected current day shown in the header. */
readonly today = new Date();
/**
* Auto-selected Sunday of the current week, shown in the header.
* Sunday is the first day of the week, so this is the Sunday on or before today:
* getDay() returns 0 on Sunday (no shift) and 16 on MonSat (step back that many days).
*/
readonly worshipSunday = this.currentWeekSunday();
/** The Sunday that opens the week containing today. */
private currentWeekSunday(): Date {
const now = new Date();
const sunday = new Date(now.getFullYear(), now.getMonth(), now.getDate());
sunday.setDate(sunday.getDate() - now.getDay());
return sunday;
}
readonly rows: CounterRow[] = [
{ key: 'adult', labelEn: 'Adult', labelZh: '成人' },