Skip to content

Flatpickr start time picker ignores "Step for the hours" setting (regression from 10.x) #23766

@b-o-r-i-s975

Description

@b-o-r-i-s975

Code of Conduct

  • I agree to follow this project's Code of Conduct

Disable plugins

  • I reproduce the issue with all plugins disabled

Is there an existing issue for this?

  • I have searched the existing issues

Version

11.0.6

Bug description

Hello GLPI team!

Bug Report

Version: 11.0.6

Bug description

When planning a task, the duration dropdown correctly uses the configured step (e.g. 30min intervals). However, the start time picker (flatpickr) always uses 5-minute steps, ignoring the "Step for the hours (in minutes)" setting (Setup → General → Assistance).

This is a regression from GLPI 10.x. In GLPI 10, Html::showDateTimeField() passed minuteIncrement to flatpickr using $CFG_GLPI['time_step'] (see src/Html.php around line 2995):

minuteIncrement: "{$p['timestep']}",

In GLPI 11, datetime rendering was migrated from PHP to the Twig date macro in templates/components/form/basic_inputs_macros.html.twig. The minuteIncrement property was not carried over, flatpickr defaults to 5.

Affected: All datetime pickers rendered via the Twig date/datetime macro (e.g. task planning start time).

Not affected: Datetime pickers still rendered via Html::showDateTimeField() in PHP (these still work correctly).

Fix

Add one line in templates/components/form/basic_inputs_macros.html.twig, in the flatpickr init block after enableSeconds:

minuteIncrement: {{ config('time_step') ?? 5 }},

The config('time_step') function is already used elsewhere in GLPI 11 Twig templates (e.g. config('use_notifications') in the same file).

Best Regards,
Boris

Relevant log output

no error logged.

Page URL

Any page with a datetime picker rendered via Twig, e.g. Ticket → Add Task → Plan this task → Start date picker.

Steps To reproduce

  1. Set Setup → General → Assistance → "Step for the hours" to 30
  2. Open a ticket, add a task, click "Plan this task"
  3. Open the start date picker and use the time arrows
  4. Expected: 30-minute increments
  5. Actual: 5-minute increments

Your GLPI setup information

No response

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions