Quantcast
Channel: Recent Threads — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 204402

How to disable saturday and sunday from datepickerdialog

$
0
0

How to disable saturday and sunday from datepickerdialog in xamarin android. Here I provided only mindate but not max date. and I am getting the business days by using the following code.
public double getbusinessdays(DateTime stdate, DateTime eddate)
{
double businessdays = 1 + ((eddate - stdate).TotalDays * 5 - (stdate.DayOfWeek - eddate.DayOfWeek) * 2) / 7;
if(eddate.DayOfWeek == DayOfWeek.Saturday) {
businessdays--;
}
if(stdate.DayOfWeek == DayOfWeek.Sunday)
{
businessdays--;
}
return businessdays;
}

But Now I want to disable the saturday and sunday.


Viewing all articles
Browse latest Browse all 204402

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>