+1
-1
@@ -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… · 連線中' }}
|
||||
|
||||
+14
-2
@@ -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 1–6 on Mon–Sat (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: '成人' },
|
||||
|
||||
Reference in New Issue
Block a user