We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Date Range Picker StartDay + Ranges

Thread ID:

Created:

Updated:

Platform:

Replies:

149160 Nov 16,2019 09:46 AM UTC Nov 19,2019 10:50 AM UTC ASP.NET Web Forms 3
loading
Tags: Date Range Picker
Peter
Asked On November 16, 2019 09:46 AM UTC

Dear,

I use ASP.NET webforms in VB.NET.

Question 1:
Is there a possibility to set the StartDay for the Date Range Picker like we can do for the DatePicker? For example start the weeks on monday instead of sunday?

Question 2:
I would like to add the easy range buttons (Last Week/Month). When I add the code to  my Page_Load sub it only shows the "Customer Picker" button and not the "Last week" & "Last month buttons."

            datFilterOrderFromTo.Ranges.AddRange({New Syncfusion.JavaScript.Models.DateRanges() With {
                .Label = "Last Month",
                .Range = New List(Of Object)() From {
                    Today.AddMonths(-1).ToString(),
                    Today.ToString()
                }
            }, New Syncfusion.JavaScript.Models.DateRanges With {
                .Label = "Last Week",
                .Range = New List(Of Object)() From {
                    Today.AddDays(-7).ToString(),
                    Today.ToString()
                }
            }})



Thanks for help.
Peter

Keerthana Rajendran [Syncfusion]
Replied On November 18, 2019 12:15 PM UTC

Hi Peter, 
 
Thanks for contacting Syncfusion support. 
 
Query 1: Is there a possibility to set the StartDay for the Date Range Picker like we can do for the DatePicker? For example, start the weeks on monday instead of sunday? 
 
Yes. It is possible. For this scenario, you can use DateRangePicker component open event to change the startDay for both the left and right date pickers. 
 
 
function onOpen(args) { 
            this._leftDP.option("startDay",1); 
           this._rightDP.option("startDay",1); 
        } 
 
 
Query 2: I would like to add the easy range buttons (Last Week/Month). When I add the code to my Page_Load sub it only shows the "Customer Picker" button and not the "Last week" & "Last month buttons." 
 
By default, our DateRangePicker component Custom Picker button visible to UI. Your provided code blocks are enough to add any custom buttons in DateRangePicker. Please refer the below sample and screenshot. 
 
 
 
 
If the issue persists, kindly modify the above sample based on your scenario else share the complete code block of DateRangePicker along with Layout and web config page details to proceed further.  
 
Regards, 
Keerthana. 


Peter
Replied On November 18, 2019 05:38 PM UTC

Dear,

thank you for the reply. Question 1 is solved.
When I run your sample for Question 2 I get the same behaviour: no buttons for Last Month and Last Week, only Custom Picker.


To compile I had to remove this line from Global.Asax.vb:

        System.Web.Http.GlobalConfiguration.Configuration.Routes.MapHttpRoute(name:="DefaultApi", routeTemplate:="api/{controller}/{action}/{id}", defaults:=New With {.id = RouteParameter.[Optional]
        })

Any toughts?

Keerthana Rajendran [Syncfusion]
Replied On November 19, 2019 10:50 AM UTC

Hi Peter, 
 
Good day to you, 
 
We have tested our shared sample, Last week and Last month button was added correctly. We were unable to replicate the issues mentioned in your update. We have recorded a video for your reference.  
Refer to the below link. 
 
 
Please check the above video and provide additional details on the following to proceed further. 
 
1.      Complete code block for ejDateRangePicker. 
2.      Video on the issue along with product version in which you get this issue. 
 
Regards, 
Keerthana.  


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon