Skip to content

Commit 1dd7a3c

Browse files
committed
fix bs5 calendar widget
1 parent 095197e commit 1dd7a3c

4 files changed

Lines changed: 53 additions & 65 deletions

File tree

external/jquery/addons/scss/_variables.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ $td-dark-primary-border-color: $td-dark !default;
3434
$td-dark-text-shadow: 0 -1px 0 rgba(232, 230, 227, 0.25) !default;
3535
$td-dark-dow-color: rgba(232, 230, 227, 0.5) !default;
3636

37-
$td-widget-z-index: 9999 !default;
37+
$td-widget-z-index: 999 !default;
3838

3939
:root {
4040
--td-light: #{$td-light};

framework/core/forms/controls/bootstrap5/calendarcontrol.php

Lines changed: 17 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -148,29 +148,25 @@ function controlToHTML($name, $label = null) {
148148
calendar: " . ($this->showdate ? 'true' : 'false') . ",
149149
clock: " . ($this->showtime ? 'true' : 'false') . ",
150150
},
151-
sideBySide: " . ($this->showdate && $this->showtime ? 'true' : 'false') . ",
151+
sideBySide: " . ($this->showdate && $this->showtime ? 'true' : 'false') . ",";
152+
if (USE_BOOTSTRAP_ICONS) {
153+
$script .= "
154+
icons: {
155+
time: 'bi bi-clock',
156+
date: 'bi bi-calendar3',
157+
up: 'bi bi-arrow-up',
158+
down: 'bi bi-arrow-down',
159+
previous: 'bi bi-chevron-left',
160+
next: 'bi bi-chevron-right',
161+
today: 'bi bi-calendar-check',
162+
clear: 'bi bi-trash',
163+
close: 'bi bi-x',
164+
},";
165+
}
166+
$script .= "
152167
}
153168
});
154-
155-
if (" . (USE_BOOTSTRAP_ICONS ? '1' : '0') . ") {
156-
tclock.updateOptions({
157-
display: {
158-
icons: {
159-
time: 'bi bi-clock',
160-
date: 'bi bi-calendar3',
161-
up: 'bi bi-arrow-up',
162-
down: 'bi bi-arrow-down',
163-
previous: 'bi bi-chevron-left',
164-
next: 'bi bi-chevron-right',
165-
today: 'bi bi-calendar-check',
166-
clear: 'bi bi-trash',
167-
close: 'bi bi-x',
168-
},
169-
}
170-
});
171-
}
172-
});
173-
";
169+
});";
174170

175171
global $less_vars;
176172

framework/core/forms/controls/bootstrap5/popupdatetimecontrol.php

Lines changed: 17 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -149,29 +149,25 @@ function controlToHTML($name, $label) {
149149
calendar: " . ($this->showdate ? 'true' : 'false') . ",
150150
clock: " . ($this->showtime ? 'true' : 'false') . ",
151151
},
152-
sideBySide: " . ($this->showdate && $this->showtime ? 'true' : 'false') . ",
152+
sideBySide: " . ($this->showdate && $this->showtime ? 'true' : 'false') . ",";
153+
if (USE_BOOTSTRAP_ICONS) {
154+
$script .= "
155+
icons: {
156+
time: 'bi bi-clock',
157+
date: 'bi bi-calendar3',
158+
up: 'bi bi-arrow-up',
159+
down: 'bi bi-arrow-down',
160+
previous: 'bi bi-chevron-left',
161+
next: 'bi bi-chevron-right',
162+
today: 'bi bi-calendar-check',
163+
clear: 'bi bi-trash',
164+
close: 'bi bi-x',
165+
},";
166+
}
167+
$script .= "
153168
}
154169
});
155-
156-
if (" . (USE_BOOTSTRAP_ICONS ? '1' : '0') . ") {
157-
tclock.updateOptions({
158-
display: {
159-
icons: {
160-
time: 'bi bi-clock',
161-
date: 'bi bi-calendar3',
162-
up: 'bi bi-arrow-up',
163-
down: 'bi bi-arrow-down',
164-
previous: 'bi bi-chevron-left',
165-
next: 'bi bi-chevron-right',
166-
today: 'bi bi-calendar-check',
167-
clear: 'bi bi-trash',
168-
close: 'bi bi-x',
169-
},
170-
}
171-
});
172-
}
173-
});
174-
";
170+
});";
175171

176172
global $less_vars;
177173

framework/core/forms/controls/bootstrap5/yuicalendarcontrol.php

Lines changed: 18 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ function controlToHTML($name, $label = null) {
107107
// $date_input->name = $idname;
108108
// $date_input->disabled = 'disabled';
109109
// $html = "<!-- cke lazy -->";
110-
$html = '<div class="input-group input-append' . $control_offset . '" id="'.$idname.'dateRangePicker" data-td-target-input="nearest">'.$date_input->toHTML(null, $name).'</div>';
110+
$html = '<div class="input-append' . $control_offset . '" id="'.$idname.'dateRangePicker" data-td-target-input="nearest">'.$date_input->toHTML(null, $name).'</div>';
111111
if (!empty($this->description))
112112
$html .= "<div id=\"" . $name . "HelpBlock\" class=\"" . $label_offset . "form-text text-muted\">".$this->description."</div>";
113113
// $html .= "
@@ -134,29 +134,25 @@ function controlToHTML($name, $label = null) {
134134
clock: " . ($this->showtime ? 'true' : 'false') . ",
135135
},
136136
inline: true,
137-
sideBySide: " . ($this->showdate && $this->showtime ? 'true' : 'false') . ",
137+
sideBySide: " . ($this->showdate && $this->showtime ? 'true' : 'false') . ",";
138+
if (USE_BOOTSTRAP_ICONS) {
139+
$script .= "
140+
icons: {
141+
time: 'bi bi-clock',
142+
date: 'bi bi-calendar3',
143+
up: 'bi bi-arrow-up',
144+
down: 'bi bi-arrow-down',
145+
previous: 'bi bi-chevron-left',
146+
next: 'bi bi-chevron-right',
147+
today: 'bi bi-calendar-check',
148+
clear: 'bi bi-trash',
149+
close: 'bi bi-x',
150+
},";
151+
}
152+
$script .= "
138153
}
139154
});
140-
141-
if (" . (USE_BOOTSTRAP_ICONS ? '1' : '0') . ") {
142-
tclock.updateOptions({
143-
display: {
144-
icons: {
145-
time: 'bi bi-clock',
146-
date: 'bi bi-calendar3',
147-
up: 'bi bi-arrow-up',
148-
down: 'bi bi-arrow-down',
149-
previous: 'bi bi-chevron-left',
150-
next: 'bi bi-chevron-right',
151-
today: 'bi bi-calendar-check',
152-
clear: 'bi bi-trash',
153-
close: 'bi bi-x',
154-
},
155-
}
156-
});
157-
}
158-
});
159-
";
155+
});";
160156

161157
global $less_vars;
162158

0 commit comments

Comments
 (0)