-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathOpeningHours.php
779 lines (669 loc) · 27.4 KB
/
OpeningHours.php
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
<?php
declare(strict_types=1);
namespace ProcessWire;
use DateTime;
/**
* Helper WireData Class
*/
class OpeningHours extends WireData {
const DEFAULTTIMEFORMAT = '%R';
public function __construct() {
parent::__construct();
//set default values if they are not present inside the database
$this->set('times', json_decode(file_get_contents(__DIR__ . '/defaultData.json'), true));
$this->set('timeformat', self::DEFAULTTIMEFORMAT);
$this->set('numberOftimes', '2');
$this->set('hideholiday', 0);
}
/**
* Helper methods for arrays
*/
/**
* Method to return a multidimensional array with day abbreviations and daynames
* First item in sub-array is the abbreviation and the second the fullname of the day
* @return array
*/
public static function getWeekdays():array {
$mo1 = __('Mo');
$mo2 = __('Monday');
$tu1 = __('Tu');
$tu2 = __('Tuesday');
$we1 = __('We');
$we2 = __('Wednesday');
$th1 = __('Th');
$th2 = __('Thursday');
$fr1 = __('Fr');
$fr2 = __('Friday');
$sa1 = __('Sa');
$sa2 = __('Saturday');
$su1 = __('Su');
$su2 = __('Sunday');
$ho1 = __('Ho');
$ho2 = __('Holiday');
return [
'mo' => [$mo1, $mo2],
'tu' => [$tu1, $tu2],
'we' => [$we1, $we2],
'th' => [$th1, $th2],
'fr' => [$fr1, $fr2],
'sa' => [$sa1, $sa2],
'su' => [$su1, $su2],
'ho' => [$ho1, $ho2]
];
}
/**
* Method to return only the lowercase day abbreviations in an array (['mo','tu',....])
* @return array
*/
public static function getDayAbbreviations():array {
$days = [];
foreach (self::getWeekdays() as $v) {
$days[] = $v;
}
return $days;
}
/**
* Create a multidimensional array of all times from the one-dimensional POST array after form submission
* This step is required for various sanitizations and validations of the input values which cannot
* be processed from a one-dimensional array
* @param array $values
* @return array
*/
public static function createMultidimArray(array $values):array {
// Avoid double conversion
if (self::isMultidimArray($values)) {
return $values;
}
$temp_array = [];
foreach (self::getWeekdays() as $key => $dayname) {
foreach ($values as $k => $v) {
if ($key === (explode('-', $k)[1])) {
$temp_array[$key][] = $v;
}
}
}
$newArray = [];
foreach ($temp_array as $day => $values) {
$daytimes = array_chunk($values, 2);
//change keys from numeric to assoc
$daytimes = array_map(function ($tag) {
return array(
'start' => $tag[0],
'finish' => $tag[1]
);
}, $daytimes);
$newArray[$day] = $daytimes;
}
return $newArray;
}
/**
* Check if the array is already multidimensional
* This check is required to avoid double-converting values
* in some circumstances, e.g. hidden fieldsets
* @param array $array
* @return bool
*/
protected static function isMultidimArray(array $array):bool {
$firstItem = reset($array);
return is_array($firstItem);
}
/**
* Method to flatten the multidimensional array back to a one-dimensional array like we have got from POST
* @param array $array - multidimensional array
* @param string $fieldname - the name of the field
* @return array
*/
public static function flattenArray(array $array, string $fieldname):array {
$flattenArray = [];
foreach (self::getWeekdays() as $key => $day) { //key = mo,tu,... day = [Mo => Monday]
foreach ($array as $dayAbbr => $timesarray) { // key = mo,tu,...value = [times array]
if ($key === $dayAbbr) {
foreach ($timesarray as $keyNum => $dayArray) { // key = 0,1,2, value = ['start' => '08:00', 'finish' => '16:00']
foreach ($dayArray as $name => $value) {
$createdKey = $fieldname . '-' . $key . '-' . $keyNum . '-' . $name;
$flattenArray[$createdKey] = $value;
}
}
}
}
}
return $flattenArray;
}
/* Validation methods */
/**
* Checks if input data is a valid time string
* @param string $time_str
* @param string $format
* @return boolean
*/
public static function isTimeValid(string $time_str, string $format = 'H:i'):bool {
$DateTime = DateTime::createFromFormat("d/m/Y $format", "10/10/2010 $time_str");
return $DateTime && $DateTime->format("d/m/Y $format") == "10/10/2010 $time_str";
}
/**
* Return all predefined PHP date() formats for use as times
*
* Note: this method moved to the WireDateTime class and is kept here for backwards compatibility.
*
* @return array
*
* @deprecated Use WireDateTime class instead
*/
public static function getTimeFormats():array {
return WireDateTime::_getTimeFormats();
}
/**
* Format a date with the given PHP date() or PHP strftime() format
*
* Note: this method moved to the WireDateTime class and is kept here for backwards compatibility.
*
* @param int $value Unix timestamp of date
* @param string $format date() or strftime() format string to use for formatting
* @return string Formatted date string
* @deprecated Use WireDateTime class instead
*
*/
public static function formatDate(int $value, string $format):string {
$wdt = new WireDateTime();
return $wdt->formatDate($value, $format);
}
/**
* Format a time value according to the format settings in the field configuration
* fe 16:00 will be formatted to 04:00 AM if strftime setting is %r
* @param string|null $time
* @param string|null $timeformat
* @return string
*/
public static function formatTimestring(?string $time, ?string $timeformat = null):string {
if ($time) {
$timeStamp = wire('sanitizer')->date('10.10.2010 ' . $time);
$timeformat = $timeformat ?: self::DEFAULTTIMEFORMAT;
$time = OpeningHours::formatDate($timeStamp, $timeformat);
}
return $time;
}
/**
* Renders a string of opening times on a specific day (without the day name)
* @param string $day
* @param array $options
* timeseparator: string -> separator between multiple times (default: ,)
* timesuffix: string -> add text after timestring (default: '')
* showClosed: true/false -> show closed days or not (default: true)
* timetag: false/string -> add a surrounding tag (fe div) or none (false) -> default: false
* timeclass: string -> add a custom CSS class for the timetag (default: '')
* @return string
*/
public function renderDay(string $day, array $options = []):string {
$out = '';
// do not run in backend
if (strpos(wire('page')->url, wire('config')->urls->admin) !== 0) {
// add a wrapper tag for the times if set
if ($options['timetag']) {
$out .= '<' . $options['timetag'];
$timeClass[] = 'oh-time';
$timeClass[] = $day;
if ($options['timeclass']) {
$timeClass[] = $options['timeclass'];
}
$out .= ' class="' . implode(' ', $timeClass) . '">';
}
if ($this->times) {
$options = array_merge($this->defaultOptions(), $options);
//opening_hours-mo-0-start
$getTimes = $this->times[$day];
$times = [];
if ((is_array($getTimes)) && (count($getTimes))) {
$numberOfTimes = count($getTimes);
// add time suffix if set
if ($options['timesuffix']) {
$timesuffix = ' ' . $options['timesuffix'];
} else {
$timesuffix = '';
}
if ($numberOfTimes > 1) { // multiple opening times per day
foreach ($getTimes as $value) {
$times[] = $value['start'] . ' - ' . $value['finish'] . $timesuffix;
}
$out .= implode($options['timeseparator'], $times);
} else { // single opening time or closed
if (array_filter($getTimes[0])) {
$times[] = $getTimes[0]['start'] . ' - ' . $getTimes[0]['finish'] . $timesuffix;
$out .= implode('-', $times);
} else {
$closed = ($options['showClosed']) ? $this->_('closed') : '';
$out .= $closed;
}
}
}
}
// enter closing tag for the times if set
if ($options['timetag']) {
$out .= '</' . $options['timetag'] . '>';
}
}
return $out;
}
/**
* Alias function for renderDay() because this function name fits better
* @param string $day
* @param array $options
* @return string
*/
public function renderDayTime(string $day, array $options = []):string {
return $this->renderDay($day, $options);
}
/**
* Array, that contains all default rendering settings
* @return array
*/
protected function defaultOptions():array {
return [
'wrappertag' => 'ul',
'wrapperclass' => '',
'itemtag' => 'li',
'daytag' => false,
'dayclass' => '',
'timetag' => false,
'timeclass' => '',
'daytimeseparator' => ':',
'fulldayName' => false,
'timeseparator' => ', ',
'timesuffix' => '',
'showClosed' => true,
'closedText' => $this->_('closed')
];
}
/**
* Internal method to render the day name including/excluding the day time separator
* @param string $dayAbbr - the day abbreviation (fe mo)
* @param string $dayName - the day name (fe Monday)
* @param array $options - the options array containing the settings
* @return string
*/
protected function renderDayName(string $dayAbbr, string $dayName, array $options, bool $combined = false):string {
$out = '';
// do not run in backend
if (strpos(wire('page')->url, wire('config')->urls->admin) !== 0) {
// check if day is closed or not
if (!$combined) {
$times = $this->times[$dayAbbr][0]['start'];
// hide closed days and day is closed
if ((!$options['showClosed']) && (!$times)) {
return $out;
} // return empty string
}
// add surrounding tag for day name if set
if ($options['daytag']) {
$out .= '<' . $options['daytag'];
if (!empty($dayAbbr)) {
$dayClass[] = 'oh-day day-' . $dayAbbr;
} else {
$dayClass[] = 'oh-day';
}
if ($options['dayclass']) {
$dayClass[] = $options['dayclass'];
}
$out .= ' class="' . implode(' ', $dayClass) . '">';
}
$out .= $dayName;
// add day-time-separator if set
if ($options['daytimeseparator']) {
$out .= $options['daytimeseparator'];
}
if ($options['daytag']) {
$out .= '</' . $options['daytag'] . '>';
}
}
return $out;
}
/**
* Internal function to change the key name "ulclass" to "wrapperclass" inside the options array
* This key name was changed in version 1.1, so this is only as a fallback for older versions
* @param array $options
* @return array
*/
protected function convertUlClassFallback(array $options):array {
if (array_key_exists('ulclass', $options)) {
$options['wrapperclass'] = $options['ulclass'];
unset($options['ulclass']);
}
return $options;
}
/**
* This is the base Method to render all times per week
* @param array $options
*
* Description of all possible options to influence the rendering process
*
* wrappertag: set the tag for the outer container (default is ul)
* itemtag: set the outer tag for the container containing the day opening times per day (default is li)
* daytag: the tag element which surrounds the day name (default: false -> not surrounding element)
* timetag: the tag element which surrounds the opening times on that day (default: false -> not surrounding element)
* dayclass: a CSS class for the daytag element (default: false -> no class)
* timeclass: a CSS class for the timetag element (default: false -> no class)
* daytimeseparator: add a string to separate the day name and the times or add false to remove it (default is :)
* wrapperclass: add a CSS class to the wrapper tag (default: '')
* fulldayName: show fullname (true) or dayname abbreviation (false) -> (default: false)
* timeseparator: separator between multiple times (default: ,)
* timesuffix: add text after timestring (default: '')
* showClosed: true/false show closed days or not (default: true)
* closedText: overwrite the default text for closed days (default is closed)
*
* By default, all times will be rendered as an unordered list, until you change the tags
*
* @return string
*/
public function render(array $options = []):string {
// fallback for older versions -> convert key "ulclass" to "wrapperclass" because it was renamed in version 1.1
$options = $this->convertUlClassFallback($options);
$options = array_merge($this->defaultOptions(), $options);
// start creating the markup
$out = '';
// do not run in backend
if (strpos(wire('page')->url, wire('config')->urls->admin) !== 0) {
// add opening wrapper tag if set
if ($options['wrappertag']) {
$out .= '<' . $options['wrappertag'];
$out .= $options['wrapperclass'] ? ' class="' . $options['wrapperclass'] . '"' : '';
$out .= '>';
}
$days = self::getWeekdays();
// remove Holiday opening times according to the settings
if ($this->hideholiday) {
unset($days['ho']);
}
// loop over all weekdays
foreach ($days as $day => $name) {
// set opening item tag if set
$out .= $options['itemtag'] ? '<' . $options['itemtag'] . ' class="time day-' . $day . '">' : '';
// add surrounding tag for day name if set
$dayName = $options['fulldayName'] ? $name[1] : $name[0];
$out .= $this->renderDayName($day, $dayName, $options);
// render all times on that day
$out .= ' ' . $this->renderDay($day, $options);
// set closing item tag if set
$out .= $options['itemtag'] ? '</' . $options['itemtag'] . '>' : '';
}
// add closing wrapper tag if set
if ($options['wrappertag']) {
$out .= '</' . $options['wrappertag'] . '>';
}
}
return $out;
}
/**
* Method to output a multidimensional array containing all days with same times combined
* @param bool $showClosed -> true: closed days will be displayed; false: closed days will not be displayed
* @return array
*/
public function combinedDays(bool $showClosed = true):array {
$equalDays = [];
if ($showClosed) {
$allOpeningHours = $this->times;
} else {
//remove all empty (closed) times
$allOpeningHours = wire('sanitizer')->minArray($this->times);
}
$uniqueOpeningHours = array_unique($allOpeningHours, SORT_REGULAR);
$nonUniqueOpeningHours = $allOpeningHours;
foreach ($uniqueOpeningHours as $day => $value) {
$equalDays[$day] = ['days' => [$day], 'opening_hours' => $value];
unset($nonUniqueOpeningHours[$day]);
}
foreach ($uniqueOpeningHours as $uniqueDay => $uniqueValue) {
foreach ($nonUniqueOpeningHours as $nonUniqueDay => $nonUniqueValue) {
if ($uniqueValue === $nonUniqueValue) {
$equalDays[$uniqueDay]['days'][] = $nonUniqueDay;
}
}
}
return $equalDays;
}
/**
* Return a string of combined days with same hours
* @param array $arrays
* @param array $options - array containing settings option
* @return string
*/
protected function timesPerDayString(array $arrays, array $options):string {
$out = '';
$dayNames = [];
foreach ($arrays['days'] as $dayAbbr) {
$add = true;
if ($dayAbbr == 'ho') {
if ($this->hideholiday) {
$add = false;
}
}
if ($add) {
$dayNames[] = $options['fulldayName'] ? self::getWeekdays()[$dayAbbr][1] : self::getWeekdays()[$dayAbbr][0];
}
}
// add surrounding tag for day names if set
$out .= $this->renderDayName('', implode(', ', $dayNames), $options, true);
$dayTimes = [];
foreach ($arrays['opening_hours'] as $times) {
if (count(array_filter($times)) === 0) {
//closed
$dayTimes[] = $options['closedText'];
} else {
$dayTimes[] = implode(' - ',
['start' => $times['start'], 'finish' => $times['finish']]) . $options['timesuffix'];
}
}
// add opening surrounding tag if set
if ($options['timetag']) {
$out .= '<' . $options['timetag'];
$timeClass[] = 'time';
if ($options['timeclass']) {
$timeClass[] = $options['timeclass'];
}
$out .= ' class="' . implode(' ', $timeClass) . '">';
}
$out .= '<span class="op-time">'.implode(', ', $dayTimes).'</span>';
// add closing surrounding tag if set
if ($options['timetag']) {
$out .= '</' . $options['timetag'] . '>';
}
return $out;
}
/**
* Method to render combined opening times as an unordered list
* You can use the samoe options as parameter as in the render method
* @param array $options - various output formatting options
* @return string
*/
public function renderCombinedDays(array $options = []):string {
// fallback for older versions -> convert key "ulclass" to "wrapperclass" because it was renamed in version 1.1
$options = $this->convertUlClassFallback($options);
$options = array_merge($this->defaultOptions(), $options);
// start creating the markup
$out = '';
// add opening wrapper tag if set
if ($options['wrappertag']) {
$out .= '<' . $options['wrappertag'];
$out .= $options['wrapperclass'] ? ' class="' . $options['wrapperclass'] . '"' : '';
$out .= '>';
}
foreach ($this->combinedDays($options['showClosed']) as $arrays) {
// set opening item tag if set
$out .= $options['itemtag'] ? '<' . $options['itemtag'] . ' class="oh-item">' : '';
$out .= $this->timesPerDayString($arrays, $options);
// set closing item tag if set
$out .= $options['itemtag'] ? '</' . $options['itemtag'] . '>' : '';
}
// add closing wrapper tag if set
if ($options['wrappertag']) {
$out .= '</' . $options['wrappertag'] . '>';
}
return $out;
}
/**
* !! DEPRICATED !!
* Method to render combined opening times inside a self chosen tag
* This method is depricated!!!!
*
* @param array $options - various output formatting options
* tagName: Set the preferred tag for each line (default is div)
* fulldayName: true/false -> if set to true the full day name (fe Monday) will be displayed, otherwise only the abbreviation (fe Mo)
* timeseparator : The sign between multiple opening times on the same day
* closedText : What should be displayed if it is closed on that day
* timesuffix: A text that should be displayed after the time
* showClosed: true => closed days will be displayed; false => closed days will be removed
* @param bool $combined
* @return string
*/
public function renderCombinedDaysTag(array $options = [], bool $combined = false):string {
// fallback for key name "tagName" to "itemtag" which was renamed in version 1.1
if (array_key_exists('tagName', $options)) {
$options['itemtag'] = $options['tagName'];
unset($options['tagName']);
} else {
// set div as default value
$options['itemtag'] = 'div';
}
$options = array_merge($this->defaultOptions(), $options);
if ($combined) {
return $this->renderCombinedDays($options);
} else {
return $this->render($options);
}
}
/**
* Return the number of how many times were set
* @return int
*/
public function getNumberOfTimes()
{
$times = $this->times;
if ($this->hideholiday) {
unset($times['ho']);
}
$timesPerDay = [];
foreach($times as $key => $day){
foreach($day as $dayTime){
if(array_filter($dayTime)){
$timesPerDay[] = $dayTime;
}
}
}
return count($timesPerDay);
}
/**
* Method to create an array of combined opening hours for usage in json LD markup of schema.org
* Based on https://schema.org/openingHours
* @return array fe Array ( [0] => Mo,Tu,We 08:00-12:00 [1] => Mo,Th 13:00-18:00 [2] => Th 08:00-11:00 )
*/
public function getjsonLDTimes():array {
$times = array_filter($this->get('times'));
//convert times always to H:i format (fe 08:00), because Schema.org only accepts this format
array_walk_recursive($times, function (&$value, $key) {
if (($key === 'start') || ($key === 'finish')) {
if ($value) {
$value = OpeningHours::formatTimestring($value, 'H:i');
}
}
});
$temp_times = [];
foreach ($times as $day => $daytimes) {
foreach ($daytimes as $num => $time) {
$timeStr = array_filter($time);
$timeStr = implode('-', $timeStr);
$temp_times[$day . '-' . $num] = $timeStr;
}
}
$times = array_filter($temp_times);
$val = array_unique(array_values($times));
$dat = [];
foreach ($val as $v) {
$dat[$v] = array_keys($times, $v);
}
$combined = [];
foreach ($dat as $time => $days) {
$combined[$time] = implode(',', $days);
}
//manipulate values
array_walk($combined, function (&$value) {
$values = explode(',', $value);
$newValues = [];
foreach ($values as $val) {
$newValues[] = ucfirst(substr($val, 0, 2));
}
$value = implode(',', $newValues);
});
$corr = [];
foreach ($combined as $time => $days) {
$corr[] = $days . ' ' . $time;
}
return $corr;
}
/**
* Method to render a string of combined opening hours for usage in json LD markup of schema.org
* Based on https://schema.org/openingHours
* @return string -> fe "Mo-Fr 10:00-19:00", "Mo-Di 21:00-23:00", "Sa 10:00-22:00", "Su 10:00-21:00"
*/
public function renderjsonLDTimes():string {
$times = $this->getjsonLDTimes();
array_walk($times, function (&$value) {
$value = '"' . $value . '"';
});
return implode(', ', $times);
}
/**
* Render method to render all opening times as a definition list
* @param array $options - add some styling parameters
* @param bool $combined - render combined times (true) or not (false)
* @return string
*/
public function renderDefinitionList(array $options = [], bool $combined = false):string {
// set fixed values for the definition list
$options['wrappertag'] = 'dl';
$options['itemtag'] = false;
$options['daytag'] = 'dt';
$options['timetag'] = 'dd';
if ($combined) {
return $this->renderCombinedDays($options);
} else {
return $this->render($options);
}
}
/**
* Render method to render all opening times as a table
* @param array $options - add some styling parameters
* @param bool $combined - render combined times (true) or not (false)
* @return string
*/
public function renderTable(array $options = [], bool $combined = false):string {
// set fixed values for the definition list
$options['wrappertag'] = 'table';
$options['itemtag'] = 'tr';
$options['daytag'] = 'td';
$options['timetag'] = 'td';
if ($combined) {
return $this->renderCombinedDays($options);
} else {
return $this->render($options);
}
}
/**
* Render method to render all opening times using div and span container
* @param array $options - add some styling parameters
* @param bool $combined - render combined times (true) or not (false)
* @return string
*/
public function renderDiv(array $options = [], bool $combined = false):string {
// set fixed values for the definition list
$options['wrappertag'] = 'div';
$options['itemtag'] = 'div';
$options['daytag'] = 'span';
$options['timetag'] = 'span';
if ($combined) {
return $this->renderCombinedDays($options);
} else {
return $this->render($options);
}
}
public function __toString() {
return $this->render();
}
}