-
Notifications
You must be signed in to change notification settings - Fork 0
/
cctmc next meeting_showDate.html
353 lines (331 loc) · 12.1 KB
/
cctmc next meeting_showDate.html
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
<style type="text/css">a:link {
color: blue;
background-color: transparent;
text-decoration: none;
}
a:visited {
color: DarkBlue;
background-color: transparent;
text-decoration: none;
}
a:hover {
color: red;
background-color: transparent;
text-decoration: underline;
}
a:active {
color: yellow;
background-color: transparent;
text-decoration: underline;
}
</style>
<h3><u>Next Meeting: Wednesday, <b id="demo"> </b>, 8:00 pm - 10:15 pm</u></h3>
<p><strong>Meeting ID: <b id="ID"> </b></strong></p>
<p><strong>Passcode: <b id="passcode"> </b> </strong></p>
<p><strong>Join Zoom Meeting: <href id="link"> </href> </strong></p>
<p dir="ltr">Check your local time <strong><href id="dateLink"> </href></strong></p>
<script>
/*
The code automates Cyberjaya Community Toastmasters Club's next meeting date.
The date changes on the day after the meeting day at 12:00 AM in 2022. This
is beginner's code because I did this without prior knowledge of Javascript.
Created by Alif Ibrahim.
*/
/*
Code for Ramadan local time link.
<h3><u>Next Meeting: Wednesday, <b id="demo"> </b>, e.g 12:00 pm - 02:15 pm</u></h3>
var timeMeetingRamadan = e.g 12pm;
var timeBackLinkRamadan = "T" + timeMeeting + "&p1=122&ah=2&am=15";
timeLink = timeFrontLink + monthMeeting + dateMeeting + timeBackLinkRamadan;
// After Ramadan, change timeLink & also the time text in HTML back to normal:
timeLink = timeFrontLink + monthMeeting + dateMeeting + timeBackLink;
<h3><u>Next Meeting: Wednesday, <b id="demo"> </b>, 8:00 pm - 10:15 pm</u></h3>
*/
const today = new Date();
// const year = today.getFullYear();
const month = today.getMonth() + 1;
const date = today.getDate();
var zoomLink, dateMeeting, monthMeeting, timeLink;
var timeBackLink = "T20&p1=122&ah=2&am=15", timeFrontLink = "https://www.timeanddate.com/worldclock/fixedtime.html?msg=Cyberjaya+Community+Toastmasters+Club+Meeting&iso=2022";;
let showDate, login = [];
switch (month){
case 2:
if (date <= 9) {
showDate = "9th February 2022";
monthMeeting = "02";
dateMeeting = "09";
zoomLink = "https://us02web.zoom.us/j/83681294660?pwd=SXhmdjRTd3l6TjlRSnFZa0tid2NTQT09";
login[0] = [83681294660, 101202];
}
else if (date <= 23) {
showDate = "23rd February 2022";
monthMeeting = "02";
dateMeeting = "23";
zoomLink = "https://us02web.zoom.us/j/87854856519?pwd=ejRqMkZrYlpQUEhWNEcycVFiUXRkdz09";
login[0] = [87854856519, 303202];
}
else if (date <= 28) {
showDate = "9th March 2022";
monthMeeting = "03";
dateMeeting = "09";
zoomLink = "https://us02web.zoom.us/j/89951047689?pwd=TWJFNVkza3I4MG1WalFUZEI3b1lhQT09";
login[0] = [89951047689, 101202];
}
break;
case 3:
if (date <= 9){
showDate = "9th March 2022";
monthMeeting = "03";
dateMeeting = "09";
zoomLink = "https://us02web.zoom.us/j/89951047689?pwd=TWJFNVkza3I4MG1WalFUZEI3b1lhQT09";
login[0] = [89951047689, 101202];
}
else if (date <= 23){
showDate = "23rd March 2022";
monthMeeting = "03";
dateMeeting = "23";
zoomLink = "https://us02web.zoom.us/j/82076587825?pwd=dGgrUTN1ZVhJZWk5UEhaU3cydktUZz09";
login[0] = [82076587825, 202101];
}
else if (date <= 31){
showDate = "6th April 2022";
monthMeeting = "04";
dateMeeting = "06";
zoomLink = "https://us02web.zoom.us/j/83930984070?pwd=dzhDRitoMTNHUjJvc0JMbGZaZ2todz09";
login[0] = [83930984070, 404909];
}
break;
case 4:
if (date <= 6){
showDate = "6th April 2022";
monthMeeting = "04";
dateMeeting = "06";
zoomLink = "https://us02web.zoom.us/j/83930984070?pwd=dzhDRitoMTNHUjJvc0JMbGZaZ2todz09";
login[0] = [83930984070, 404909];
}
else if (date <= 20){
showDate = "20th April 2022";
monthMeeting = "04";
dateMeeting = "20";
zoomLink = "https://us02web.zoom.us/j/87474290902?pwd=OGphWGdoL056bjJaWmlRemcwV3FTdz09";
login[0] = [87474290902, 303201];
}
else if (date <= 30){
showDate = "11th May 2022";
monthMeeting = "05";
dateMeeting = "11";
zoomLink = "https://us02web.zoom.us/j/88059009233?pwd=aStoUjRyTEJLc01acjJkazZnOVlNZz09";
login[0] = [88059009233, 505606];
}
break;
case 5:
if (date <= 11){
showDate = "11th May 2022";
monthMeeting = "05";
dateMeeting = "11";
zoomLink = "https://us02web.zoom.us/j/88059009233?pwd=aStoUjRyTEJLc01acjJkazZnOVlNZz09";
login[0] = [88059009233, 505606];
}
else if (date <= 25){
showDate = "25th May 2022";
monthMeeting = "05";
dateMeeting = "25";
zoomLink = "https://us02web.zoom.us/j/83376249904?pwd=UEpueHRBZ2Evak5TUUhLZ2JpZjBxQT09";
login[0] = [83376249904, 606707];
}
else if (date <= 31){
showDate = "8th June 2022";
monthMeeting = "06";
dateMeeting = "08";
zoomLink = "https://us02web.zoom.us/j/85615869139?pwd=L1p3aHRhUHhzY3NDN0FEQU9HUlRyUT09";
login[0] = [85615869139, 101202];
}
break;
case 6:
if (date <= 8){
showDate = "8th June 2022";
monthMeeting = "06";
dateMeeting = "08";
zoomLink = "https://us02web.zoom.us/j/85615869139?pwd=L1p3aHRhUHhzY3NDN0FEQU9HUlRyUT09";
login[0] = [85615869139, 101202];
}
else if (date <= 22){
showDate = "22nd June 2022";
monthMeeting = "06";
dateMeeting = "22";
zoomLink = " ";
login[0] = [ , ];
}
else if (date <= 30){
showDate = "6th July 2022";
monthMeeting = "07";
dateMeeting = "06";
zoomLink = " ";
login[0] = [ , ];
}
break;
case 7:
if (date <= 6){
zoomLink = " ";
monthMeeting = "07";
dateMeeting = "06";
login[0] = [ , ];
}
else if (date <= 20){
showDate = "20th July 2022";
monthMeeting = "07";
dateMeeting = "20";
zoomLink = " ";
login[0] = [ , ];
}
else if (date <= 31){
showDate = "3rd August 2022";
monthMeeting = "08";
dateMeeting = "03";
zoomLink = " ";
login[0] = [ , ];
}
break;
case 8:
if (date <= 3){
showDate = "3rd August 2022";
monthMeeting = "08";
dateMeeting = "03";
zoomLink = " ";
login[0] = [ , ];
}
else if (date <= 17){
showDate = "17th August 2022";
monthMeeting = "08";
dateMeeting = "17";
zoomLink = " ";
login[0] = [ , ];
}
else if (date <= 31){
showDate = "7th September 2022";
monthMeeting = "09";
dateMeeting = "07";
zoomLink = " ";
login[0] = [ , ];
}
break;
case 9:
if (date <= 7){
showDate = "7th September 2022";
monthMeeting = "09";
dateMeeting = "07";
zoomLink = " ";
login[0] = [ , ];
}
else if (date <= 21){
showDate = "21st September 2022";
monthMeeting = "09";
dateMeeting = "21";
zoomLink = " ";
login[0] = [ , ];
}
else if (date <= 30){
showDate = "5th October 2022";
monthMeeting = "10";
dateMeeting = "05";
zoomLink = " ";
login[0] = [ , ];
}
break;
case 10:
if (date <= 5){
showDate = "5th October 2022";
monthMeeting = "10";
dateMeeting = "05";
zoomLink = " ";
login[0] = [ , ];
}
else if (date <= 19){
showDate = "19th October 2022";
monthMeeting = "10";
dateMeeting = "19";
zoomLink = " ";
login[0] = [ , ];
}
else if (date <= 31){
showDate = "2nd November 2022";
monthMeeting = "11";
dateMeeting = "02";
zoomLink = " ";
login[0] = [ , ];
}
break;
case 11:
if (date <= 2){
showDate = "2nd November 2022";
monthMeeting = "11";
dateMeeting = "02";
zoomLink = " ";
login[0] = [ , ];
}
else if (date <= 16){
showDate = "16th November 2022";
monthMeeting = "11";
dateMeeting = "16";
zoomLink = " ";
login[0] = [ , ];
}
else if (date <= 30){
showDate = "7th December 2022";
monthMeeting = "12";
dateMeeting = "07";
zoomLink = " ";
login[0] = [ , ];
}
break;
case 12:
if (date <= 7){
showDate = "7th December 2022";
monthMeeting = "12";
dateMeeting = "07";
zoomLink = " ";
login[0] = [ , ];
}
else if (date <= 21){
showDate = "21st December 2022";
monthMeeting = "12";
dateMeeting = "21";
zoomLink = " ";
login[0] = [ , ];
}
else if (date <= 31){
showDate = "4th January 2023";
monthMeeting = "01";
dateMeeting = "04";
zoomLink = " ";
login[0] = [ , ];
}
break;
}
timeLink = timeFrontLink + monthMeeting + dateMeeting + timeBackLink;
function linkToZoom(zoomLink) {
var link = document.createElement('a');
link.textContent = zoomLink;
link.href = zoomLink;
link.target = '_blank';
return document.getElementById('link').appendChild(link);
}
function linkToDate(timeLink) {
var link = document.createElement('a');
link.textContent = "here";
link.href = timeLink;
link.target = '_blank';
return document.getElementById('dateLink').appendChild(link);
}
function numberWithSpaces(x) {
return x.toString().replace(/\B(?=(\d{4})+(?!\d))/g, " ");
}
function numberWithSpaces2(x) {
return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, " ");
}
document.getElementById("demo").innerHTML = showDate;
document.getElementById("link").href = linkToZoom(zoomLink);
document.getElementById("ID").innerHTML = numberWithSpaces(login[0][0]);
document.getElementById("passcode").innerHTML = numberWithSpaces2(login[0][1]);
document.getElementById("dateLink").href = linkToDate(timeLink);
</script>