eonasdan-datetimepicker

How to restrict user to input data using datetimepicker and disable manual user input?

廉价感情. 提交于 2019-12-02 06:17:37
问题 I want to restrict the user to only input data using the datetimepicker. Below is the code I am using: <div class="form-group"> <label>Start</label> <div class="input-group date" id="dtp1"> <input type="text" id="txtStart" class="form-control" readonly="readonly"/> <span class="input-group-addon"> <span class="glyphicon glyphicon-calendar"></span> </span> </div> </div> $('#dtp1').datetimepicker({ format: 'DD/MM/YYYY HH:mm A', daysOfWeekDisabled: [0, 6] }); I have tried using the readonly

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

為{幸葍}努か 提交于 2019-12-02 04:19:58
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 you could use: $('#datetimepicker').data("DateTimePicker").format('HH:mm:ss'); Both of these work as we

Datetimepicker - allow choosing on disable dates

时光怂恿深爱的人放手 提交于 2019-12-02 01:36:55
I know that sound crasy but I need to allow choosing disable dates here: https://eonasdan.github.io/bootstrap-datetimepicker/ Why? I need to color dates with less possibility to booking, and color green dates where possibility to book is bigger so I write: <script> $(function () { $('#start').datetimepicker({ format: 'YYYY/MM/DD', enabledDates: [ moment("05/21/2016"), moment("05/22/2016"), moment("05/23/2016"), moment("05/24/2016"), ], }); }); </script> <style type="text/css"> .bootstrap-datetimepicker-widget table th.disabled, .bootstrap-datetimepicker-widget table th.disabled:hover {

Add custom text to the output text field in bootstrap datetimepicker

点点圈 提交于 2019-11-29 15:56:21
I'm using bootstrap 3 date/time picker here: https://eonasdan.github.io/bootstrap-datetimepicker/ Is it possible to customise the output text in the date/time text field? I wish to add a string at the start, such as ' Departure: '. My current set up is very simple, the javascript is simply: $('#datetimepicker').datetimepicker({defaultDate:'now',ignoreReadonly: true }); $('#datetimepicker').data("DateTimePicker").format('DD/MM/YYYY HH:mm:ss'); The HTML is: <div class="form-group" style = "margin-bottom:4px;"> <div class='input-group date' id='datetimepicker'> <input type='text' class="form

How to add close text to datetimepicker bootstrap?

谁说胖子不能爱 提交于 2019-11-28 14:17:12
$(function() { $('input.month-mode').datetimepicker({ viewMode: 'months', format: 'MM/YYYY', showClose: true, maxDate: current_month, }); }); I want to add close text to it. by default it shows 'X', but I want to change it. Is it possible? You can use icons option to define a custom css class for your icon and then you can write a css rule to customize close text as shown below: $(function () { var current_month = moment(); // just a sample value $('#datetimepicker1').datetimepicker({ showClose: true, viewMode: 'months', format: 'MM/YYYY', maxDate: current_month, icons: { close: 'closeText' }

Add custom text to the output text field in bootstrap datetimepicker

点点圈 提交于 2019-11-28 10:04:14
问题 I'm using bootstrap 3 date/time picker here: https://eonasdan.github.io/bootstrap-datetimepicker/ Is it possible to customise the output text in the date/time text field? I wish to add a string at the start, such as ' Departure: '. My current set up is very simple, the javascript is simply: $('#datetimepicker').datetimepicker({defaultDate:'now',ignoreReadonly: true }); $('#datetimepicker').data("DateTimePicker").format('DD/MM/YYYY HH:mm:ss'); The HTML is: <div class="form-group" style =

How to add close text to datetimepicker bootstrap?

点点圈 提交于 2019-11-27 08:06:18
问题 $(function() { $('input.month-mode').datetimepicker({ viewMode: 'months', format: 'MM/YYYY', showClose: true, maxDate: current_month, }); }); I want to add close text to it. by default it shows 'X', but I want to change it. Is it possible? 回答1: You can use icons option to define a custom css class for your icon and then you can write a css rule to customize close text as shown below: $(function () { var current_month = moment(); // just a sample value $('#datetimepicker1').datetimepicker({

Bootstrap 3 Datetimepicker 3.0.0 - make a week start on Monday

霸气de小男生 提交于 2019-11-26 23:28:10
问题 There are few reasons I use Bootstrap 3 Datetimepicker 3.0.0 in my MVC 5 project. Any idea how to offset week start so it starts from Monday? Language tag also not working. $(function () { $('#PickupTime').datetimepicker({ weekStart: 1 }); }); This is not working because it is not the same bootstrap-datapicker.js 回答1: If you are using moment.js from v2.8.1 onwards, add the below code before calling datetimepicker(). moment.updateLocale('en', { week: { dow: 1 } // Monday is the first day of