I am connected to a sharepoint calendar from powerapps. How do you change the 24 hour format from powerapps to 12 hr format in the input and edit forms? Thanks.
Solved! Go to Solution.
Hi @UC3378 ,
You have to add it to the card on the right of the others (you will need to unlock the card) - that is the first item I put in.
Also note that the code will need to be altered to your control names.
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
Hi @UC3378 ,
Add another drop down at the right with Items
["AM", "PM"]
and the Default
If(Hour(Parent.Default) < 12, "AM", "PM")
The Items of the Hour control
["12","01","02","03","04","05","06","07","08","09","10","11"]
and the Default
Text(If(Mod(Hour(Parent.Default), 12) = 0, 12, Mod(Hour(Parent.Default), 12)),"00")
Now the Update of the Data Card
DateControlName.SelectedDate +
Time(
If(
AmPmControlName.Selected.Value = "PM",
12,
0
) +
Mod(
Value(
HourControlName.Selected.Value
),
12
),
Value(
MinuteControlName.Selected.Value
),
0
)
NOTE - you will need to replace the control names above with yours.
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
Thanks for your reply. I tried working on it today but didnt really get a chance to finish it. I will give it a shot again tomorrow. But one thing i did notice was that my start time data card does not include an AM/PM, so how will that translate to the sharepoint calendar?
Hi @UC3378 ,
You have to add it to the card on the right of the others (you will need to unlock the card) - that is the first item I put in.
Also note that the code will need to be altered to your control names.
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
Thanks that worked, you are a genius!
I have a related issue hope you can help as well. When I click on a particular day in the calendar, it pops up an edit form and it loads whatever event that is in that day that I want to modify. The event along with its date and time is loaded correctly on the edit form. But if I edit the start date and time only and not touch the end date and time at all, or visa versa, it goes out of funk. So it will update only the start date and time, but will not update the end date and time, it will leave it blank. And if I go back into the edit form, the end date and time is reset. Back in sharepoint, it deletes that event altogether. Have you seen this? Thanks.
Hi @UC3378 ,
Happy to help with this, but I will be offline shortly.
This should be another subject, can you please accept this one and tag me on the new one. Please add some screen shots so ai can understand the issue a bit better.
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
I'm not sure why you are using the Mod() function here.
If I just use 12 for the Hour default and
DateValue.SelectedDate + Time(
If(
AMPM.Selected.Value = "PM",
12,
0
) + Value(Hour.Selected.Value),
Value(Minute.Selected.Value),
0
)
for the "Update" on the card it gives me the correct Time value.
I started down this path and stumbled on your solution. I like it. I'm running a test today and accepted your solution. I was close.