(update) Hi all
is it possible to create a dynamic sequence for the number of weeks based on the current month?
which I then want to use for a drop-down/combo box control (Collection as item?)
currently using
"Week " & RoundDown(
(Day(Today()) - Day(DateValue("1/1/" & Year(Today()))) + Weekday(DateValue("1/1/" & Year(Today())) - 1)) / 7,
0
) + 1
on a text label which just gives the current week number for the current month (this gives correct week)
Issue:
ClearCollect(
AvailableWeeks,
AddColumns(
Sequence(
RoundUp(
(Day(
DateAdd(
Date(
Year(Today()),
Month(Today()) + 1,
1
),
-1,
TimeUnit.Days
)
) -// Last day of the current month
Day(
Date(
Year(Today()),
Month(Today()),
1
)
) + 1 +// Day of the first day of the current month
Weekday(
Date(
Year(Today()),
Month(Today()),
1
) - Day(
Date(
Year(Today()),
Month(Today()),
1
)
) + 1
)// Weekday of the first day of the current month
) / 7,
0
)
),
"WeekNumber",
"Week " & Value
)
);

this gives 5 weeks which is wrong as February has 4 weeks
any suggestion would be great
thank you 😃