-
Notifications
You must be signed in to change notification settings - Fork 0
/
palco-tech-leads-list.js
49 lines (46 loc) · 1.77 KB
/
palco-tech-leads-list.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
// Get the current Date
let date = new Date();
// Convert the current Date to an UTC Date
let dateUTC = new Date(date.toUTCString());
// Set the Date as UTC - 3
dateUTC.setHours(dateUTC.getHours() - 3);
// Get the Day
currentDay = date.getUTCDate();
let cookieUserEmail = "seo-summit-user-email";
let cookieDay21 = "cookie-day-21";
let cookieDay22 = "cookie-day-22";
let cookieDay23 = "cookie-day-23";
if (window.location.href.indexOf("palco-seo-tech") > -1) {
setTimeout(() => {
if(currentDay == "21") {
if (typeof Cookies.get(cookieDay21) == "undefined") {
Cookies.set(cookieDay21, "verified", { expires: 30 });
$("#palco-tech-email-dia-1").val(Cookies.get(cookieUserEmail));
setTimeout(() => {
$("#wf-form-Palco-Tech---Dia-1").submit();
}, 2000);
}
}
else if(currentDay == "22") {
if (typeof Cookies.get(cookieDay22) == "undefined") {
Cookies.set(cookieDay22, "verified", { expires: 30 });
$("#palco-tech-email-dia-2").val(Cookies.get(cookieUserEmail));
setTimeout(() => {
$("#wf-form-Palco-Tech---Dia-2").submit();
}, 2000);
}
}
else if(currentDay == "23") {
if (typeof Cookies.get(cookieDay23) == "undefined") {
Cookies.set(cookieDay23, "verified", { expires: 30 });
$("#palco-tech-email-dia-3").val(Cookies.get(cookieUserEmail));
setTimeout(() => {
$("#wf-form-Palco-Tech---Dia-3").submit();
}, 2000);
}
}
else {
console.log("Ainda não chegou os dias ou a data já passou");
}
}, 2000);
};