public static void draw(int month)
{
switch (month)
{
//assign correct number of days to a month
};
for (int day = 1; day <= days; day++)
{
public int weekday = new DateTime(year, month, day);
}
}
I don’t know if I am blind or dumb but for some reason, when I pass month parameter as int, it gets recognized as string in the datetime object initialization.

>Solution :
I can see from screen that you’re working in Calendar class. As you can see when you’re creating new DateTime(…) it doesn’t take month as variable, but it takes static member field called month. You would need to rename this static field, or the variable itself.
Additionally you need to adjust creation of datetime variable:
- It’s datetime, not int
- It’s local variable – doesn’t require public. OR, if you wanted to edit static field in class remove
public intat all
so can be
DateTime weekday = new DateTime(year, month, day);
or
var weekday = new DateTime(year, month, day);
or (if static field)
weekday = new DateTime(year, month, day);