calendar days for particular month in day
working days textbox datetimepicker(calendar)
when i click the datetimepicker that particular month of day will be displayed i done through coding.
then i have net payable days textbox if i click the particular month that month of day sundays to be subracted and remaining days to be displayed in the net payable days textbox.
for your understand
working days textbox datetimepicker(calendar) net payable days textbox 26
31 if i choose january 31 26 days to be dispalyed
to be dispalyed in textbox
Posted Jul 10, 2012, 12:41 AM
public static class DateTimeExtensions
{
public static bool IsWorkingDay(this DateTime date)
{
return date.DayOfWeek != DayOfWeek.Sunday;
}
}
Then, use is within a Where clause to filter a broader list of dates:
var allDates = GetDates(); // method which returns a list of dates
// filter dates by working day's
var countOfWorkDays = allDates
.Where(day => day.IsWorkingDay())
.Count() ;
http://stackoverflow.com/questions/1617049/calculate-the-number-of-business-days-between-two-dates
http://stackoverflow.com/questions/273048/how-to-determine-the-last-business-day-in-a-given-month
All the examples consider working days as Monday to Friday,
so you need to change this to Monday to Saturday.
Hope this helps you.
Posted Jul 10, 2012, 12:31 AM