function checkDay(txtDate) { if(document.getElementById(txtDate).value.replace('/','').length>0) { var checkSunday = document.getElementById(txtDate).value.split('/'); var selectedDate = checkSunday[0]; var selectedMonth = checkSunday[1]; var selectedYear = checkSunday[2].substring(0, 4); var calendarDate = new Date(selectedYear, selectedMonth - 1, selectedDate); if (calendarDate.getDay() == 0) { var r = confirm("Selected date is Sunday! Do you want to continue?"); if (r == false) { document.getElementById(txtDate).value = ""; } } } }
Best Regards, Rohan Laghate
Thanks, T.Saravanan
private int NumMondays(string month_name, string year_name) { int i; int num_mondays; System.DateTime test_date; int orig_month; test_date = System.Convert.ToDateTime(month_name + " 1, " + year_name); if (Weekday(test_date) == vbMonday) { } else if (Weekday(test_date) == vbTuesday) { test_date = DateAdd("d", 6, test_date); } else if (Weekday(test_date) == vbWednesday) { test_date = DateAdd("d", 5, test_date); } else if (Weekday(test_date) == vbThursday) { test_date = DateAdd("d", 4, test_date); } else if (Weekday(test_date) == vbFriday) { test_date = DateAdd("d", 3, test_date); } else if (Weekday(test_date) == vbSaturday) { test_date = DateAdd("d", 2, test_date); } else if (Weekday(test_date) == vbSunday) { test_date = DateAdd("d", 1, test_date); } orig_month = Month(test_date); do { num_mondays = num_mondays + 1; test_date = DateAdd("ww", 1, test_date); } while ((Month(test_date) == orig_month)); NumMondays = num_mondays; }
LP MER
Login to post response