MCPcopy Create free account
hub / github.com/Everoot/everoot.github.io / updateTime

Method updateTime

src/app/components/clock/clock.ts:31–46  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

29 }
30
31 updateTime() {
32 const now = new Date();
33 this.currentTime.set(now);
34
35 const day = this.dayList[now.getDay()];
36 let hour = now.getHours();
37 const minute = now.getMinutes().toString().padStart(2, '0');
38 const month = this.monthList[now.getMonth()];
39 const date = now.getDate();
40 const meridiem = hour < 12 ? 'AM' : 'PM';
41
42 if (hour > 12) hour -= 12;
43 if (hour === 0) hour = 12;
44
45 this.displayTime.set(`${day} ${month} ${date} ${hour}:${minute} ${meridiem}`);
46 }
47}

Callers 1

ngOnInitMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected