Hi Everyone,
This is my first post here.
I'm going through with a requirement where I have to make a time tracker but the gotcha is that every time a user select a month it must start with 1st of every month and dynamically add days names on canvas. It should be divided in weeks like 1-7 week1 8-14 week2 and so on and left days at the end should be counted as last week of that months like date 29 and 39 will be in that month.
This approach is little tedious for me bcoz I'm newbie in Power Apps.
Any suggestion would be highly appreciated.
Solved! Go to Solution.
Hi @Viipiin :
Could you tell me:
I'v made a test for your reference:
1\Add two TextInput controls(TextInput3/TextInput4)
2\Try this code:
ForAll(
[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31],
If(
Month(
DateAdd(
Date(
Value(TextInput3.Text),
Value(TextInput4.Text),
1
),
Value,
Days
)
) = Value(TextInput4.Text),
{
Date: DateAdd(
Date(
Value(TextInput3.Text),
Value(TextInput4.Text),
1
),
Value,
Days
),
Week: If(
Value < 7,
"Week1",
Value < 14,
"Week2",
Value < 21,
"Week3",
Value < 28,
"Week3",
"Week4"
)
}
)
)
Best Regards,
Bof
Hi @Viipiin :
Could you tell me:
I'v made a test for your reference:
1\Add two TextInput controls(TextInput3/TextInput4)
2\Try this code:
ForAll(
[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31],
If(
Month(
DateAdd(
Date(
Value(TextInput3.Text),
Value(TextInput4.Text),
1
),
Value,
Days
)
) = Value(TextInput4.Text),
{
Date: DateAdd(
Date(
Value(TextInput3.Text),
Value(TextInput4.Text),
1
),
Value,
Days
),
Week: If(
Value < 7,
"Week1",
Value < 14,
"Week2",
Value < 21,
"Week3",
Value < 28,
"Week3",
"Week4"
)
}
)
)
Best Regards,
Bof
User | Count |
---|---|
261 | |
110 | |
90 | |
54 | |
44 |