Replies: 1 comment
-
I figured out a hack workaround for this issue where even if there is a value="xxxx" the autoUpdateInput will overwrite the value when the page loads with the startDate or minDate. Very annoying. Now I check if I am adding data (i know that value="") then I just call $(".CheckInOutDate").val(""); after the daterangepicker call. This wipes the date that it added onload incorrectly. This is something that should be fixed on the picker though. I do not see any other way to fix it currently, unless I am missing something... |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I want to be able to select a date without using .on("apply". This is very easy with autoApply and autoUpdateInput, BUT... I do not want it to show the startDate value when the page loads. onLoad triggers the update and shows it. I want to bypass that part and have it blank onLoad unless there is a value="xxxxxx" for the input box (if there is a value, it should show like normal - this is the reason I cannot just make it .val("") on page load). It's like there needs to be another setting to skipOnload or something.
Does that make sense and see the issue?
I have the following code. Any help would be appreciated! Thank you.
$(".CheckInOutDate").daterangepicker(
{
todayHighlight: true,
singleDatePicker: true,
showDropdowns: true,
//autoApply: true,
//autoUpdateInput: true,
startDate: '01/01/2025',
locale:
{
format: 'MM/DD/YYYY'
}
}).on("apply.daterangepicker", function (e, picker) {
picker.element.val(picker.startDate.format(picker.locale.format));
});
Beta Was this translation helpful? Give feedback.
All reactions