Skip to content

Picker always sets field to current date/time, whatever is selected #55

@francisjervis

Description

@francisjervis

Hi, I am having this issue with the picker: it displays correctly, but the first time you click on a day, the current date and time appear in the field, instead of the selected value. After this, the field value cannot be changed, no date other than the current one can ever be entered. However, the selection indicator in the picker does change based on clicks. My code in forms.py is:

    select_start_date = forms.DateTimeField(label="Select the start date and time for your request",
        required=True,
        widget=DateTimePicker(options={"format": "YYYY-MM-DD HH:mm",
                                      "pickSeconds": False})
                                       )

And in the html template file the form renders to:

   <script type="text/javascript">
    $(function () {
        $('#id_select_start_date').datetimepicker();
    });
    </script>

Thanks for any help!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions