web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Date/Time Format and F...
Power Apps
Answered

Date/Time Format and Function in App

(0) ShareShare
ReportReport
Posted on by 109

Hello,

 

I have a simple app which updates a shared calendar. 

I have 2 issues.

a) I would like to be able to type the numbers into the hour minute box in a predictive text or search capacity, rather than having to scroll to the correct number.

 

b) I would like to make it so that the second date must be at least 1 minute later than the first date (greater than or equal to - end date cannot be before start).

 

Thanks for any help.

 

amulhearn0207_0-1596030224213.png

 

amulhearn0207_1-1596030376958.png

amulhearn0207_2-1596030400165.png

 

amulhearn0207_3-1596030428250.png

 

Categories:
I have the same question (0)
  • cds Profile Picture
    1,001 on at

    what kind of predictability do you want?

     

    Hour(Now())

    Minute(Now())

    Second(Now())

     

    For 1 min greater....

    EndDateSecondDropdown.default = StartDateSecondDropdown.Selected.Value +1 

  • Verified answer
    v-qiaqi@microsoft.com Profile Picture
    Microsoft Employee on at

    Hi@amulhearn0207,

    Based on the issue that you mentioned, do you want to enter the specific hour/minute number in the hour/minute box within the DatePicker?

    Let's tackle your problems one by one.


    @amulhearn0207 wrote:

    Hello,

    a) I would like to be able to type the numbers into the hour minute box in a predictive text or search capacity, rather than having to scroll to the correct number.


    Currently, the predictive text could be achieved through the ComboBox which allows you to search for the items you will select. 

    Property IsSearchable and SearchFields could help you achieve this.

    In general, the hour/minute box is a Dropdown by default, if you want to search text, you should replace it with the ComboBox from your form.

    Delete the Dropdown controls from the DataCard and insert 2 ComboBoxes to where you delete.

    Set the HourComboBox Items/DefaultSelectedItems property within the 'Start Date' DataCard as below:

     

    Items property:
    ["00","01","02","03","04","05","06","07","08","09","10","11","12","13","14","15","16","17","18","19","20","21","22","23"] 
    DefaultSelectedItems property: 
    [Text(Hour(Parent.Default),"[$-en-US]00")]

     

    Set the MinuteComboBox Items/DefaultSelectedItems property as below:

     

    Items property:
    ["00","01","02","03","04","05","06","07","08","09","10","11","12","13","14","15","16","17","18","19","20","21","22","23","24","25","26","27","28","29","30","31","32","33","34","35","36","37","38","39","40","41","42","43","44","45","46","47","48","49","50","51","52","53","54","55","56","57","58","59"]
    DefaultSelectedItems property:
    [Text(Minute(Parent.Default),"[$-en-US]00")]

     

     You just need to repeat it when handling the 'End Date' DataCard ComboBox control.

    And then, you want to make the 'End Date' must be at least 1 minute later than the 'Start Date'.


    @amulhearn0207 wrote:

    Hello,

    b) I would like to make it so that the second date must be at least 1 minute later than the first date (greater than or equal to - end date cannot be before start.)


    To achieve this, you should compare the 'Start Date' with the 'End Date'.

    I will do some work on the Submit button to make it disabled if time validation failed.

    Set the DisplayMode property of the Submit button as below:

     

    If(
     DateDiff(
     (DateValue1.SelectedDate + Time(
     Value(ComboBox1.Selected.Value),
     Value(ComboBox2.Selected.Value),
     0
     )),
     (DateValue2.SelectedDate + Time(
     Value(ComboBox3.Selected.Value),
     Value(ComboBox4.Selected.Value),
     0
     )),
     Minutes
     ) > 1,
     Edit,
     Disabled
    )

     

    Please check the Gif as below.

    0731Gif2.gif

    Best Regards,

    Qi
     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 509 Most Valuable Professional

#2
Haque Profile Picture

Haque 302

#3
11manish Profile Picture

11manish 265

Last 30 days Overall leaderboard