cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Book a room template, change from PM/AM to 24-hour

Hi guys,

 

So, I have used the "Book a room" template and it seems to work, however, I dont know how to change "AdjustTimeScreen" from AM/PM to 24-hour format instead. How do I do this? I want the Start and **bleep** (End time) to be 01-24 instead of 1-12 pm/am

 

Thanks guys

 

hours123.PNG

1 ACCEPTED SOLUTION

Accepted Solutions
v-bofeng-msft
Community Support
Community Support

 

Hi @ Antoooox:

Do you want to make the Start and **bleep** (End time) to be 01-24 instead of 1-12 pm/am.

I made a same test and found that the data source Times is a collection that created by OnStart property.

So we can achieve the goal by modifying the formula that defines the Times collection.

Here is my solution:

Replace this code

 

ClearCollect(Times, {Text: "12:00 am", Minutes: 0}, {Text: "12:30 am", Minutes: 30}, {Text: "1:00 am", Minutes: 60}, {Text: "1:30 am", Minutes: 90}, {Text: "2:00 am", Minutes: 120}, {Text: "2:30 am", Minutes: 150}, {Text: "3:00 am", Minutes: 180}, {Text: "3:30 am", Minutes: 210}, {Text: "4:00 am", Minutes: 240}, {Text: "4:30 am", Minutes: 270}, {Text: "5:00 am", Minutes: 300}, {Text: "5:30 am", Minutes: 330}, {Text: "6:00 am", Minutes: 360}, {Text: "6:30 am", Minutes: 390}, {Text: "7:00 am", Minutes: 420}, {Text: "7:30 am", Minutes: 450}, {Text: "8:00 am", Minutes: 480}, {Text: "8:30 am", Minutes: 510}, {Text: "9:00 am", Minutes: 540}, {Text: "9:30 am", Minutes: 570}, {Text: "10:00 am", Minutes: 600}, {Text: "10:30 am", Minutes: 630}, {Text: "11:00 am", Minutes: 660}, {Text: "11:30 am", Minutes: 690}, {Text: "12:00 pm", Minutes: 720}, {Text: "12:30 pm", Minutes: 750}, {Text: "13:00 pm", Minutes: 780}, {Text: "13:30 pm", Minutes: 810}, {Text: "14:00 pm", Minutes: 840}, {Text: "14:30 pm", Minutes: 870}, {Text: "15:00 pm", Minutes: 900}, {Text: "15:30 pm", Minutes: 930}, {Text: "16:00 pm", Minutes: 960}, {Text: "16:30 pm", Minutes: 990}, {Text: "17:00 pm", Minutes: 1020}, {Text: "17:30 pm", Minutes: 1050}, {Text: "18:00 pm", Minutes: 1080}, {Text: "18:30 pm", Minutes: 1110}, {Text: "19:00 pm", Minutes: 1140}, {Text: "19:30 pm", Minutes:1170}, {Text: "20:00 pm", Minutes: 1200}, {Text: "20:30 pm", Minutes: 1230}, {Text: "21:00 pm", Minutes: 1260}, {Text: "21:30 pm", Minutes: 1290}, {Text: "22:00 pm", Minutes: 1320}, {Text: "22:30 pm", Minutes: 1350}, {Text: "23:00 pm", Minutes: 1380}, {Text: "23:30 pm", Minutes: 1410})

 

with

 

ClearCollect(Times, {Text: "00:00", Minutes: 0}, {Text: "12:30", Minutes: 30}, {Text: "1:00", Minutes: 60}, {Text: "1:30", Minutes: 90}, {Text: "2:00", Minutes: 120}, {Text: "2:30", Minutes: 150}, {Text: "3:00", Minutes: 180}, {Text: "3:30", Minutes: 210}, {Text: "4:00", Minutes: 240}, {Text: "4:30", Minutes: 270}, {Text: "5:00", Minutes: 300}, {Text: "5:30", Minutes: 330}, {Text: "6:00", Minutes: 360}, {Text: "6:30", Minutes: 390}, {Text: "7:00", Minutes: 420}, {Text: "7:30", Minutes: 450}, {Text: "8:00", Minutes: 480}, {Text: "8:30", Minutes: 510}, {Text: "9:00", Minutes: 540}, {Text: "9:30", Minutes: 570}, {Text: "10:00", Minutes: 600}, {Text: "10:30", Minutes: 630}, {Text: "11:00", Minutes: 660}, {Text: "11:30", Minutes: 690}, {Text: "12:00", Minutes: 720}, {Text: "12:30", Minutes: 750}, {Text: "13:00", Minutes: 780}, {Text: "13:30", Minutes: 810}, {Text: "14:00", Minutes: 840}, {Text: "14:30", Minutes: 870}, {Text: "15:00", Minutes: 900}, {Text: "15:30", Minutes: 930}, {Text: "16:00", Minutes: 960}, {Text: "16:30", Minutes: 990}, {Text: "17:00", Minutes: 1020}, {Text: "17:30", Minutes: 1050}, {Text: "18:00", Minutes: 1080}, {Text: "18:30", Minutes: 1110}, {Text: "19:00", Minutes: 1140}, {Text: "19:30", Minutes:1170}, {Text: "20:00", Minutes: 1200}, {Text: "20:30", Minutes: 1230}, {Text: "21:00", Minutes: 1260}, {Text: "21:30", Minutes: 1290}, {Text: "22:00", Minutes: 1320}, {Text: "22:30", Minutes: 1350}, {Text: "23:00", Minutes: 1380}, {Text: "23:30", Minutes: 1410})

 

qqq.jpg

 

 

Best Regards,

Bof

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Nobody? 😇
v-bofeng-msft
Community Support
Community Support

 

Hi @ Antoooox:

Do you want to make the Start and **bleep** (End time) to be 01-24 instead of 1-12 pm/am.

I made a same test and found that the data source Times is a collection that created by OnStart property.

So we can achieve the goal by modifying the formula that defines the Times collection.

Here is my solution:

Replace this code

 

ClearCollect(Times, {Text: "12:00 am", Minutes: 0}, {Text: "12:30 am", Minutes: 30}, {Text: "1:00 am", Minutes: 60}, {Text: "1:30 am", Minutes: 90}, {Text: "2:00 am", Minutes: 120}, {Text: "2:30 am", Minutes: 150}, {Text: "3:00 am", Minutes: 180}, {Text: "3:30 am", Minutes: 210}, {Text: "4:00 am", Minutes: 240}, {Text: "4:30 am", Minutes: 270}, {Text: "5:00 am", Minutes: 300}, {Text: "5:30 am", Minutes: 330}, {Text: "6:00 am", Minutes: 360}, {Text: "6:30 am", Minutes: 390}, {Text: "7:00 am", Minutes: 420}, {Text: "7:30 am", Minutes: 450}, {Text: "8:00 am", Minutes: 480}, {Text: "8:30 am", Minutes: 510}, {Text: "9:00 am", Minutes: 540}, {Text: "9:30 am", Minutes: 570}, {Text: "10:00 am", Minutes: 600}, {Text: "10:30 am", Minutes: 630}, {Text: "11:00 am", Minutes: 660}, {Text: "11:30 am", Minutes: 690}, {Text: "12:00 pm", Minutes: 720}, {Text: "12:30 pm", Minutes: 750}, {Text: "13:00 pm", Minutes: 780}, {Text: "13:30 pm", Minutes: 810}, {Text: "14:00 pm", Minutes: 840}, {Text: "14:30 pm", Minutes: 870}, {Text: "15:00 pm", Minutes: 900}, {Text: "15:30 pm", Minutes: 930}, {Text: "16:00 pm", Minutes: 960}, {Text: "16:30 pm", Minutes: 990}, {Text: "17:00 pm", Minutes: 1020}, {Text: "17:30 pm", Minutes: 1050}, {Text: "18:00 pm", Minutes: 1080}, {Text: "18:30 pm", Minutes: 1110}, {Text: "19:00 pm", Minutes: 1140}, {Text: "19:30 pm", Minutes:1170}, {Text: "20:00 pm", Minutes: 1200}, {Text: "20:30 pm", Minutes: 1230}, {Text: "21:00 pm", Minutes: 1260}, {Text: "21:30 pm", Minutes: 1290}, {Text: "22:00 pm", Minutes: 1320}, {Text: "22:30 pm", Minutes: 1350}, {Text: "23:00 pm", Minutes: 1380}, {Text: "23:30 pm", Minutes: 1410})

 

with

 

ClearCollect(Times, {Text: "00:00", Minutes: 0}, {Text: "12:30", Minutes: 30}, {Text: "1:00", Minutes: 60}, {Text: "1:30", Minutes: 90}, {Text: "2:00", Minutes: 120}, {Text: "2:30", Minutes: 150}, {Text: "3:00", Minutes: 180}, {Text: "3:30", Minutes: 210}, {Text: "4:00", Minutes: 240}, {Text: "4:30", Minutes: 270}, {Text: "5:00", Minutes: 300}, {Text: "5:30", Minutes: 330}, {Text: "6:00", Minutes: 360}, {Text: "6:30", Minutes: 390}, {Text: "7:00", Minutes: 420}, {Text: "7:30", Minutes: 450}, {Text: "8:00", Minutes: 480}, {Text: "8:30", Minutes: 510}, {Text: "9:00", Minutes: 540}, {Text: "9:30", Minutes: 570}, {Text: "10:00", Minutes: 600}, {Text: "10:30", Minutes: 630}, {Text: "11:00", Minutes: 660}, {Text: "11:30", Minutes: 690}, {Text: "12:00", Minutes: 720}, {Text: "12:30", Minutes: 750}, {Text: "13:00", Minutes: 780}, {Text: "13:30", Minutes: 810}, {Text: "14:00", Minutes: 840}, {Text: "14:30", Minutes: 870}, {Text: "15:00", Minutes: 900}, {Text: "15:30", Minutes: 930}, {Text: "16:00", Minutes: 960}, {Text: "16:30", Minutes: 990}, {Text: "17:00", Minutes: 1020}, {Text: "17:30", Minutes: 1050}, {Text: "18:00", Minutes: 1080}, {Text: "18:30", Minutes: 1110}, {Text: "19:00", Minutes: 1140}, {Text: "19:30", Minutes:1170}, {Text: "20:00", Minutes: 1200}, {Text: "20:30", Minutes: 1230}, {Text: "21:00", Minutes: 1260}, {Text: "21:30", Minutes: 1290}, {Text: "22:00", Minutes: 1320}, {Text: "22:30", Minutes: 1350}, {Text: "23:00", Minutes: 1380}, {Text: "23:30", Minutes: 1410})

 

qqq.jpg

 

 

Best Regards,

Bof

When I replace this code I get an error and I do not have any option of choosing time. Has anyone tried this fix as of late? 

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (4,182)