-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathfeiertage.js
1467 lines (1371 loc) · 63.9 KB
/
feiertage.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
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
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/* eslint-disable prefer-destructuring */
/* eslint-disable import/no-unresolved */
/* eslint-disable global-require */
// eslint-disable-next-line func-names
module.exports = function (RED) {
function feiertage(config) {
RED.nodes.createNode(this, config);
const node = this;
const Feiertage = require('getfeiertage.js').Feiertage;
const checkNewYear = config.neujahr; // checkbox New Year
const newYearName = config.neujahrName; // New Year Name
const checkBerchtoldstag = config.berchtoldstag; // checkbox Berchtoldstag
const berchtoldstagName = config.berchtoldstagName; // Berchtoldstag Name
const checkEpiphany = config.heiligeDreiKoenige; // checkboy Epiphany
const epiphanyName = config.heiligeDreiKoenigeName; // Epiphany Name
const checkWeiberfastnacht = config.weiberfastnacht; // checkbox Weiberfastnacht
const weiberfastnachtName = config.weiberfastnachtName; // Weiberfastnacht Name
const checkValentinstag = config.valentinstag; // checkbox Valentinstag
const valentinstagName = config.valentinstagName; // Valentinstag Name
const checkRosenmontag = config.rosenmontag; // checkbox Rosenmontag
const rosenmontagName = config.rosenmontagName; // Rosenmontag Name
const checkFastnachtsdienstag = config.fastnachtsdienstag; // checkbox Fastnachtsdienstag
const fastnachtsdienstagsName = config.fastnachtsdienstagName; // Fastnachtsdienstag Name
const checkAschermittwoch = config.aschermittwoch; // checkbox Aschermittwoch
const aschermittwochName = config.aschermittwochName; // Aschermittwoch Name
const checkStJosef = config.stJosef; // checkbox St. Josef
const stJosefName = config.stJosefName; // St. Josef Name
const checkGruendonnerstag = config.gruendonnerstag; // checkbox Gründonnerstag
const gruendonnerstagName = config.gruendonnerstagName; // Gründonnerstag Name
const checkKarfreitag = config.karfreitag; // checkbox Karfreitag
const karfreitagName = config.karfreitagName; // Karfreitag Name
const checkEasterSunday = config.easterSunday; // checkbox Easter Sunday
const easterSundayName = config.easterSundayName; // Easter Sunday Name
const checkEasterMonday = config.easterMonday; // checkbox Easter Monday
const easterMondayName = config.easterMondayName; // Easter Monday Name
const checkFirstMay = config.firstMay; // checkbox 1. Mai
const firstMayName = config.firstMayName; // First May Name
const checkStFlorian = config.stFlorian; // checkbox St. Florian
const stFlorianName = config.stFlorianName; // St. Florian Name
const checkChristiHimmelfahrt = config.christiHimmelfahrt; // checkbox Christihimmelfahrt
const christiHimmerlfahrtName = config.christiHimmelfahrtName; // Christi Himmelfahrt Name
const checkPfingstsonntag = config.pfingstsonntag; // checkbox Pfingstsonntag
const pfingstsonntagName = config.pfingstsonntagName; // Pfingstsonntag Name
const checkPfingstmontag = config.pfingstmontag; // checkbox Pfingstmontag
const pfingstmontagName = config.pfingstmontagName; // Pfingstmontag Name
const checkFronleichnam = config.fronleichnam; // checkbox Fronleichnam
const fronleichnamName = config.fronleichnamName; // Fronleichnam Name
const checkBundesfeierCH = config.bundesfeierCH; // checkbox Bundesfeier
const bundesfeierCHName = config.bundesfeierCHName; // Bundesfeier CH Name
const checkMariaHimmelfahrt = config.mariaHimmelfahrt; // checkbox Maria Himmelfahrt
const mariaHimmelfahrtName = config.mariaHimmelfahrtName; // Maria Himmelfahrt Name
const checkStRupert = config.stRupert; // checkbox St. Rupert
const stRupertName = config.stRupertName; // St. Rupert Name
// checkbox Tag der Deutschen Einheit
const checkTagDerDeutschenEinheit = config.tagDerDeutschenEinheit;
// Tag der Deutschen Einheit Name
const tagDerDeutschenEinheitName = config.tagDerDeutschenEinheitName;
// checkbox Tag der Volksabstimmung
const checkTagDerVolksabstimmung = config.tagDerVolksabstimmung;
// Tag der Volksabstimmung Name
const tagDerVolksabstimmungName = config.tagDerVolksabstimmungName;
const checkNationalfeiertagAT = config.nationalfeiertagAT; // checkbox Nationalfeiertag AT
const nationalfeiertagATName = config.nationalfeiertagATName; // Nationalfeiertag AT name
const checkHalloween = config.halloween; // checkbox Halloween
const halloweenName = config.halloweenName; // Halloween Name
const checkAllerheiligen = config.allerheiligen; // checkbox Allerheiligen
const allerheiligenName = config.allerheiligenName; // Allerheiligen Name
const checkStMartin = config.stMartin; // checkbox St. Martin
const stMartinName = config.stMartinName; // St. Martin Name
const checkStLeopold = config.stLeopold; // checkbox St. Leopold
const stLeopoldName = config.stLeopoldName; // St. Leopold Name
const checkBussUndBettag = config.bussUndBettag; // checkbox Buß und Bettag
const bussUndBettagName = config.bussUndBettagName; // Buß und Bettag Name
const checkSanta = config.nikolaus; // checkbox Nikolaus
const santaName = config.nikolausName; // Nikolaus Name
const checkMariaeEmpfaengnis = config.mariaeEmpfaengnis; // check Mariä Empfängnis
const mariaeEmpfaengnisName = config.mariaeEmpfaengnisName; // Mariä Empfängnis Name
const checkadvent1 = config.advent1; // checkbox 1. Advent
const advent1Name = config.advent1Name; // 1. Advent Name
const checkAdvent2 = config.advent2; // checkbox 2. Advent
const advent2Name = config.advent2Name; // 2. Advent Name
const checkAdvent3 = config.advent3; // checkbox 3. Advent
const advent3Name = config.advent3Name; // 3. Advent Name
const checkAdvent4 = config.advent4; // checkbox 4. Advent
const advent4Name = config.advent4Name; // 4. Advent Name
const checkChristmasEve = config.heiligabend; // checkbox Christmas Eve
const christmasEveName = config.heiligabendName; // Christmas Eve Name
const checkFirstDayChristmas = config.weihnachten1; // checkbox First day of Chrsitmas
const firstDayChristmasName = config.weihnachten1Name; // First day of Christmas
const checkSecondDayChristmas = config.weihnachten2; // checkbox Second day of Christmas
const secondDayChristmasName = config.weihnachten2Name; // Second day of Christmas
const checkNewYearsEve = config.silvester; // checkbox New Years Eve
const newYearsEveName = config.silvesterName; // Silvester Name
const checkOwnHoliday1 = config.ownHoliday1; // checkbox Own Holiday 1
const dayOwnHoliday1 = config.ownHoliday1Day.toString().length === 1 ? `0${config.ownHoliday1Day}` : config.ownHoliday1Day; // day Own Holiday 1
const monthOwnHoliday1 = config.ownHoliday1Month.toString().length === 1 ? `0${config.ownHoliday1Month}` : config.ownHoliday1Month; // month Own Holiday 1
const nameOwnHoliday1 = config.ownHoliday1Name; // name Own Holiday 1
const checkOwnHoliday2 = config.ownHoliday2; // checkbox Own Holiday 2
const dayOwnHoliday2 = config.ownHoliday2Day.toString().length === 1 ? `0${config.ownHoliday2Day}` : config.ownHoliday2Day; // day Own Holiday 2
const monthOwnHoliday2 = config.ownHoliday2Month.toString().length === 1 ? `0${config.ownHoliday2Month}` : config.ownHoliday2Month; // month Own Holiday 2
const nameOwnHoliday2 = config.ownHoliday2Name; // name Own Holiday 2
const checkOwnHoliday3 = config.ownHoliday3; // checkbox Own Holiday 3
const dayOwnHoliday3 = config.ownHoliday3Day.toString().length === 1 ? `0${config.ownHoliday3Day}` : config.ownHoliday3Day; // day Own Holiday 3
const monthOwnHoliday3 = config.ownHoliday3Month.toString().length === 1 ? `0${config.ownHoliday3Month}` : config.ownHoliday3Month; // month Own Holiday 3
const nameOwnHoliday3 = config.ownHoliday3Name; // name Own Holiday 3
const checkOwnHoliday4 = config.ownHoliday4; // checkbox Own Holiday 4
const dayOwnHoliday4 = config.ownHoliday4Day.toString().length === 1 ? `0${config.ownHoliday4Day}` : config.ownHoliday4Day; // day Own Holiday 4
const monthOwnHoliday4 = config.ownHoliday4Month.toString().length === 1 ? `0${config.ownHoliday4Month}` : config.ownHoliday4Month; // month Own Holiday 4
const nameOwnHoliday4 = config.ownHoliday4Name; // name Own Holiday 4
const checkOwnHoliday5 = config.ownHoliday5; // checkbox Own Holiday 5
const dayOwnHoliday5 = config.ownHoliday5Day.toString().length === 1 ? `0${config.ownHoliday5Day}` : config.ownHoliday5Day; // day Own Holiday 5
const monthOwnHoliday5 = config.ownHoliday5Month.toString().length === 1 ? `0${config.ownHoliday5Month}` : config.ownHoliday5Month; // month Own Holiday 5
const nameOwnHoliday5 = config.ownHoliday5Name; // name Own Holiday 5
const checkOwnHoliday6 = config.ownHoliday6; // checkbox Own Holiday 6
const dayOwnHoliday6 = config.ownHoliday6Day.toString().length === 1 ? `0${config.ownHoliday6Day}` : config.ownHoliday6Day; // day Own Holiday 6
const monthOwnHoliday6 = config.ownHoliday6Month.toString().length === 1 ? `0${config.ownHoliday6Month}` : config.ownHoliday6Month; // month Own Holiday 6
const nameOwnHoliday6 = config.ownHoliday6Name; // name Own Holiday 6
const checkOwnHoliday7 = config.ownHoliday7; // checkbox Own Holiday 7
const dayOwnHoliday7 = config.ownHoliday7Day.toString().length === 1 ? `0${config.ownHoliday7Day}` : config.ownHoliday7Day; // day Own Holiday 7
const monthOwnHoliday7 = config.ownHoliday7Month.toString().length === 1 ? `0${config.ownHoliday7Month}` : config.ownHoliday7Month; // month Own Holiday 7
const nameOwnHoliday7 = config.ownHoliday7Name; // name Own Holiday 7
const checkOwnHoliday8 = config.ownHoliday8; // checkbox Own Holiday 8
const dayOwnHoliday8 = config.ownHoliday8Day.toString().length === 1 ? `0${config.ownHoliday8Day}` : config.ownHoliday8Day; // day Own Holiday 8
const monthOwnHoliday8 = config.ownHoliday8Month.toString().length === 1 ? `0${config.ownHoliday8Month}` : config.ownHoliday8Month; // month Own Holiday 8
const nameOwnHoliday8 = config.ownHoliday8Name; // name Own Holiday 8
const checkOwnHoliday9 = config.ownHoliday9; // checkbox Own Holiday 9
const dayOwnHoliday9 = config.ownHoliday9Day.toString().length === 1 ? `0${config.ownHoliday9Day}` : config.ownHoliday9Day; // day Own Holiday 9
const monthOwnHoliday9 = config.ownHoliday9Month.toString().length === 1 ? `0${config.ownHoliday9Month}` : config.ownHoliday9Month; // month Own Holiday 9
const nameOwnHoliday9 = config.ownHoliday9Name; // name Own Holiday 9
const checkOwnHoliday10 = config.ownHoliday10; // checkbox Own Holiday 10
const dayOwnHoliday10 = config.ownHoliday10Day.toString().length === 1 ? `0${config.ownHoliday10Day}` : config.ownHoliday10Day; // day Own Holiday 10
const monthOwnHoliday10 = config.ownHoliday10Month.toString().length === 1 ? `0${config.ownHoliday10Month}` : config.ownHoliday10Month; // month Own Holiday 10
const nameOwnHoliday10 = config.ownHoliday10Name; // name Own Holiday 10
const checkArray = config.array;
const dailyOutput = config.dailyOutput;
let currentYear;
let currentMonth;
let currentDay;
let currentHour;
let currentMinute;
function setCurrentDate() {
const currentDate = new Date(); // create current date
currentYear = currentDate.getFullYear(); // set current year
const mCurrentMonth = currentDate.getMonth() + 1; // set current month
if (mCurrentMonth.toString().length === 1) {
currentMonth = `0${mCurrentMonth}`;
} else {
currentMonth = mCurrentMonth;
}
const mCurrentDay = currentDate.getDate(); // set current day
if (mCurrentDay.toString().length === 1) {
currentDay = `0${mCurrentDay}`;
} else {
currentDay = mCurrentDay;
}
currentHour = currentDate.getHours(); // set current hour
currentMinute = currentDate.getMinutes(); // set current minute
}
setCurrentDate();
const formatDateObj = 'dateObj';
const formatDE = 'DE';
const newYear = {
id: 'New Year',
name: newYearName,
dateObj: Feiertage.getNeujahr(Feiertage.formatDateObj, currentYear),
dateDE: Feiertage.getNeujahr(Feiertage.formatDateObj, currentYear),
};
const berchtoldstag = {
id: 'Berchtoldstag',
name: berchtoldstagName,
dateObj: Feiertage.getBerchtoldstag(Feiertage.formatDateObj, currentYear),
dateDE: Feiertage.getBerchtoldstag(Feiertage.formatDE, currentYear),
};
const epiphany = {
id: 'Epiphany',
name: epiphanyName,
dateObj: Feiertage.getHeiligeDreiKoenige(Feiertage.formatDateObj, currentYear),
dateDE: Feiertage.getHeiligeDreiKoenige(Feiertage.formatDE, currentYear),
};
const weiberfastnacht = {
id: 'Weiberfastnacht',
name: weiberfastnachtName,
dateObj: Feiertage.getWeiberfastnacht(Feiertage.formatDateObj, currentYear),
dateDE: Feiertage.getWeiberfastnacht(Feiertage.formatDE, currentYear),
};
const valentinstag = {
id: 'Valentinstag',
name: valentinstagName,
dateObj: Feiertage.getValentinstag(Feiertage.formatDateObj, currentYear),
dateDE: Feiertage.getValentinstag(Feiertage.formatDE, currentYear),
};
const rosenmontag = {
id: 'Rosenmontag',
name: rosenmontagName,
dateObj: Feiertage.getRosenmontag(Feiertage.formatDateObj, currentYear),
dateDE: Feiertage.getRosenmontag(Feiertage.formatDE, currentYear),
};
const fastnachtsdienstag = {
id: 'Fastnachtdienstag',
name: fastnachtsdienstagsName,
dateObj: Feiertage.getFastnachtsdienstag(Feiertage.formatDateObj, currentYear),
dateDE: Feiertage.getFastnachtsdienstag(Feiertage.formatDE, currentYear),
};
const aschermittwoch = {
id: 'Aschermittwoch',
name: aschermittwochName,
dateObj: Feiertage.getAschermittwoch(Feiertage.formatDateObj, currentYear),
dateDE: Feiertage.getAschermittwoch(Feiertage.formatDE, currentYear),
};
const stJosef = {
id: 'St. Josef',
name: stJosefName,
dateObj: Feiertage.getStJosef(Feiertage.formatDateObj, currentYear),
dateDE: Feiertage.getStJosef(Feiertage.formatDE, currentYear),
};
const gruendonnerstag = {
id: 'Gründonnerstag',
name: gruendonnerstagName,
dateObj: Feiertage.getGruendonnerstag(Feiertage.formatDateObj, currentYear),
dateDE: Feiertage.getGruendonnerstag(Feiertage.formatDE, currentYear),
};
const karfreitag = {
id: 'Karfreitag',
name: karfreitagName,
dateObj: Feiertage.getKarfreitag(Feiertage.formatDateObj, currentYear),
dateDE: Feiertage.getKarfreitag(Feiertage.formatDE, currentYear),
};
const easterSunday = {
id: 'Easter Sunday',
name: easterSundayName,
dateObj: Feiertage.getOstersonntag(Feiertage.formatDateObj, currentYear),
dateDE: Feiertage.getOstersonntag(Feiertage.formatDE, currentYear),
};
const easterMonday = {
id: 'Easter Monday',
name: easterMondayName,
dateObj: Feiertage.getOstermontag(Feiertage.formatDateObj, currentYear),
dateDE: Feiertage.getOstermontag(Feiertage.formatDE, currentYear),
};
const firstMay = {
id: 'First May',
name: firstMayName,
dateObj: Feiertage.getFirstMay(Feiertage.formatDateObj, currentYear),
dateDE: Feiertage.getFirstMay(Feiertage.formatDE, currentYear),
};
const stFlorian = {
id: ' St. Florian',
name: stFlorianName,
dateObj: Feiertage.getStFlorian(Feiertage.formatDateObj, currentYear),
dateDE: Feiertage.getStFlorian(Feiertage.formatDE, currentYear),
};
const christiHimmelfahrt = {
id: 'Christi Himmelfahrt',
name: christiHimmerlfahrtName,
dateObj: Feiertage.getChristiHimmelfahrt(Feiertage.formatDateObj, currentYear),
dateDE: Feiertage.getChristiHimmelfahrt(Feiertage.formatDE, currentYear),
};
const pfingstsonntag = {
id: 'Pfingstsonntag',
name: pfingstsonntagName,
dateObj: Feiertage.getPfingstsonntag(Feiertage.formatDateObj, currentYear),
dateDE: Feiertage.getPfingstsonntag(Feiertage.formatDE, currentYear),
};
const pfingstmontag = {
id: 'Pfingstmontag',
name: pfingstmontagName,
dateObj: Feiertage.getPfingstmontag(Feiertage.formatDateObj, currentYear),
dateDE: Feiertage.getPfingstmontag(Feiertage.formatDE, currentYear),
};
const fronleichnam = {
id: 'Fronleichnam',
name: fronleichnamName,
dateObj: Feiertage.getFronleichnam(Feiertage.formatDateObj, currentYear),
dateDE: Feiertage.getFronleichnam(Feiertage.formatDE, currentYear),
};
const bundesfeierCH = {
id: 'Bundesfeiertag CH',
name: bundesfeierCHName,
dateObj: Feiertage.getBundesfeierCH(Feiertage.formatDateObj, currentYear),
dateDE: Feiertage.getBundesfeierCH(Feiertage.formatDE, currentYear),
};
const mariaHimmelfahrt = {
id: 'Maria Himmelfahrt',
name: mariaHimmelfahrtName,
dateObj: Feiertage.getMariaHimmelfahrt(Feiertage.formatDateObj, currentYear),
dateDE: Feiertage.getMariaHimmelfahrt(Feiertage.formatDE, currentYear),
};
const stRupert = {
id: 'St. Rupert',
name: stRupertName,
dateObj: Feiertage.getStRupert(Feiertage.formatDateObj, currentYear),
dateDE: Feiertage.getStRupert(Feiertage.formatDE, currentYear),
};
const tagDerDeutschenEinheit = {
id: 'Tag der Deutschen Einheit',
name: tagDerDeutschenEinheitName,
dateObj: Feiertage.getTagDerDeutschenEinheit(Feiertage.formatDateObj, currentYear),
dateDE: Feiertage.getTagDerDeutschenEinheit(Feiertage.formatDE, currentYear),
};
const tagDerVolksabstimmung = {
id: 'Tag der Volksabstimmung AT',
name: tagDerVolksabstimmungName,
dateObj: Feiertage.getTagDerVolksabstimmung(Feiertage.formatDateObj, currentYear),
dateDE: Feiertage.getTagDerVolksabstimmung(Feiertage.formatDE, currentYear),
};
const nationalfeiertagAT = {
id: 'Nationalfeiertag AT',
name: nationalfeiertagATName,
dateObj: Feiertage.getNationalfeiertagAT(Feiertage.formatDateObj, currentYear),
dateDE: Feiertage.getNationalfeiertagAT(Feiertage.formatDE, currentYear),
};
const halloween = {
id: 'Halloween',
name: halloweenName,
dateObj: Feiertage.getHalloween(Feiertage.formatDateObj, currentYear),
dateDE: Feiertage.getHalloween(Feiertage.formatDE, currentYear),
};
const allerheiligen = {
id: 'Allerheiligen',
name: allerheiligenName,
dateObj: Feiertage.getAllerheiligen(Feiertage.formatDateObj, currentYear),
dateDE: Feiertage.getAllerheiligen(Feiertage.formatDE, currentYear),
};
const stMartin = {
id: 'St. Martin',
name: stMartinName,
dateObj: Feiertage.getStMartin(Feiertage.formatDateObj, currentYear),
dateDE: Feiertage.getStMartin(Feiertage.formatDE, currentYear),
};
const stLeopold = {
id: 'St. Leopold',
name: stLeopoldName,
dateObj: Feiertage.getStLeopold(Feiertage.formatDateObj, currentYear),
dateDE: Feiertage.getStLeopold(Feiertage.formatDE, currentYear),
};
const bussUndBettag = {
id: 'Buß und Bettag',
name: bussUndBettagName,
dateObj: Feiertage.getBussUndBettag(Feiertage.formatDateObj, currentYear),
dateDE: Feiertage.getBussUndBettag(Feiertage.formatDE, currentYear),
};
const santa = {
id: 'Santa Day',
name: santaName,
dateObj: Feiertage.getNikolaus(Feiertage.formatDateObj, currentYear),
dateDE: Feiertage.getNikolaus(Feiertage.formatDE, currentYear),
};
const mariaeEmpfaengnis = {
id: 'Mariä Empfängnis',
name: mariaeEmpfaengnisName,
dateObj: Feiertage.getMariaeEmpfaengnis(Feiertage.formatDateObj, currentYear),
dateDE: Feiertage.getMariaeEmpfaengnis(Feiertage.formatDE, currentYear),
};
const advent1 = {
id: '1. Advent',
name: advent1Name,
dateObj: Feiertage.getAdvent1(Feiertage.formatDateObj, currentYear),
dateDE: Feiertage.getAdvent1(Feiertage.formatDE, currentYear),
};
const advent2 = {
id: '2. Advent',
name: advent2Name,
dateObj: Feiertage.getAdvent2(Feiertage.formatDateObj, currentYear),
dateDE: Feiertage.getAdvent2(Feiertage.formatDE, currentYear),
};
const advent3 = {
id: '3. Advent',
name: advent3Name,
dateObj: Feiertage.getAdvent3(Feiertage.formatDateObj, currentYear),
dateDE: Feiertage.getAdvent3(Feiertage.formatDE, currentYear),
};
const advent4 = {
id: '4. Advent',
name: advent4Name,
dateObj: Feiertage.getAdvent4(Feiertage.formatDateObj, currentYear),
dateDE: Feiertage.getAdvent4(Feiertage.formatDE, currentYear),
};
const christmasEve = {
id: 'Christmas Eve',
name: christmasEveName,
dateObj: Feiertage.getHeiligabend(Feiertage.formatDateObj, currentYear),
dateDE: Feiertage.getHeiligabend(Feiertage.formatDE, currentYear),
};
const firstDayChristmas = {
id: 'First day of Christmas',
name: firstDayChristmasName,
dateObj: Feiertage.getWeihnachtsfeiertag1(Feiertage.formatDateObj, currentYear),
dateDE: Feiertage.getWeihnachtsfeiertag1(Feiertage.formatDE, currentYear),
};
const secondDayChristmas = {
id: 'Second day of Christmas',
name: secondDayChristmasName,
dateObj: Feiertage.getWeihnachtsfeiertag2(Feiertage.formatDateObj, currentYear),
dateDE: Feiertage.getWeihnachtsfeiertag2(Feiertage.formatDE, currentYear),
};
const newYearsEve = {
id: 'New Years Eve',
name: newYearsEveName,
dateObj: Feiertage.getSilvester(Feiertage.formatDateObj, currentYear),
dateDE: Feiertage.getSilvester(Feiertage.formatDE, currentYear),
};
function getOwnHoliday1(format, year) {
if (format === formatDE) {
return `${dayOwnHoliday1}.${monthOwnHoliday1}.${year}`;
}
return `${year}-${monthOwnHoliday1}-${dayOwnHoliday1}`;
}
function getOwnHoliday2(format, year) {
if (format === formatDE) {
return `${dayOwnHoliday2}.${monthOwnHoliday2}.${year}`;
}
return `${year}-${monthOwnHoliday2}-${dayOwnHoliday2}`;
}
function getOwnHoliday3(format, year) {
if (format === formatDE) {
return `${dayOwnHoliday3}.${monthOwnHoliday3}.${year}`;
}
return `${year}-${monthOwnHoliday3}-${dayOwnHoliday3}`;
}
function getOwnHoliday4(format, year) {
if (format === formatDE) {
return `${dayOwnHoliday4}.${monthOwnHoliday4}.${year}`;
}
return `${year}-${monthOwnHoliday4}-${dayOwnHoliday4}`;
}
function getOwnHoliday5(format, year) {
if (format === formatDE) {
return `${dayOwnHoliday5}.${monthOwnHoliday5}.${year}`;
}
return `${year}-${monthOwnHoliday5}-${dayOwnHoliday5}`;
}
function getOwnHoliday6(format, year) {
if (format === formatDE) {
return `${dayOwnHoliday6}.${monthOwnHoliday6}.${year}`;
}
return `${year}-${monthOwnHoliday6}-${dayOwnHoliday6}`;
}
function getOwnHoliday7(format, year) {
if (format === formatDE) {
return `${dayOwnHoliday7}.${monthOwnHoliday7}.${year}`;
}
return `${year}-${monthOwnHoliday7}-${dayOwnHoliday7}`;
}
function getOwnHoliday8(format, year) {
if (format === formatDE) {
return `${dayOwnHoliday8}.${monthOwnHoliday8}.${year}`;
}
return `${year}-${monthOwnHoliday8}-${dayOwnHoliday8}`;
}
function getOwnHoliday9(format, year) {
if (format === formatDE) {
return `${dayOwnHoliday9}.${monthOwnHoliday9}.${year}`;
}
return `${year}-${monthOwnHoliday9}-${dayOwnHoliday9}`;
}
function getOwnHoliday10(format, year) {
if (format === formatDE) {
return `${dayOwnHoliday10}.${monthOwnHoliday10}.${year}`;
}
return `${year}-${monthOwnHoliday10}-${dayOwnHoliday10}`;
}
const ownHoliday1 = {
id: nameOwnHoliday1,
name: nameOwnHoliday1,
dateObj: getOwnHoliday1(formatDateObj, currentYear),
dateDE: getOwnHoliday1(formatDE, currentYear),
};
const ownHoliday2 = {
id: nameOwnHoliday2,
name: nameOwnHoliday2,
dateObj: getOwnHoliday2(formatDateObj, currentYear),
dateDE: getOwnHoliday2(formatDE, currentYear),
};
const ownHoliday3 = {
id: nameOwnHoliday3,
name: nameOwnHoliday3,
dateObj: getOwnHoliday3(formatDateObj, currentYear),
dateDE: getOwnHoliday3(formatDE, currentYear),
};
const ownHoliday4 = {
id: nameOwnHoliday4,
name: nameOwnHoliday4,
dateObj: getOwnHoliday4(formatDateObj, currentYear),
dateDE: getOwnHoliday4(formatDE, currentYear),
};
const ownHoliday5 = {
id: nameOwnHoliday5,
name: nameOwnHoliday5,
dateObj: getOwnHoliday5(formatDateObj, currentYear),
dateDE: getOwnHoliday5(formatDE, currentYear),
};
const ownHoliday6 = {
id: nameOwnHoliday6,
name: nameOwnHoliday6,
dateObj: getOwnHoliday6(formatDateObj, currentYear),
dateDE: getOwnHoliday6(formatDE, currentYear),
};
const ownHoliday7 = {
id: nameOwnHoliday7,
name: nameOwnHoliday7,
dateObj: getOwnHoliday7(formatDateObj, currentYear),
dateDE: getOwnHoliday7(formatDE, currentYear),
};
const ownHoliday8 = {
id: nameOwnHoliday8,
name: nameOwnHoliday8,
dateObj: getOwnHoliday8(formatDateObj, currentYear),
dateDE: getOwnHoliday8(formatDE, currentYear),
};
const ownHoliday9 = {
id: nameOwnHoliday9,
name: nameOwnHoliday9,
dateObj: getOwnHoliday9(formatDateObj, currentYear),
dateDE: getOwnHoliday9(formatDE, currentYear),
};
const ownHoliday10 = {
id: nameOwnHoliday10,
name: nameOwnHoliday10,
dateObj: getOwnHoliday10(formatDateObj, currentYear),
dateDE: getOwnHoliday10(formatDE, currentYear),
};
const holiday = [];
function checkbox() {
// check New Year is activated
if (checkNewYear) {
holiday.push(newYear); // add New Year to holiday array
} else {
const index = holiday.indexOf(newYear); // get index of item
if (index >= 0) {
holiday.splice(index); // remove item at index
}
}
// check Berchtoldstag is activated
if (checkBerchtoldstag) {
holiday.push(berchtoldstag); // add Bercholdstag to holiday array
} else {
const index = holiday.indexOf(berchtoldstag); // get index of item
if (index >= 0) {
holiday.splice(index); // remove item at index
}
}
// check Epiphany is activated
if (checkEpiphany) {
holiday.push(epiphany); // add Epiphany to holiday array
} else {
const index = holiday.indexOf(epiphany); // get index of item
if (index >= 0) {
holiday.splice(index); // remove item at index
}
}
// check Weiberfastnacht is activated
if (checkWeiberfastnacht) {
holiday.push(weiberfastnacht); // add Weiberfastnacht to holiday array
} else {
const index = holiday.indexOf(weiberfastnacht); // get index of item
if (index >= 0) {
holiday.splice(index); // remove item at index
}
}
// check Valentinstag is activated
if (checkValentinstag) {
holiday.push(valentinstag); // add Valentinstag to holiday array
} else {
const index = holiday.indexOf(valentinstag); // get index of item
if (index >= 0) {
holiday.splice(index); // remove item at index
}
}
// check Rosenmontag is activated
if (checkRosenmontag) {
holiday.push(rosenmontag); // add Rosenmontag to holiday array
} else {
const index = holiday.indexOf(rosenmontag); // get index of item
if (index >= 0) {
holiday.splice(index); // remove item at index
}
}
// check Fastnachtsdienstag is activated
if (checkFastnachtsdienstag) {
holiday.push(fastnachtsdienstag); // add Fastnachtsdienstag to holiday array
} else {
const index = holiday.indexOf(fastnachtsdienstag); // get index of item
if (index >= 0) {
holiday.splice(index); // remove item at index
}
}
// check Aschermittwoch is activated
if (checkAschermittwoch) {
holiday.push(aschermittwoch); // add Aschermittwoch to holiday array
} else {
const index = holiday.indexOf(aschermittwoch); // get index of item
if (index >= 0) {
holiday.splice(index); // remove item at index
}
}
// check St. Josef is activated
if (checkStJosef) {
holiday.push(stJosef); // add St. Josef to holiday array
} else {
const index = holiday.indexOf(stJosef); // get index of item
if (index >= 0) {
holiday.splice(index); // remove item at index
}
}
// check Gründonnerstag is activated
if (checkGruendonnerstag) {
holiday.push(gruendonnerstag); // add Gründonnerstag to holiday array
} else {
const index = holiday.indexOf(gruendonnerstag); // get index of item
if (index >= 0) {
holiday.splice(index); // remove item at index
}
}
// check Karfreitag is activated
if (checkKarfreitag) {
holiday.push(karfreitag); // add Karfreitag to holiday array
} else {
const index = holiday.indexOf(karfreitag); // get index of item
if (index >= 0) {
holiday.splice(index); // remove item at index
}
}
// check Easter Sunday is activated
if (checkEasterSunday) {
holiday.push(easterSunday); // add Easter Sunday to holiday array
} else {
const index = holiday.indexOf(easterSunday); // get index of item
if (index >= 0) {
holiday.splice(index); // remove item at index
}
}
// check Easter Monday is activated
if (checkEasterMonday) {
holiday.push(easterMonday); // add Easter Monday to holiday array
} else {
const index = holiday.indexOf(easterMonday); // get index of item
if (index >= 0) {
holiday.splice(index); // remove item at index
}
}
// check First May is activated
if (checkFirstMay) {
holiday.push(firstMay); // add First May to holiday array
} else {
const index = holiday.indexOf(firstMay); // get index of item
if (index >= 0) {
holiday.splice(index); // remove item at index
}
}
// check St. Florian is activated
if (checkStFlorian) {
holiday.push(stFlorian); // add St. Florian to holiday array
} else {
const index = holiday.indexOf(stFlorian); // get index of item
if (index >= 0) {
holiday.splice(index); // remove item at index
}
}
// check Christi Himmelfahrt is activated
if (checkChristiHimmelfahrt) {
holiday.push(christiHimmelfahrt); // add Christi Himmelfahrt to holiday array
} else {
const index = holiday.indexOf(christiHimmelfahrt); // get index of item
if (index >= 0) {
holiday.splice(index); // remove item at index
}
}
// check Pfingstsonntag is activated
if (checkPfingstsonntag) {
holiday.push(pfingstsonntag); // add Pfingstsonntag to holiday array
} else {
const index = holiday.indexOf(pfingstsonntag); // get index of item
if (index >= 0) {
holiday.splice(index); // remove item at index
}
}
// check Pfingstmontag is activated
if (checkPfingstmontag) {
holiday.push(pfingstmontag); // add Pfingstmontag to holiday array
} else {
const index = holiday.indexOf(pfingstmontag); // get index of item
if (index >= 0) {
holiday.splice(index); // remove item at index
}
}
// check Fronleichnam is activated
if (checkFronleichnam) {
holiday.push(fronleichnam); // add Fronleichnam to holiday array
} else {
const index = holiday.indexOf(fronleichnam); // get index of item
if (index >= 0) {
holiday.splice(index); // remove item at index
}
}
// check Bundesfeier CH is activated
if (checkBundesfeierCH) {
holiday.push(bundesfeierCH); // add Bundesfeier CH to holiday array
} else {
const index = holiday.indexOf(bundesfeierCH); // get index of item
if (index >= 0) {
holiday.splice(index); // remove item at index
}
}
// check Maria Himmelfahrt is activated
if (checkMariaHimmelfahrt) {
holiday.push(mariaHimmelfahrt); // add Maria Himmelfahrt to holiday array
} else {
const index = holiday.indexOf(mariaHimmelfahrt); // get index of item
if (index >= 0) {
holiday.splice(index); // remove item at index
}
}
// check St. Rupert is activated
if (checkStRupert) {
holiday.push(stRupert); // add St. Rupert to holiday array
} else {
const index = holiday.indexOf(stRupert); // get index of item
if (index >= 0) {
holiday.splice(index); // remove item at index
}
}
// check Tag der Deutschen Einheit is activated
if (checkTagDerDeutschenEinheit) {
holiday.push(tagDerDeutschenEinheit); // add Tag der Deutschen Einheit to holiday array
} else {
const index = holiday.indexOf(tagDerDeutschenEinheit); // get index of item
if (index >= 0) {
holiday.splice(index); // remove item at index
}
}
// check Tag der Volksabstimmung is activated
if (checkTagDerVolksabstimmung) {
holiday.push(tagDerVolksabstimmung); // add Tag der Volksabstimmung to holiday array
} else {
const index = holiday.indexOf(tagDerVolksabstimmung); // get index of item
if (index >= 0) {
holiday.splice(index); // remove item at index
}
}
// check Nationalfeiertag AT is activated
if (checkNationalfeiertagAT) {
holiday.push(nationalfeiertagAT); // add Nationalfeiertag AT to holiday array
} else {
const index = holiday.indexOf(nationalfeiertagAT); // get index of item
if (index >= 0) {
holiday.splice(index); // remove item at index
}
}
// check Halloween is activated
if (checkHalloween) {
holiday.push(halloween); // add Halloween to holiday array
} else {
const index = holiday.indexOf(halloween); // get index of item
if (index >= 0) {
holiday.splice(index); // remove item at index
}
}
// check Allerheiligen is activated
if (checkAllerheiligen) {
holiday.push(allerheiligen); // add Allerheiligen to holiday array
} else {
const index = holiday.indexOf(allerheiligen); // get index of item
if (index >= 0) {
holiday.splice(index); // remove item at index
}
}
// check St. Martin is activated
if (checkStMartin) {
holiday.push(stMartin); // add St. Martin to holiday array
} else {
const index = holiday.indexOf(stMartin); // get index of item
if (index >= 0) {
holiday.splice(index); // remove item at index
}
}
// check St. Leopold is activated
if (checkStLeopold) {
holiday.push(stLeopold); // add St. Leopold to holiday array
} else {
const index = holiday.indexOf(stLeopold); // get index of item
if (index >= 0) {
holiday.splice(index); // remove item at index
}
}
// check Buß und Bettag is activated
if (checkBussUndBettag) {
holiday.push(bussUndBettag); // add Buß und Bettag to holiday array
} else {
const index = holiday.indexOf(bussUndBettag); // get index of item
if (index >= 0) {
holiday.splice(index); // remove item at index
}
}
// check Santa is activated
if (checkSanta) {
holiday.push(santa); // add Santa to holiday array
} else {
const index = holiday.indexOf(santa); // get index of item
if (index >= 0) {
holiday.splice(index); // remove item at index
}
}
// check Mariä Empfängnis is activated
if (checkMariaeEmpfaengnis) {
holiday.push(mariaeEmpfaengnis); // add Mariö Empfängnis to holiday array
} else {
const index = holiday.indexOf(mariaeEmpfaengnis); // get index of item
if (index >= 0) {
holiday.splice(index); // remove item at index
}
}
// check 1. Advent is activated
if (checkadvent1) {
holiday.push(advent1); // add 1. Advent to holiday array
} else {
const index = holiday.indexOf(advent1); // get index of item
if (index >= 0) {
holiday.splice(index); // remove item at index
}
}
// check 2. Advent is activated
if (checkAdvent2) {
holiday.push(advent2); // add 2. Advent to holiday array
} else {
const index = holiday.indexOf(advent2); // get index of item
if (index >= 0) {
holiday.splice(index); // remove item at index
}
}
// check 3. Advent is activated
if (checkAdvent3) {
holiday.push(advent3); // add 3. Advent to holiday array
} else {
const index = holiday.indexOf(advent3); // get index of item
if (index >= 0) {
holiday.splice(index); // remove item at index
}
}
// check 4. Advent is activated
if (checkAdvent4) {
holiday.push(advent4); // add 4. Advent to holiday array
} else {
const index = holiday.indexOf(advent4); // get index of item
if (index >= 0) {
holiday.splice(index); // remove item at index
}
}
// check Christmas Eve is activated
if (checkChristmasEve) {
holiday.push(christmasEve); // add Christmas Eve to holiday array
} else {
const index = holiday.indexOf(christmasEve); // get index of item
if (index >= 0) {
holiday.splice(index); // remove item at index
}
}
// check First day of Christmas is activted
if (checkFirstDayChristmas) {
holiday.push(firstDayChristmas); // add First day of Christmas to holiday array
} else {
const index = holiday.indexOf(firstDayChristmas); // get index of item
if (index >= 0) {
holiday.splice(index); // remove item at index
}
}
// check Second day of Christmas is activated
if (checkSecondDayChristmas) {
holiday.push(secondDayChristmas); // add Second Christmas Day to holiday array
} else {
const index = holiday.indexOf(secondDayChristmas); // get index of item
if (index >= 0) {
holiday.splice(index); // remove item at index
}
}
// check New Years Eve is activated
if (checkNewYearsEve) {
holiday.push(newYearsEve); // add New Years Eve to holiday array
} else {
const index = holiday.indexOf(newYearsEve); // get index of item
if (index >= 0) {
holiday.splice(index); // remove item at index
}
}
// check Own Holiday 1 is activated
if (checkOwnHoliday1) {
holiday.push(ownHoliday1); // add Won Holiday 1 to holiday array
} else {
const index = holiday.indexOf(ownHoliday1); // get index of item
if (index >= 0) {
holiday.splice(index); // remove item at index
}
}
// check Own Holiday 2 is activated
if (checkOwnHoliday2) {
holiday.push(ownHoliday2); // add Won Holiday 2 to holiday array
} else {
const index = holiday.indexOf(ownHoliday2); // get index of item
if (index >= 0) {
holiday.splice(index); // remove item at index
}
}
// check Own Holiday 3 is activated
if (checkOwnHoliday3) {
holiday.push(ownHoliday3); // add Won Holiday 3 to holiday array
} else {
const index = holiday.indexOf(ownHoliday3); // get index of item
if (index >= 0) {
holiday.splice(index); // remove item at index
}
}
// check Own Holiday 4 is activated
if (checkOwnHoliday4) {
holiday.push(ownHoliday4); // add Won Holiday 4 to holiday array
} else {
const index = holiday.indexOf(ownHoliday4); // get index of item
if (index >= 0) {
holiday.splice(index); // remove item at index
}
}
// check Own Holiday 5 is activated
if (checkOwnHoliday5) {
holiday.push(ownHoliday5); // add Won Holiday 5 to holiday array
} else {