MCPcopy Create free account
hub / github.com/Moddable-OpenSource/moddable / _setDate

Method _setDate

modules/drivers/rtc/bm8563.js:70–86  ·  view source on GitHub ↗
(date)

Source from the content-addressed store, hash-verified

68 }
69
70 _setDate(date) {
71 let buf = new ArrayBuffer(7 * 1);
72 let bytes = new Uint8Array(buf);
73
74 bytes[0] = this.decToBcd(date.seconds);
75 bytes[1] = this.decToBcd(date.minutes);
76 bytes[2] = this.decToBcd(date.hours);
77 bytes[3] = this.decToBcd(date.date);
78 bytes[4] = this.decToBcd(date.dow);
79 bytes[5] = this.decToBcd(date.month);
80 if (date.year >= 100) {
81 bytes[5] |= BM8563_CENTURY_BIT;
82 }
83 bytes[6] = this.decToBcd(date.year % 100);
84
85 super.writeBlock(BM8563_SECONDS, buf);
86 }
87
88}
89

Callers

nothing calls this directly

Calls 2

decToBcdMethod · 0.80
writeBlockMethod · 0.45

Tested by

no test coverage detected