datetimepicker

jQuery datetimepicker: disable time

不想你离开。 提交于 2020-01-13 09:09:10
问题 I am using the XDSoft jQuery datetimepicker in my app (Ruby on Rails 4 (just for information, not using bootstrap datetimepicker )). I was wondering if there is a way to disable/deactivate a specific time at a specific date, for example disable only 17:00 on 12/17/2014? disabledDates: ['...'] disables a specific date. I tried disabledDateTimes and disabledTimes but they don't work. Thanks. 回答1: Here is one example of how this can be done using the XDSoft DateTimePicker you are asking about. I

DateTimePicker Default value: How to avoid it?

巧了我就是萌 提交于 2020-01-12 18:45:55
问题 Facts: I have a TabControl with 2 Tabs, Each tab has 2 DateTimePicker. In the Load event, I set the value of all the DTPs. All DTPs have ShowCheckBoxes set on true AND Checked set on false. When I Execute the program, The DTPs in first tab are OK, but when I check the DTPs on second tab, they show current time, not the time I set on the load event. Why this happen? How can I avoid it? 回答1: I found out what the problem was here. The Value property only sets a new value if the DateTimePicker

How can I set the datetimepicker dropdown to show Months only

本小妞迷上赌 提交于 2020-01-11 00:06:46
问题 So instead of this showing up on clicking the dropdown menu. I want the dropdown to be like this when clicked. Thanks a lot for any help. :) 回答1: Why you need to do this? If you want to display Months only then easier way is to have a list of months in Combox. However I found something for you on msdn. Have a look here https://social.msdn.microsoft.com/Forums/en-US/7bdca56f-719e-44bf-be6d-a9600dfa8f78/wpf-datepicker-for-months-only?forum=wpf 回答2: Try the following code: DateTime newDateValue

django jquery month picker- the “to” date not always updated as later than ”from“ date

我是研究僧i 提交于 2020-01-10 05:31:13
问题 I followed the example in this post:jquery datetime picker set minDate dynamic. I tried 2 ways: First method this method only works for FIRST TIME selecting "to" date. That's to say, after selecting once "from" and "to" date, I come back to re-select the "from“ date, then "to" date drop down list doesn't change accordingly, it remains as the 1st time I chose: $('.to').datepicker({ beforeShow: function(input, inst) { var mindate = $('.from').datepicker('getDate'); $(this).datepicker('option',

modify datetimepicker dynamically with javascript

点点圈 提交于 2020-01-07 02:51:31
问题 I am initializing a datetimepicker as $(document).ready(function() { $("#meeting_datetime").datetimepicker({format: 'LLLL', stepping: 5, enabledHours: [], daysOfWeekDisabled: []}).prop('disabled', true); }); Now I would like to enable this datetimepicker and limit the possible selection dynamically depending on user input. I call this function everytime the user changes certain other selections $("#meeting_datetime").datetimepicker({defaultDate: tomorrowsDate, format: 'LLLL', enabledHours:

C# 设置 dateTimePicker控件初始值为空(转)

人盡茶涼 提交于 2020-01-06 20:50:06
写在前面:在.net中让DateTimePicker显示一个空的时间值,也许是很容易的事情,但事实上,也不是很容易的,至少,没有经过努力的修改和重画 ,你是达不到的。在修改这个控件的时候,你又常常发现会有bug。下面介绍一个方法,至少源作者是经过研究的,没有发现多少问题。 源网址 http://www.codeproject.com/KB/selection/Nullable_DateTimePicker.aspx 你可以在上述的网址找到源代码和英文的说明。 效果图 下图中,你只要按一下Delete键就可以将DateTimePicker的值设置为空,实际的值是DateTime.MinValue,这一个简单的效果,也许是很多程序员想看到。不过学习一下这个控件。 源代码 最重要的两个重载方法是下面俩。 protected override void OnCloseUp(EventArgs eventargs) protected override void OnKeyDown(KeyEventArgs e) DateTimePicker本身是支持自定义格式的,DateTimePickerFormat.Custom,就是声明使用自定义格式的。 public new DateTime Value { get { if (bIsNull) return DateTime.MinValue;

How to create dynamic datetimepicker value?

夙愿已清 提交于 2020-01-06 05:44:07
问题 My HTML code like this: $(function () { $('#datetimepicker').datetimepicker({ minDate: moment().startOf('minute').add(300, 'm'), }); $("#btnSubmit").click(function() { value = document.getElementById('datetimepicker').value; console.log(value) }); }); <script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.13.0/moment.js"></script> <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js

Bootstrap datetimepicker add 1 day to mindate

孤街醉人 提交于 2020-01-06 05:30:30
问题 I'm using bootstrap datetimepicker, how do I add one day in datetimepicker bootstrap minDate ? I want to filter the minDate for more 1 day. For example my checkIn datetimepicker is 02/16/18 then the the date to 02/16/18 is disabled in checkOut datetimepicker. <script> $(function () { $('#CheckIn').datetimepicker({ format: 'MM/DD/YYYY' }); $('#CheckOut').datetimepicker({ useCurrent: false,//Important! See issue #1075 format: 'MM/DD/YYYY' }); $("#CheckIn").on("dp.change", function (e) { $('

Bootstrap datetimepicker add 1 day to mindate

时间秒杀一切 提交于 2020-01-06 05:30:29
问题 I'm using bootstrap datetimepicker, how do I add one day in datetimepicker bootstrap minDate ? I want to filter the minDate for more 1 day. For example my checkIn datetimepicker is 02/16/18 then the the date to 02/16/18 is disabled in checkOut datetimepicker. <script> $(function () { $('#CheckIn').datetimepicker({ format: 'MM/DD/YYYY' }); $('#CheckOut').datetimepicker({ useCurrent: false,//Important! See issue #1075 format: 'MM/DD/YYYY' }); $("#CheckIn").on("dp.change", function (e) { $('

Display multiple dates on calendar

时间秒杀一切 提交于 2020-01-06 05:25:30
问题 I'm implementing an android app. In which, I have to display some available(getting from the web service) date slots on calendar and available date slots color will be different and seleted date slot color will be different and if user click on one of the given date so the selected date color will be change. I'm not getting how to do that without third party libraries. I can't use third party libraries. I have used DatePickerDialog but using this I'm able to select any date. I'm unable to