cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
mike528
Level: Powered On

BUG in Date and DateValue ... incorrectly adjust invalid values

I have a canvas app running on iPads, had problem with Date Picker so decided to create a 3 control component to pick month, day and year from dropdowns. 

 

Using the following expression does the job, but was expecting an error if the user selected an invalid date like 04/31/1950. Instead of raising an error, the function simply advances the number of days past the end of the month. In the case of 4/31/1950, it returns 5/1/1950!! What??

 

UpdateContext(

    {

        DOB: IfError(

            DateValue(

                Concatenate(

                    Left(

                        ddDOBMonth.Selected.Value,

                        2

                    ),

                    "/",

                    ddDOBDay.Selected.Value & "/",

                    ddDOBYear.Selected.Value

                )

            ),

            Blank()

        )

    }

);

 

Using the Date() function behaves the same way. Am I missing something?? In every language I've ever programmed in, this would raise an error as an invalid date, which is what I want. This is being used as a DOB so advancing is NOT OK.

 

 

2 REPLIES 2
Community Support Team
Community Support Team

Re: BUG in Date and DateValue ... incorrectly adjust invalid values

Hi @mike528 ,

 

May I know what is the problem you have the date picker control? 

 

Regards,

Mona

Community Support Team _ Mona Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
mike528
Level: Powered On

Re: BUG in Date and DateValue ... incorrectly adjust invalid values

@v-monli-msft 

 

My users don't like it. The calendar adds no value and is confusing when they just want to change the year.  We are minimizing typing so entering the date is not a good answer. Tapping on the iPad is by far the best solution. Users love the new UI but these function behave in a very odd way. 

 

Are you thinking this is by design? I don't know any other language whose date conversion functions would do this.

 

Thanks

Helpful resources

Announcements
thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors (Last 30 Days)
Users online (5,469)