A
A
Alexander2016-04-28 13:53:25
JavaScript
Alexander, 2016-04-28 13:53:25

How in bootstrap datetimepicker calendar to limit time picker to minutes?

Good afternoon, I use datepicker bootstrap in the project ( plugin link )

The question arose of how to implement time selection in the datepicker bootstrap calendar so that when you click on the date time, the minutes value is always equal to: 00
For example, we select May 26, 2016 in the calendar and the time is 1 a.m. . After that, the field should display the date of the following format: 2016-05-26 1:00 AM
The user can select the date and time up to a specific hour, but he is still supplied with minutes equal to 00 in the field.
Field settings:

$('#Date’).datetimepicker({ // Дата		        
        language: 'ru',    
            pickTime: true, 
            format: "YYYY-MM-DD HH:mm", 
            defaultDate: ed,       
            minDate:m.add(8,'days')
})

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim Fedorov, 2016-04-28
@inviziblll

use format: "YYYY-MM-DD HH:00"

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question