meteor bootstrap3 datetimepicker disable days of week not working - javascript

I'm using bootstrap 3 in a meteor project and would like to disable most of the days of the week in a datetime picker.
The other options I set seem to be working, but daysOfWeekDisabled won't disable any days.
I found this answer here Limit bootstrap-datepicker to weekdays only? that suggests it should work (and it does in the twiddle) but I can't get my code to work.
The options I'm setting are
Template.requestLayout.rendered = function(){
$('.datetimepicker').datetimepicker({
pickTime: false,
startDate: moment().day(12),
defaultDate: moment().day(12),
daysOfWeekDisabled: [0,1,2,3,6],
autoclose: true
});
}
Any ideas why it might not be working?

try changing to this
daysOfWeekDisabled: "0,1,2,3,6"

Related

bootstrap date picker - changing via javascript not syncing with Calender

I have a element I'm using as a datepicker:
I set it up using the following script:
$('#fltProdFromQuo').datepicker({
format: "dd M yyyy",
todayBtn: "linked",
autoclose: true,
todayHighlight: true
});
And set the value to 1st June 2020:
$('#fltProdFromQuo').val('2020-06-01') ;
WHich seems to work until I click the field, and the calander shows todays date:
Does anyone have any idea what I've missed to make the calendar show the correct date?
Thank you in advance of any help given.
Found the answer. I didn't know that once I set the date I had to "Update" it to change the calender, never had to do this before:
$('#fltProdFromQuo').val('2020-06-01') ;
$('#fltProdFromQuo').datepicker('update');
Working tickety boo now!

bootstrap 3 datetimepicker custom year

I need a calendar popup for my project and I just want to show years just like this. (2000 - 2009)
I found this library Bootstrap 3 Datepicker and it seems easy. Then I've configured it to show years. Worked fine.
But I want to show 2000-2009 range in dropdown. That's the problem. I used "viewMode" option to show years. But I couldn't find anywhere to show custom year range. Here is my js code. And here is jsfiddle for live example. Any solution?
$(function () {
$('#datetimepicker10').datetimepicker({
viewMode: 'years',
format: 'L'
});
});
$('#datetimepicker10').datetimepicker({
viewMode: 'years',
defaultDate : '2005-01-01',
format: 'L'
});
set
defaultDate : '2005-01-01'
jsfiddle

Bootstrap datepicker, disable dates - view only mode possible?

I'm loading a selection of dates into bootstrap datepicker for the user to view. Currently they can click on a highlighted date but it clears all the dates that are preloaded.
I don't want them to be able to click on any dates, just view the different month pages of dates. How can I do this?
this is how I setup datepicker and load the dates;
$('.datepickera').datepicker({
format: 'yyyy/mm/dd',
multidate: false
});
$.extend($.datepicker,{_checkOffset:function(inst,offset,isFixed){return offset}});
$(".datepickera").data("datepicker").setDates($('#mydates').data('dates'));
If I understand you correctly you can make the datepicker unselectable by using the daysOfWeekDisable property like this:
$('.datepicker').datepicker({
daysOfWeekDisabled: [0,1,2,3,4,5,6]
});
0 is Sunday and 6 is Saturday. This way a user cannot select any day but can view the entire calendar. You can read more about it here. Hope that helps.

Customize the jquery Datepicker

i am using jqueryDate picker.i want to customize this Datepicker.In this Datepicker Month and year is showing.Like August2014.Here if i click next it will go to next month like previous.
But I want to customize,mean i want to show months in dropdown and Year also i have to show in Dropdown,amd Next and previous function should be work.Can You Please suggest Me.
What plugin are you trying to use. If it is this plugin found in this site. then all you need to do is set the change month and changeyear to true.
$(function() {
$("YOURSELECTOR" ).datepicker({
changeMonth: true,
changeYear: true
});
});
the documentation for the api can be found here.

How to display hours in JQuery datapicker

I want to use simple JQuery datapicker but not only to select the date. I want to add hours to the date format but I also want to preserver the classic vie of the calendar. I just want to add hours as extra functionality to define precisely the time. Is this possible?
<script type="text/javascript">
//For calendar
$(".datepicker").datepicker({
inline: true,
showWeek: true,
firstDay: 1,
dateFormat: 'yyyy-mm-dd HH:MM:ss',
});
</script>
http://trentrichardson.com/examples/timepicker/
you can try the above plugin with the combination of datepicker
you can even use the default $('.datepicker').datetimepicker();
jQuery UI's datepicker picks dates, not times. You can add a distinct field for the hours, e.g. a select field.

Categories

Resources