嗨,我写了一个返回字符串的方法。现在我想将下面的方法转换为具有相同参数的 jquery。谁可以帮我这个事。下面是我的方法
public String GetNthWeekdayOfMonth(DateTime EnteredDate, int Number, DayOfWeek weekday)
{
String error = "";
var days = Enumerable.Range(1, DateTime.DaysInMonth(EnteredDate.Year, EnteredDate.Month)).Select(day => new DateTime(EnteredDate.Year, EnteredDate.Month, day));
var weekdays = from day in days
where day.DayOfWeek == weekday
orderby day.Day ascending
select day;
int index = Number - 1;
if (index >= 0 && index < weekdays.Count())
return Convert.ToString(weekdays.ElementAt(index));
else
error = "The specified day does not exist in this ";
return error;
}