Hi,
I need to write a condition to check if it’s only first week of the month ? any suggestion
Hi,
I need to write a condition to check if it’s only first week of the month ? any suggestion
Hi @monishanair2010 ,
Here is something that ought to help you out:
If((System.Globalization.CultureInfo.InvariantCulture.Calendar.GetWeekOfYear(Today, System.Globalization.CalendarWeekRule.FirstFourDayWeek,DayOfWeek.Monday)/(Today.Month*4))>1,False,True)
There’s approximately 4 weeks in a month(4.2 to be a bit more precise) and since we have a method that helps us fetch the Week of Year, we can then use a bit of arithmetic operations to find what we are looking for.
Kind Regards,
Ashwin A.K