Using 'Invoke Method' To Get Week Of The Year

I’m attempting to use the GetWeekOfYear .net method and am having trouble understanding how to format some of its parameters.

The required parameters are as follows:
public virtual int GetWeekOfYear (DateTime time, System.Globalization.CalendarWeekRule rule, DayOfWeek firstDayOfWeek);

I believe I’ve successfully found the formatting for the first and third parameters; the screenshot included:

But the second parameter I’m unsure how to input. I’ve attempted “CalenderWeekRule.FirstFourDayWeek” but CalenderWeekRule does not exist.

Any wisdom would be appreciated!

@jesse.m
Welcome to the forum

grafik
taken from:

so use fully qualified name / or import the namespace

For the parameter setting:

Legacy:
grafik

Windows:
grafik

for RnD and prototyping you can work with the immediate panel:
Understanding the 6 Debugging Panels of UiPath in the easiest way possible! - News / Tutorials - UiPath Community Forum

1 Like

Why are you going to all this unnecessary trouble when you can just get the week of the year with…

DatePart(DateInterval.WeekOfYear,Now)

1 Like

Thanks to both of you, I see what I was doing incorrectly with the invoke method and that there was a more straightforward solution!

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.