Skip to content

Commit c44b959

Browse files
cconard96trasher
authored andcommitted
fix planning specify end date
1 parent 33708ae commit c44b959

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

templates/pages/assistance/planning/add_classic_event.html.twig

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@
7171
max: 50 * constant('HOUR_TIMESTAMP'),
7272
value: default_delay,
7373
emptylabel: display_dates ? __('Specify an end date') : constant('Dropdown::EMPTY_VALUE'),
74+
rand: rand,
7475
}]) %}
7576
{% else %}
7677
{{ fields.hiddenField('plan[_duration]', default_delay) }}
@@ -93,15 +94,15 @@
9394
</script>
9495
{% endif %}
9596
<script>
96-
{% set event_params = {
97-
duration: '__VALUE__',
98-
end: end,
99-
name: 'plan[end]',
100-
global_begin: config('planning_begin'),
101-
global_end: config('planning_end'),
102-
} %}
103-
$('#dropdown_plan[_duration]{{ rand }}').on('change', () => {
104-
$('#date_end{{ rand }}').load('{{ path('ajax/planningend.php')|e('js') }}', {{ event_params|json_encode|raw }});
97+
$('#dropdown_plan__duration_{{ rand }}').on('change', () => {
98+
const event_params = {
99+
duration: $('#dropdown_plan__duration_{{ rand }}').val(),
100+
end: '{{ end|e('js') }}',
101+
name: 'plan[end]',
102+
global_begin: '{{ config('planning_begin')|e('js') }}',
103+
global_end: '{{ config('planning_end')|e('js') }}',
104+
};
105+
$('#date_end{{ rand }}').load('{{ path('ajax/planningend.php')|e('js') }}', event_params);
105106
});
106107
</script>
107108
{% endif %}

0 commit comments

Comments
 (0)