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

Date Picker - manually adding date in wrong format

I have a date picker field:

  • format is dd/mm/yyyy
  • it is not a mandatory field
  • it is part of a form that saves to a SharePoint List.

It works perfectly once the user selects the date from the date picker, however, if the user manually types in the date to the date picker text field (i.e. without selecting the date from the date picker), if the date is not in dd/mm/yyyy format no date is sent to SharePoint once the form is submitted.  No warning is given to the user to say this has happend.  

 

For example if I just type in 03/02/21 (instead of 03/02/2021) then when I submit the form the value is ignored.

I have tried to put a bit of code around this to put in some validation but I cannot access the value the user has typed in.  The SelectedDate value only populates if the date entered is in the correct format.

 

Is there anyway to add this validation - to make sure that a user types in the correct format

OR

Is there a way to force the user to pick the date from the date picker and not edit in the text field directly.

1 ACCEPTED SOLUTION

Accepted Solutions
eka24
Super User
Super User

Change the IsEditable Property of the DatePicker to false

That will force them to select

------------

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.

View solution in original post

8 REPLIES 8
eka24
Super User
Super User

Change the IsEditable Property of the DatePicker to false

That will force them to select

------------

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.

Suchitra1996
Resolver II
Resolver II

@eilishourigan 

 

I'm not sure if you can manually type a date in the date picker control within PowerApps. When you click to edit the date, it automatically opens the calendar to edit the date. 
May be you can try to insert a date picker in the data card separately in the form to validate this. 

I can manually type in the date to the date picker field alright - and no warning given if the format is incorrect - or no way to access the text programmatically if entered in the incorrect format.  @eka24 solution will do the job nicely - I will just take the option away from them 🙂

Kicking myself for not thinking of trying to change that setting 😄

 

 

That's perfect - a nice neat solution to the problem.  Thanks for your quick reply!

Lisa_T
Frequent Visitor

So if I understand correctly, there is no error message if you type in the date in the wrong format, it just doesn't save? I think this could be improved on. Sometimes it is faster to enter a date (2 digit year should work) than to browse through a calendar. If you've figured out a solution, please share. I'm following...

eilishourigan
Helper II
Helper II

Yes that's correct @Lisa 

It's definitely a bug.  I just deactivated the option to edit and the users are managing fine.  So no solution to the bug yet but the workaround solved the issue for me.

ha_wai
Helper III
Helper III

apologies for dragging the thread to the surface, but it fits nicely with my current problem...

 

I had a similar issue than the OP. Manually entering the date worked fine until today, albeit with the same caveat that a wrongly formatted date got ignored. Then after making some changes to other things in the app it suddenly stopped working completely. No manual entry got accepted and it couldn't be a problem with normal date format (dd/mm/yyyy) versus weird format (mm/dd/yyyy) because I tested with dates were it didn't matter 01/04/1960.

 

Unfortunately forcing the users to use the date picker as intended is terribly awkward because it is a field for DOB and that means a lot of scrolling when the person is older than the number of years displayed in the drop down for years in the date picker.

 

Has anybody found a solution for this by now?

 

Cheers

Hansjoerg

Paladin
Frequent Visitor

Hi ha_wai,

 

Sorry not a solution but have you checked that the date Picker format hasn't been changed as this would affect how they need to enter dates. e.g. having formate set to "dd-mmm-yyyy" means they'd need to enter dates as 10-May-2021

Paladin_1-1652174920362.png

Also when you said users need to do lots of scrolling if they are older, did you know they can click on the year itself and then just select the year they were born. (you can even type in the year and the scroll bar will jump to it)

Paladin_0-1652174611699.png

Helpful resources

Announcements
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.

Carousel_PP_768x460_Wave2 (1).png

2022 Release Wave 2 Plan

Power Platform release plan for the 2022 release wave 2 describes all new features releasing from October 2022 through March 2023.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Top Solution Authors
Users online (5,799)