How to only set an end date in range mode

Hi.
I'd like to know if I can only allow the user to choose the end date, while the start date will always be DateTime.now() in a range mode.

I tried to use single mode to do this, but that means it won't show a range selection color like below:


Thanks in advance.


3 Replies 1 reply marked as answer

IR Indumathi Ravichandran Syncfusion Team March 7, 2022 06:55 AM UTC

Hi Jirawt, 
 
Regarding Query: How to only set an end date in range mode 
 
You can achieve this requirement, by using the onSelectionChanged callback, set the startDate of the  selectedRange of DateRangePickerController  as DateTime.now() and set the endDate  value as args.value.endDate through the selection changed callback. We have prepared the simple sample for the same. Please find the sample from the following link. 
 
Sample link: 
 
We hope that this helps you. If this is not your requirement, can you please share more details about your requirement clearly. It would be helpful for us to analyze and provide you a solution at the earliest.  
 
Regards, 
Indumathi R 


Marked as answer

JS Jirawt Santichavalit replied to Indumathi Ravichandran March 8, 2022 05:25 PM UTC

Thank you very much!
It worked, even though there's still a small problem. 

I have to click 2 times to set the end date, since the first click will always set the start date no matter what.

But that's fine for my case :D



IR Indumathi Ravichandran Syncfusion Team March 9, 2022 07:31 AM UTC

Hi jirawt,  
 
We are glad to know that your issue has been resolved at your end. Please let us know if you need any other assistance. we will be happy to assist you.     
 
Regards, 
Indumathi R 


Loader.
Up arrow icon