-
Notifications
You must be signed in to change notification settings - Fork 0
/
renderer.js
52 lines (44 loc) · 1.27 KB
/
renderer.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
// This file is required by the index.html file and will
// be executed in the renderer process for that window.
// All of the Node.js APIs are available in this process.
document.querySelector("button").addEventListener("click", function () {
html2canvas(document.querySelector("body"), {
onrendered: function (canvas) {
// document.body.appendChild(canvas);
return Canvas2Image.saveAsPNG(canvas);
},
});
});
let today = new Date();
let dd = String(today.getDate()).padStart(2, "0");
let mm = String(today.getMonth() + 1).padStart(2, "0"); //January is 0!
let yyyy = today.getFullYear();
today = mm + "/" + dd + "/" + yyyy;
const month = [
"January",
"February",
"March",
"April",
"May",
"June",
"July",
"August",
"September",
"October",
"November",
"December",
];
// let time =
// today.getHours() + ":" + today.getMinutes() + ":" + today.getSeconds();
//in the sense of using a 24hr clock
let hours = new Date().getHours();
let min = new Date().getMinutes();
if (11.5 > 11) {
console.log("it is PM");
} else {
console.log("it is AM");
}
const d = new Date();
let name = month[d.getMonth()];
document.getElementById("header_month").innerHTML = `Current Month: ${name}`;
document.getElementById("header_date").innerHTML = ` ${today}`;