cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Jeziel_Victor
Helper II
Helper II

DatePicker Power Apps

Hello,

i would like to limit the date picker so the user can choose only as dates within a one month range is possible?

1 ACCEPTED SOLUTION

Accepted Solutions
v-qiaqi-msft
Community Support
Community Support

Hi @Jeziel_Victor

Have you solved your problem?

Do you want to force the user to choose the date only among a month?

Could you please tell me that how you configure this one month range?

I assume that you have 2 separate Date Pickers and you want the dates selected to be among a month, right?

I have made a simple test for you, please take a try as below.

Set the OnSelect property of the second date picker as below:

 

If(
    Month(DatePicker_EndDate.SelectedDate) <> Month(DatePicker_StartDate.SelectedDate),
    Notify(
        "Please keep the selected date within a same month!",
        Error
    )
)

 

If you just have a single date picker and you want to achieve this, please try as below:

 

If(
    Month(DatePicker.SelectedDate) =9,// Custom the month as you expect
    Notify(
        "Please keep the selected date within a month!",
        Error
    )
)

In addition, not sure where do you want to configure this function, if you really want to configure this in Portal, please check the reply from @OliverRodrigues.

 

Best Regards,
Qi

View solution in original post

3 REPLIES 3
OliverRodrigues
Super User
Super User

Hi, please take a look at this article: https://www.netwoven.com/2019/04/16/how-to-add-date-range-filter-controls-in-entity-list-in-dynamics...




If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

Power Pages Super User | MVP


Oliver Rodrigues


 

v-qiaqi-msft
Community Support
Community Support

Hi @Jeziel_Victor

Have you solved your problem?

Do you want to force the user to choose the date only among a month?

Could you please tell me that how you configure this one month range?

I assume that you have 2 separate Date Pickers and you want the dates selected to be among a month, right?

I have made a simple test for you, please take a try as below.

Set the OnSelect property of the second date picker as below:

 

If(
    Month(DatePicker_EndDate.SelectedDate) <> Month(DatePicker_StartDate.SelectedDate),
    Notify(
        "Please keep the selected date within a same month!",
        Error
    )
)

 

If you just have a single date picker and you want to achieve this, please try as below:

 

If(
    Month(DatePicker.SelectedDate) =9,// Custom the month as you expect
    Notify(
        "Please keep the selected date within a month!",
        Error
    )
)

In addition, not sure where do you want to configure this function, if you really want to configure this in Portal, please check the reply from @OliverRodrigues.

 

Best Regards,
Qi

Good afternoon it worked, but I need you not to allow selecting a date longer than 3 months!

Helpful resources

Announcements
Carousel Community Blog

Check out the Community Blog

Read all about the most recent blogs in the community!

Carousel News & Announcements

What's New in the Community?

Check out the latest News & Events in the community!

Users online (20,935)