cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
amulhearn0207
Frequent Visitor

Date/Time Format and Function in App

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

 

1 ACCEPTED SOLUTION

Accepted Solutions
v-qiaqi-msft
Community Support
Community Support

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
 

Best Regards,
Qi

View solution in original post

2 REPLIES 2
cds
Impactful Individual
Impactful Individual

what kind of predictability do you want?

 

Hour(Now())

Minute(Now())

Second(Now())

 

For 1 min greater....

EndDateSecondDropdown.default = StartDateSecondDropdown.Selected.Value +1 

v-qiaqi-msft
Community Support
Community Support

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
 

Best Regards,
Qi

Helpful resources

Announcements
Super User 2 - 2022 Congratulations 768x460.png

Welcome Super Users

The Super User program for 2022 - Season 2 has kicked off!

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

<
Users online (2,778)