How to detect selecting the date in daterangepicker
I am using daterangepicker with time. I have from and to date with time in the picker with options of choosing last 1 days, 7 days, 30 days and custom range. If I choose custom range , if the end date is today, time should be current time. Else i need to set the time to 11.59 pm . I am using moment and i am not able to find any onselect event for daterange picker. Nothing works when date is changed
(document).ready(function () {
var date = new Date();
var currentMonth = date.getMonth();
var currentDate = date.getDate();
var currentYear = date.getFullYear();
if ((window.location.href).indexOf('fraud_search') > -1) {
var start_date = $('#fraud_start_date_utc');
var end_date = $('#fraud_end_date_utc');
var date_display_span = $('#fd_date_range span');
var start_date_value = moment(start_date.val(), FRAUD_API_DATE_FORMAT).startOf('day');
var end_date_value;
function compare(dateTimeA, dateTimeB) {
var momentA = moment(dateTimeA,FRAUD_API_DATE_FORMAT);
var momentB = moment(dateTimeB,FRAUD_API_DATE_FORMAT);
if (momentA > momentB) return 1;
else if (momentA < momentB) return -1;
else return 0;
}
var comparedTime = compare(moment(end_date.val(), FRAUD_API_DATE_FORMAT), moment(FRAUD_API_DATE_FORMAT).utc());
console.log(comparedTime);
if(comparedTime != 0) {
end_date_value = moment(end_date.val(), FRAUD_API_DATE_FORMAT).endOf('day').hour(23).minute(59);
alert("alidsg");
}
else {
end_date_value = moment(end_date.val(), FRAUD_API_DATE_FORMAT);
alert("same day");
}
function cb(start, end) {
date_display_span.html(start.format(FRAUD_DASHBOARD_DATE_DISPLAY_FORMAT) + ' - ' + end.format(FRAUD_DASHBOARD_DATE_DISPLAY_FORMAT));
start_date.val(start.format(FRAUD_API_DATE_FORMAT));
end_date.val(end.format(FRAUD_API_DATE_FORMAT));
alert("A new date range was chosen: " + start.format(FRAUD_API_DATE_FORMAT) + ' to ' + end.format(FRAUD_API_DATE_FORMAT));
$('#fraud_search_crit_form').submit();
}
$('#fd_date_range').daterangepicker({
applyClass: "btn-primary",
startDate: start_date_value,
endDate: end_date_value,
maxDate: moment().utc(),
minDate: moment().subtract(fraud_search_max_from_date_time_gap, "days"),
dateLimit: {
"days": fraud_search_max_time_gap
},
timePicker: true,
timePicker24Hour: false,
locale: {
format: 'MM/DD/YYYY H:mm'
},
autoApply: true,
ranges: {
'Today': [moment.utc().startOf('day'), moment.utc()],
'Last 1 Day': [moment.utc().subtract(1, 'days').startOf('day'), moment.utc().endOf('day').hour(23).minute(59)],
'Last 7 Days': [moment.utc().subtract(6, 'days').startOf('day'), moment.utc().endOf('day').hour(23).minute(59)],
'Last 30 Days': [moment.utc().subtract(29, 'days').startOf('day'), moment.utc().endOf('day').hour(23).minute(59)]
},
onChange: function(dateText, inst) {
alert("alert");
}
}, cb).on("change", function() {
alert("function called");
display("Change event");
});
HTML
<div class="col-sm-3">
<div class="filter-form__field form-group" id="fd_range_picker">
<label class="control-label" for="timePeriod">Time Period</label>
<div class="form-group">
<%= content_tag(:div, content_tag(:span, '', id: "fd_range",) + content_tag(:b, '', class: 'caret'), class: "selectbox pull-left", id: 'fd_date_range') %>
<%= hidden_field_tag :fraud_start_date_utc, params[:fraud_start_date_utc] %>
<%= hidden_field_tag :fraud_end_date_utc, params[:fraud_end_date_utc] %>
<%= hidden_field_tag :per_page, params[:per_page] %>
</div>
</div>
</div>
javascript jquery momentjs daterangepicker
add a comment |
I am using daterangepicker with time. I have from and to date with time in the picker with options of choosing last 1 days, 7 days, 30 days and custom range. If I choose custom range , if the end date is today, time should be current time. Else i need to set the time to 11.59 pm . I am using moment and i am not able to find any onselect event for daterange picker. Nothing works when date is changed
(document).ready(function () {
var date = new Date();
var currentMonth = date.getMonth();
var currentDate = date.getDate();
var currentYear = date.getFullYear();
if ((window.location.href).indexOf('fraud_search') > -1) {
var start_date = $('#fraud_start_date_utc');
var end_date = $('#fraud_end_date_utc');
var date_display_span = $('#fd_date_range span');
var start_date_value = moment(start_date.val(), FRAUD_API_DATE_FORMAT).startOf('day');
var end_date_value;
function compare(dateTimeA, dateTimeB) {
var momentA = moment(dateTimeA,FRAUD_API_DATE_FORMAT);
var momentB = moment(dateTimeB,FRAUD_API_DATE_FORMAT);
if (momentA > momentB) return 1;
else if (momentA < momentB) return -1;
else return 0;
}
var comparedTime = compare(moment(end_date.val(), FRAUD_API_DATE_FORMAT), moment(FRAUD_API_DATE_FORMAT).utc());
console.log(comparedTime);
if(comparedTime != 0) {
end_date_value = moment(end_date.val(), FRAUD_API_DATE_FORMAT).endOf('day').hour(23).minute(59);
alert("alidsg");
}
else {
end_date_value = moment(end_date.val(), FRAUD_API_DATE_FORMAT);
alert("same day");
}
function cb(start, end) {
date_display_span.html(start.format(FRAUD_DASHBOARD_DATE_DISPLAY_FORMAT) + ' - ' + end.format(FRAUD_DASHBOARD_DATE_DISPLAY_FORMAT));
start_date.val(start.format(FRAUD_API_DATE_FORMAT));
end_date.val(end.format(FRAUD_API_DATE_FORMAT));
alert("A new date range was chosen: " + start.format(FRAUD_API_DATE_FORMAT) + ' to ' + end.format(FRAUD_API_DATE_FORMAT));
$('#fraud_search_crit_form').submit();
}
$('#fd_date_range').daterangepicker({
applyClass: "btn-primary",
startDate: start_date_value,
endDate: end_date_value,
maxDate: moment().utc(),
minDate: moment().subtract(fraud_search_max_from_date_time_gap, "days"),
dateLimit: {
"days": fraud_search_max_time_gap
},
timePicker: true,
timePicker24Hour: false,
locale: {
format: 'MM/DD/YYYY H:mm'
},
autoApply: true,
ranges: {
'Today': [moment.utc().startOf('day'), moment.utc()],
'Last 1 Day': [moment.utc().subtract(1, 'days').startOf('day'), moment.utc().endOf('day').hour(23).minute(59)],
'Last 7 Days': [moment.utc().subtract(6, 'days').startOf('day'), moment.utc().endOf('day').hour(23).minute(59)],
'Last 30 Days': [moment.utc().subtract(29, 'days').startOf('day'), moment.utc().endOf('day').hour(23).minute(59)]
},
onChange: function(dateText, inst) {
alert("alert");
}
}, cb).on("change", function() {
alert("function called");
display("Change event");
});
HTML
<div class="col-sm-3">
<div class="filter-form__field form-group" id="fd_range_picker">
<label class="control-label" for="timePeriod">Time Period</label>
<div class="form-group">
<%= content_tag(:div, content_tag(:span, '', id: "fd_range",) + content_tag(:b, '', class: 'caret'), class: "selectbox pull-left", id: 'fd_date_range') %>
<%= hidden_field_tag :fraud_start_date_utc, params[:fraud_start_date_utc] %>
<%= hidden_field_tag :fraud_end_date_utc, params[:fraud_end_date_utc] %>
<%= hidden_field_tag :per_page, params[:per_page] %>
</div>
</div>
</div>
javascript jquery momentjs daterangepicker
Can you show the html of$('#fd_date_range')
as well?
– Honkalonkalooooohhh
Nov 21 '18 at 11:21
Updated the html
– Alia Tabassum
Nov 21 '18 at 12:18
add a comment |
I am using daterangepicker with time. I have from and to date with time in the picker with options of choosing last 1 days, 7 days, 30 days and custom range. If I choose custom range , if the end date is today, time should be current time. Else i need to set the time to 11.59 pm . I am using moment and i am not able to find any onselect event for daterange picker. Nothing works when date is changed
(document).ready(function () {
var date = new Date();
var currentMonth = date.getMonth();
var currentDate = date.getDate();
var currentYear = date.getFullYear();
if ((window.location.href).indexOf('fraud_search') > -1) {
var start_date = $('#fraud_start_date_utc');
var end_date = $('#fraud_end_date_utc');
var date_display_span = $('#fd_date_range span');
var start_date_value = moment(start_date.val(), FRAUD_API_DATE_FORMAT).startOf('day');
var end_date_value;
function compare(dateTimeA, dateTimeB) {
var momentA = moment(dateTimeA,FRAUD_API_DATE_FORMAT);
var momentB = moment(dateTimeB,FRAUD_API_DATE_FORMAT);
if (momentA > momentB) return 1;
else if (momentA < momentB) return -1;
else return 0;
}
var comparedTime = compare(moment(end_date.val(), FRAUD_API_DATE_FORMAT), moment(FRAUD_API_DATE_FORMAT).utc());
console.log(comparedTime);
if(comparedTime != 0) {
end_date_value = moment(end_date.val(), FRAUD_API_DATE_FORMAT).endOf('day').hour(23).minute(59);
alert("alidsg");
}
else {
end_date_value = moment(end_date.val(), FRAUD_API_DATE_FORMAT);
alert("same day");
}
function cb(start, end) {
date_display_span.html(start.format(FRAUD_DASHBOARD_DATE_DISPLAY_FORMAT) + ' - ' + end.format(FRAUD_DASHBOARD_DATE_DISPLAY_FORMAT));
start_date.val(start.format(FRAUD_API_DATE_FORMAT));
end_date.val(end.format(FRAUD_API_DATE_FORMAT));
alert("A new date range was chosen: " + start.format(FRAUD_API_DATE_FORMAT) + ' to ' + end.format(FRAUD_API_DATE_FORMAT));
$('#fraud_search_crit_form').submit();
}
$('#fd_date_range').daterangepicker({
applyClass: "btn-primary",
startDate: start_date_value,
endDate: end_date_value,
maxDate: moment().utc(),
minDate: moment().subtract(fraud_search_max_from_date_time_gap, "days"),
dateLimit: {
"days": fraud_search_max_time_gap
},
timePicker: true,
timePicker24Hour: false,
locale: {
format: 'MM/DD/YYYY H:mm'
},
autoApply: true,
ranges: {
'Today': [moment.utc().startOf('day'), moment.utc()],
'Last 1 Day': [moment.utc().subtract(1, 'days').startOf('day'), moment.utc().endOf('day').hour(23).minute(59)],
'Last 7 Days': [moment.utc().subtract(6, 'days').startOf('day'), moment.utc().endOf('day').hour(23).minute(59)],
'Last 30 Days': [moment.utc().subtract(29, 'days').startOf('day'), moment.utc().endOf('day').hour(23).minute(59)]
},
onChange: function(dateText, inst) {
alert("alert");
}
}, cb).on("change", function() {
alert("function called");
display("Change event");
});
HTML
<div class="col-sm-3">
<div class="filter-form__field form-group" id="fd_range_picker">
<label class="control-label" for="timePeriod">Time Period</label>
<div class="form-group">
<%= content_tag(:div, content_tag(:span, '', id: "fd_range",) + content_tag(:b, '', class: 'caret'), class: "selectbox pull-left", id: 'fd_date_range') %>
<%= hidden_field_tag :fraud_start_date_utc, params[:fraud_start_date_utc] %>
<%= hidden_field_tag :fraud_end_date_utc, params[:fraud_end_date_utc] %>
<%= hidden_field_tag :per_page, params[:per_page] %>
</div>
</div>
</div>
javascript jquery momentjs daterangepicker
I am using daterangepicker with time. I have from and to date with time in the picker with options of choosing last 1 days, 7 days, 30 days and custom range. If I choose custom range , if the end date is today, time should be current time. Else i need to set the time to 11.59 pm . I am using moment and i am not able to find any onselect event for daterange picker. Nothing works when date is changed
(document).ready(function () {
var date = new Date();
var currentMonth = date.getMonth();
var currentDate = date.getDate();
var currentYear = date.getFullYear();
if ((window.location.href).indexOf('fraud_search') > -1) {
var start_date = $('#fraud_start_date_utc');
var end_date = $('#fraud_end_date_utc');
var date_display_span = $('#fd_date_range span');
var start_date_value = moment(start_date.val(), FRAUD_API_DATE_FORMAT).startOf('day');
var end_date_value;
function compare(dateTimeA, dateTimeB) {
var momentA = moment(dateTimeA,FRAUD_API_DATE_FORMAT);
var momentB = moment(dateTimeB,FRAUD_API_DATE_FORMAT);
if (momentA > momentB) return 1;
else if (momentA < momentB) return -1;
else return 0;
}
var comparedTime = compare(moment(end_date.val(), FRAUD_API_DATE_FORMAT), moment(FRAUD_API_DATE_FORMAT).utc());
console.log(comparedTime);
if(comparedTime != 0) {
end_date_value = moment(end_date.val(), FRAUD_API_DATE_FORMAT).endOf('day').hour(23).minute(59);
alert("alidsg");
}
else {
end_date_value = moment(end_date.val(), FRAUD_API_DATE_FORMAT);
alert("same day");
}
function cb(start, end) {
date_display_span.html(start.format(FRAUD_DASHBOARD_DATE_DISPLAY_FORMAT) + ' - ' + end.format(FRAUD_DASHBOARD_DATE_DISPLAY_FORMAT));
start_date.val(start.format(FRAUD_API_DATE_FORMAT));
end_date.val(end.format(FRAUD_API_DATE_FORMAT));
alert("A new date range was chosen: " + start.format(FRAUD_API_DATE_FORMAT) + ' to ' + end.format(FRAUD_API_DATE_FORMAT));
$('#fraud_search_crit_form').submit();
}
$('#fd_date_range').daterangepicker({
applyClass: "btn-primary",
startDate: start_date_value,
endDate: end_date_value,
maxDate: moment().utc(),
minDate: moment().subtract(fraud_search_max_from_date_time_gap, "days"),
dateLimit: {
"days": fraud_search_max_time_gap
},
timePicker: true,
timePicker24Hour: false,
locale: {
format: 'MM/DD/YYYY H:mm'
},
autoApply: true,
ranges: {
'Today': [moment.utc().startOf('day'), moment.utc()],
'Last 1 Day': [moment.utc().subtract(1, 'days').startOf('day'), moment.utc().endOf('day').hour(23).minute(59)],
'Last 7 Days': [moment.utc().subtract(6, 'days').startOf('day'), moment.utc().endOf('day').hour(23).minute(59)],
'Last 30 Days': [moment.utc().subtract(29, 'days').startOf('day'), moment.utc().endOf('day').hour(23).minute(59)]
},
onChange: function(dateText, inst) {
alert("alert");
}
}, cb).on("change", function() {
alert("function called");
display("Change event");
});
HTML
<div class="col-sm-3">
<div class="filter-form__field form-group" id="fd_range_picker">
<label class="control-label" for="timePeriod">Time Period</label>
<div class="form-group">
<%= content_tag(:div, content_tag(:span, '', id: "fd_range",) + content_tag(:b, '', class: 'caret'), class: "selectbox pull-left", id: 'fd_date_range') %>
<%= hidden_field_tag :fraud_start_date_utc, params[:fraud_start_date_utc] %>
<%= hidden_field_tag :fraud_end_date_utc, params[:fraud_end_date_utc] %>
<%= hidden_field_tag :per_page, params[:per_page] %>
</div>
</div>
</div>
javascript jquery momentjs daterangepicker
javascript jquery momentjs daterangepicker
edited Nov 21 '18 at 12:18
asked Nov 21 '18 at 11:18
Alia Tabassum
125
125
Can you show the html of$('#fd_date_range')
as well?
– Honkalonkalooooohhh
Nov 21 '18 at 11:21
Updated the html
– Alia Tabassum
Nov 21 '18 at 12:18
add a comment |
Can you show the html of$('#fd_date_range')
as well?
– Honkalonkalooooohhh
Nov 21 '18 at 11:21
Updated the html
– Alia Tabassum
Nov 21 '18 at 12:18
Can you show the html of
$('#fd_date_range')
as well?– Honkalonkalooooohhh
Nov 21 '18 at 11:21
Can you show the html of
$('#fd_date_range')
as well?– Honkalonkalooooohhh
Nov 21 '18 at 11:21
Updated the html
– Alia Tabassum
Nov 21 '18 at 12:18
Updated the html
– Alia Tabassum
Nov 21 '18 at 12:18
add a comment |
1 Answer
1
active
oldest
votes
I think you are using this library : http://www.daterangepicker.com/#options
And in order to check the selected date please use this event :
$('#daterange').on('apply.daterangepicker', function(ev, picker) {
console.log(picker.startDate.format('YYYY-MM-DD'));
console.log(picker.endDate.format('YYYY-MM-DD'));
});
Thank You.. But, i want to set time when the user clicks on the date value in the custom range and not after applying. Is there a way to do this?
– Alia Tabassum
Nov 22 '18 at 5:12
For this you have to customize the daterangepicker.js and in this file there is function clickDate at line 1245 and in this function at the end call this this.element.trigger('dateselect.daterangepicker', this); And add the listener for dateselect same as above apply
– Eitbiz
Nov 22 '18 at 5:20
Thanks a lot.. is it possible to get the value of clicked date?
– Alia Tabassum
Nov 22 '18 at 5:34
Yes you will get two parameter ev, picker in that function and you can use the same as in above example. If okay just mark my comment useful
– Eitbiz
Nov 22 '18 at 5:35
Okay. Thank you
– Alia Tabassum
Nov 22 '18 at 5:35
|
show 2 more comments
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53410984%2fhow-to-detect-selecting-the-date-in-daterangepicker%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
I think you are using this library : http://www.daterangepicker.com/#options
And in order to check the selected date please use this event :
$('#daterange').on('apply.daterangepicker', function(ev, picker) {
console.log(picker.startDate.format('YYYY-MM-DD'));
console.log(picker.endDate.format('YYYY-MM-DD'));
});
Thank You.. But, i want to set time when the user clicks on the date value in the custom range and not after applying. Is there a way to do this?
– Alia Tabassum
Nov 22 '18 at 5:12
For this you have to customize the daterangepicker.js and in this file there is function clickDate at line 1245 and in this function at the end call this this.element.trigger('dateselect.daterangepicker', this); And add the listener for dateselect same as above apply
– Eitbiz
Nov 22 '18 at 5:20
Thanks a lot.. is it possible to get the value of clicked date?
– Alia Tabassum
Nov 22 '18 at 5:34
Yes you will get two parameter ev, picker in that function and you can use the same as in above example. If okay just mark my comment useful
– Eitbiz
Nov 22 '18 at 5:35
Okay. Thank you
– Alia Tabassum
Nov 22 '18 at 5:35
|
show 2 more comments
I think you are using this library : http://www.daterangepicker.com/#options
And in order to check the selected date please use this event :
$('#daterange').on('apply.daterangepicker', function(ev, picker) {
console.log(picker.startDate.format('YYYY-MM-DD'));
console.log(picker.endDate.format('YYYY-MM-DD'));
});
Thank You.. But, i want to set time when the user clicks on the date value in the custom range and not after applying. Is there a way to do this?
– Alia Tabassum
Nov 22 '18 at 5:12
For this you have to customize the daterangepicker.js and in this file there is function clickDate at line 1245 and in this function at the end call this this.element.trigger('dateselect.daterangepicker', this); And add the listener for dateselect same as above apply
– Eitbiz
Nov 22 '18 at 5:20
Thanks a lot.. is it possible to get the value of clicked date?
– Alia Tabassum
Nov 22 '18 at 5:34
Yes you will get two parameter ev, picker in that function and you can use the same as in above example. If okay just mark my comment useful
– Eitbiz
Nov 22 '18 at 5:35
Okay. Thank you
– Alia Tabassum
Nov 22 '18 at 5:35
|
show 2 more comments
I think you are using this library : http://www.daterangepicker.com/#options
And in order to check the selected date please use this event :
$('#daterange').on('apply.daterangepicker', function(ev, picker) {
console.log(picker.startDate.format('YYYY-MM-DD'));
console.log(picker.endDate.format('YYYY-MM-DD'));
});
I think you are using this library : http://www.daterangepicker.com/#options
And in order to check the selected date please use this event :
$('#daterange').on('apply.daterangepicker', function(ev, picker) {
console.log(picker.startDate.format('YYYY-MM-DD'));
console.log(picker.endDate.format('YYYY-MM-DD'));
});
answered Nov 21 '18 at 12:03
Eitbiz
896
896
Thank You.. But, i want to set time when the user clicks on the date value in the custom range and not after applying. Is there a way to do this?
– Alia Tabassum
Nov 22 '18 at 5:12
For this you have to customize the daterangepicker.js and in this file there is function clickDate at line 1245 and in this function at the end call this this.element.trigger('dateselect.daterangepicker', this); And add the listener for dateselect same as above apply
– Eitbiz
Nov 22 '18 at 5:20
Thanks a lot.. is it possible to get the value of clicked date?
– Alia Tabassum
Nov 22 '18 at 5:34
Yes you will get two parameter ev, picker in that function and you can use the same as in above example. If okay just mark my comment useful
– Eitbiz
Nov 22 '18 at 5:35
Okay. Thank you
– Alia Tabassum
Nov 22 '18 at 5:35
|
show 2 more comments
Thank You.. But, i want to set time when the user clicks on the date value in the custom range and not after applying. Is there a way to do this?
– Alia Tabassum
Nov 22 '18 at 5:12
For this you have to customize the daterangepicker.js and in this file there is function clickDate at line 1245 and in this function at the end call this this.element.trigger('dateselect.daterangepicker', this); And add the listener for dateselect same as above apply
– Eitbiz
Nov 22 '18 at 5:20
Thanks a lot.. is it possible to get the value of clicked date?
– Alia Tabassum
Nov 22 '18 at 5:34
Yes you will get two parameter ev, picker in that function and you can use the same as in above example. If okay just mark my comment useful
– Eitbiz
Nov 22 '18 at 5:35
Okay. Thank you
– Alia Tabassum
Nov 22 '18 at 5:35
Thank You.. But, i want to set time when the user clicks on the date value in the custom range and not after applying. Is there a way to do this?
– Alia Tabassum
Nov 22 '18 at 5:12
Thank You.. But, i want to set time when the user clicks on the date value in the custom range and not after applying. Is there a way to do this?
– Alia Tabassum
Nov 22 '18 at 5:12
For this you have to customize the daterangepicker.js and in this file there is function clickDate at line 1245 and in this function at the end call this this.element.trigger('dateselect.daterangepicker', this); And add the listener for dateselect same as above apply
– Eitbiz
Nov 22 '18 at 5:20
For this you have to customize the daterangepicker.js and in this file there is function clickDate at line 1245 and in this function at the end call this this.element.trigger('dateselect.daterangepicker', this); And add the listener for dateselect same as above apply
– Eitbiz
Nov 22 '18 at 5:20
Thanks a lot.. is it possible to get the value of clicked date?
– Alia Tabassum
Nov 22 '18 at 5:34
Thanks a lot.. is it possible to get the value of clicked date?
– Alia Tabassum
Nov 22 '18 at 5:34
Yes you will get two parameter ev, picker in that function and you can use the same as in above example. If okay just mark my comment useful
– Eitbiz
Nov 22 '18 at 5:35
Yes you will get two parameter ev, picker in that function and you can use the same as in above example. If okay just mark my comment useful
– Eitbiz
Nov 22 '18 at 5:35
Okay. Thank you
– Alia Tabassum
Nov 22 '18 at 5:35
Okay. Thank you
– Alia Tabassum
Nov 22 '18 at 5:35
|
show 2 more comments
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53410984%2fhow-to-detect-selecting-the-date-in-daterangepicker%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Can you show the html of
$('#fd_date_range')
as well?– Honkalonkalooooohhh
Nov 21 '18 at 11:21
Updated the html
– Alia Tabassum
Nov 21 '18 at 12:18