-
Notifications
You must be signed in to change notification settings - Fork 0
/
engine.js
57 lines (45 loc) · 1.55 KB
/
engine.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
53
54
55
56
57
var now = new Date();
var start = new Date(now.getFullYear(), 0, 0);
var diff = (now - start) + ((start.getTimezoneOffset() - now.getTimezoneOffset()) * 60 * 1000);
var oneDay = 1000 * 60 * 60 * 24;
var day = Math.floor(diff / oneDay);
let date = new Date();
let d = date.getDate() < 10 ? "0" + date.getDate() : date.getDate();
let mon = date.getMonth() + 1;
let m = mon < 10 ? "0" + mon : mon;
let y = date.getFullYear();
// function init() {
// document.getElementById("data").innerHTML = d + "." + m + "." + y;
// document.getElementById("Dimineata").innerHTML = dimi[day - 1];
// document.getElementById("Seara").innerHTML = seara[day - 1];
// setMsg();
// }
function setMsg() {
msg = "_*Pasajul Zilei*_\n\n*Data:* ```" + d + "." + m + "." + y + "```\n\n*Vechiul Testament:* ```\n" + dimi[day - 1] + "```\n\n*Noul Testament:* ```\n" + seara[day - 1] + "```" + "\n\n_Sursa: hrana-zilnica.info_";
}
function share() {
if (navigator.share) {
navigator.share({
title: `Mesaj`,
text: `${msg}`
})
}
}
function shareVerse() {
verse = "```" + document.getElementById("verse").innerText + "```\n\n_Sursa: hrana-zilnica.info_"
if (navigator.share) {
navigator.share({
title: `Mesaj`,
text: `${verse}`
})
}
}
function shareGand() {
gand = "```" + document.getElementById("gand").innerText + "```\n\n_Sursa: hrana-zilnica.info_"
if (navigator.share) {
navigator.share({
title: `Mesaj`,
text: `${gand}`
})
}
}