eonasdan-datetimepicker

datetimepicker erasing value from input if value exists at page load

∥☆過路亽.° 提交于 2019-12-10 03:30:25
问题 I'm using this datetime picker for Bootstrap 4 https://tempusdominus.github.io/bootstrap-4/ The plugin works just fine if the input is blank at load. However, I have an Edit form that has already a value but the datepicker is removing the value at page load. <div class="container"> <div class="row"> <div class='col-sm-6'> <div class="form-group"> <input class="form-control datetimepicker-input" data-target="#Entry_EntryDate" data-toggle="datetimepicker" data-val="true" data-val-date="The

How to add seconds to Bootstrap date time picker

◇◆丶佛笑我妖孽 提交于 2019-12-07 07:03:20
问题 I am using the Bootstrap datatimepicker (https://eonasdan.github.io/bootstrap-datetimepicker/). It's great but it does not show or let the user select seconds . $(document).ready(function () { $('#datetimepicker1').datetimepicker({defaultDate: new Date()}); }); <div class='input-group date' id='datetimepicker1'> <input type='text' class="form-control" /> <span class="input-group-addon"> <span class="glyphicon glyphicon-calendar"></span> </span> </div> So how to select seconds as well? And how

Bootstrap DatePicker - Onchange

青春壹個敷衍的年華 提交于 2019-12-06 02:06:14
问题 I am using the Bootstrap 3 Datepicker plugin. When the user chooses a date, I want to update various parts of my UI. I'm basically trying to create a function that is called when the date changes. However, I've been unsuccessful in my attempts. Currently, I'm trying the following $('#myDatePicker').datetimepicker({ change: function() { alert('date has changed!'); } }); Unfortunately, the change function never fires. How do I call a function when the date is changed in the date picker? 回答1:

datetimepicker erasing value from input if value exists at page load

▼魔方 西西 提交于 2019-12-05 03:47:31
I'm using this datetime picker for Bootstrap 4 https://tempusdominus.github.io/bootstrap-4/ The plugin works just fine if the input is blank at load. However, I have an Edit form that has already a value but the datepicker is removing the value at page load. <div class="container"> <div class="row"> <div class='col-sm-6'> <div class="form-group"> <input class="form-control datetimepicker-input" data-target="#Entry_EntryDate" data-toggle="datetimepicker" data-val="true" data-val-date="The field Event Date must be a date." data-val-required="The Event Date field is required." id="Entry_EntryDate

Bootstrap datetimepicker only month and year not working as intended

穿精又带淫゛_ 提交于 2019-12-04 01:57:59
问题 My Datetime picker works on the fist click, but if I click again in the input field again it shows the picker with the day field. How can I do this? Any help will be appreciated. This is the image in first click (expected behavior) This is the image in second click (expected behavior is to come like to the first one) My code is below HTML <div class='input-group' id='dpRM'> <input type='text' class="form-control form-control-1 form-input input-sm fromq" placeholder="Enter Month and year" />

How to disable past dates from today in bootstrap datetimepicker? [duplicate]

为君一笑 提交于 2019-12-03 14:56:50
问题 This question already has answers here : Bootstrap datetimepicker startDate does not disable past dates (3 answers) Closed 4 years ago . Unable to disable the past dates in bootstrap datetimepicker HTML <br/> <div class="row"> <div class="col-md-12"> <h6>Datetimepicker</h6> <div class="form-group"> <div class="input-group date" id="datetimepicker"> <input type="text" class="form-control" /> <span class="input-group-addon"><span class="glyphicon-calendar glyphicon"></span></span> </div> </div>

How to disable past dates from today in bootstrap datetimepicker? [duplicate]

99封情书 提交于 2019-12-03 04:39:15
This question already has answers here : Bootstrap datetimepicker startDate does not disable past dates (3 answers) Unable to disable the past dates in bootstrap datetimepicker HTML <br/> <div class="row"> <div class="col-md-12"> <h6>Datetimepicker</h6> <div class="form-group"> <div class="input-group date" id="datetimepicker"> <input type="text" class="form-control" /> <span class="input-group-addon"><span class="glyphicon-calendar glyphicon"></span></span> </div> </div> </div> </div> JavaScript $(function () { $('#datetimepicker').datetimepicker(); }); I also used startDate atrribute.But no

Disabling Prior Dates But Leaving Field Blank?

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-02 15:15:44
问题 I am setting minDate: 'now'; in order to prevent picking dates prior to the current date. However, this populates the field with the current date. Not necessarily a big deal, however, if I am performing validation on the field (i.e., that it is populated), then the user can still submit even though not having picked a date. Any way around this? EDIT: Sorry, but it appears that using daysOfWeekDisabled shows the current date. Still not sure what to do. 回答1: Your problem is similar to the one

Disabling Prior Dates But Leaving Field Blank?

亡梦爱人 提交于 2019-12-02 09:47:31
I am setting minDate: 'now'; in order to prevent picking dates prior to the current date. However, this populates the field with the current date. Not necessarily a big deal, however, if I am performing validation on the field (i.e., that it is populated), then the user can still submit even though not having picked a date. Any way around this? EDIT: Sorry, but it appears that using daysOfWeekDisabled shows the current date. Still not sure what to do. Your problem is similar to the one described here: issue #1289 . To solve it just set useCurrent to false . Here a working example: $("

How to have just the time picker in a bootstrap 3 date/time picker widget with an added string in format

巧了我就是萌 提交于 2019-12-02 08:39:45
问题 My question refers to the following bootstrap 3 date time picker: https://eonasdan.github.io/bootstrap-datetimepicker/ I have a bootstrap 3 date and time picker widget on a website, but would actually like it to be just a time picker. This is normally trivial to achieve, and can be done using the format parameter as follows: $('#datetimepicker').datetimepicker({defaultDate:'now',ignoreReadonly: true}); $('#datetimepicker').data("DateTimePicker").format('LT'); Note the LT for local time, or