Hide Bootstrap Datepicker after changing month - twitter-bootstrap-3

I am trying to hide datepicker after changing month. For that I tried this code :
$("#datepicker").datepicker({
viewMode: 'months',
format: 'mm-yyyy'
}).on('changeMonth', function (e){
$(this).datepicker('hide');
});
But it's not working, please help.

Try this,
$('#datepicker').datepicker({
startView: 'months',
minViewMode: 'months',
format: 'mm-yyyy'
}).on('changeMonth', function(e) {
$(this).datepicker('hide');
});
Thanks!

Related

How to fix date issue with momentjs and vuejs-datepicker

I am using vuejs-datepicker and I set datepicker (calendar) to today date by default like this:
<datepicker v-model="theDate" format="yyyy-MM-dd"></datepicker>
<!--shows yesterday date in calendar instead of today. "format" needed to get right format.-->
...
data() {
return {
myDate: null
}
},
...
created() {
this.myDate = this.$moment().format("YYYY-MM-DD")
console.log(this.myDate) //gives me today date in right format but no shows the same
}
...
This must be very basic and simple thing. But I don't really get why it is showing yesterday date and how to fix it.
Update: this describes my issue: https://github.com/charliekassel/vuejs-datepicker/issues/23
Finally, I found one solution here https://github.com/charliekassel/vuejs-datepicker/issues/158.

How I can use bootstrap datepicker with year and month drop down option, as well as with the min date and max date

I need a bootstrap datepicker where the start date and enddate must be customizable like start date is 01-01-1950 and end date is todate-18 years. Secondly wanted to show the dropdown year and month on the calendar topbar to use easily rather than the default bootstrap calendar.
For your reference have attached an image which 'm using now without bootstrap.
Any idea/link is appreciated.
you can not put dropdown but can achieve same functionality by another way with new bootstrap version.
check out this link http://www.malot.fr/bootstrap-datetimepicker/
<script>
$(document).ready(function() {
$('#date_deb').daterangepicker({locale: {format: 'DD/MM/YYYY'},
showDropdowns: true,
minDate: '01/01/2016',
singleDatePicker: true,
singleClasses: "picker_2"
}, function(start, end, label) {
console.log(start.toISOString(), end.toISOString(), label);
});
});
</script>

Bootstrap time picker issue

I am using Bootstrap time Picker control and store data in DB in string format like 6:30 PM. Now I have an issue when I edit the form and put that value in Bootstrap time Picker control, I got an issue, Any one can help in this regard.
String format is ="6:30 PM" and want to set that string in Bootstrap time Picker control.
EDIT:
I am filling in below format.
blockHoursDetail.FillBlockHours(blockHoursDetail.params.BlockHoursId).done(function (response) {
if (response.status != false) {
var blockHours_detail = JSON.parse(response.BlockHoursFill_JSON);
var self = $("#blockHoursDetail");
utility.bindMyJSON(true, blockHours_detail, false, self);
if (blockHours_detail.chkActive == 'True')
$("#blockHoursDetail #chkActive").attr("checked", true);
else
$("#blockHoursDetail #chkActive").attr("checked", false);
blockHoursDetail.ValidateBlockHours();
$('#frmBlockHoursDetail').data('serialize', $('#frmBlockHoursDetail').serialize());
}
else {
utility.DisplayMessages(response.Message, 3);
}
});
When you return data from the db you should show it like that.
<?php echo date("h:i A",strtotime($time_from_db)); ?>
and if you are facing some problem in initializing of time picker the the specific format then you can use this
$('.timepicker').timepicker('setTime', "6:30 PM");
hope it will help you

Kendo Grid inline edit with Datetime DatePickerFor

kendo inline cell edit not support for datetime format. I need "dd/MMM/yyyy" data format but kendo grid shows "the filed date must be a date" error. can you please advice me to what to do
You can use a custom editor to do this.
References:
Grid Custom Editing
DatePicker.format
Date Formatting
The code would look something like this (not tested, but it should be close enough to give you the right idea):
var customDateEditor = function (container, options) {
$('<input />')
.appendTo(container)
.kendoDatePicker({
format: "dd/MMM/yyyy"
});
};
$("#grid").kendoGrid({
...
columns:[
{
field: "myDate",
format: "dd/MMM/yyyy",
editor: customDateEditor
}
]
});

xhr.upload.addEventListener "loadend" is not working in safari

xhr.upload.addEventListener('loadend', function(e) {
});
I use this when the upload is complete I want to do some operatiojn but it is not fire in safari. any help please.
try to set it as a function like this:
upload.onloadend = function(){
}