You have to write some custom logic
AnyDate = CurrentDataandTime
BeginOfCurrentMonth = beginOfMonth($CurrentDateandTime)
NoOfWeeks = round(weeksBetween($BeginOfCurrentMonth,$CurrentDateandTime))
Hope it helps!
Create a custom microflow or use an expression to calculate the week number within a month. You can do this by first determining the day of the week for the first day of the month and then the day of the week for the date you want to calculate the week number for.
Calculate the difference between the two day of the week values.
Divide the difference by 7 to get the week number within the month.
// Input parameters: $startDate: DateTime $dateToCalculate: DateTime // Get the day of the week for the first day of the month $firstDayOfMonth = parseDateTime(formatDateTime($startDate, 'yyyy-MM-01'), 'yyyy-MM-dd') $firstDayOfWeek = toInteger(formatDateTime($firstDayOfMonth, 'E')) // Get the day of the week for the date to calculate $dayOfWeek = toInteger(formatDateTime($dateToCalculate, 'E')) // Calculate the week number within the month $weekNumber = ceil(($dayOfWeek - $firstDayOfWeek + 1) / 7) // $weekNumber now contains the week number within the month
You can call this microflow with the desired parameters to get the week number within the month for a specific date.
You can use
parseInteger(formatDateTime(date attribute, 'u'))
It will return an integer which Monday=1 Tuesday =2 … Sunday=7