Skip to main content

Notifications

Power Apps - Building Power Apps
Unanswered

Datepicker validation - only numbers and dot in input field

(0) ShareShare
ReportReport
Posted on by 39

Hello to all,

is it possible to allow writing only numbers and a dot as validation in a date picker?

For example: 22.05.2024?


I dont want characters in the input field of a date picker

Marczii007_0-1714990114536.png 

  • WarrenBelz Profile Picture
    WarrenBelz 145,343 on at
    Re: Datepicker validation - only numbers and dot in input field

    @Marczii007 ,

    Just use a Text Input instead with the Update property I posted. This will also require some Validation.

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    MVP (Business Applications)   Visit my blog Practical Power Apps

  • Marczii007 Profile Picture
    Marczii007 39 on at
    Re: Datepicker validation - only numbers and dot in input field

    I would like the date picker input field to only accept numbers + ".". No use of the calendar icon on the right side. Just write in a specific date manually

    First, I need to set isEditable to true so that I can write in the input field of DP. But the behavior of the inputfield doesn't seem to be like a normal textfield

  • WarrenBelz Profile Picture
    WarrenBelz 145,343 on at
    Re: Datepicker validation - only numbers and dot in input field

    Hi @Marczii007 ,

    I am a little unclear what you are trying to do here - if you want to enter numbers (for instance 06052024) into a Text Input, the Date conversion would be

    Date(
     Value(
     Right(
     YourInput.Text,
     4
     )
     ),
     Value(
     Mid(
     YourInput.Text,
     3,
     2
     )
     ),
     Value(
     Left(
     YourInput.Text,
     2
     )
     )
    )

    but a Date Picker needs a recognised format - I have tested 06052024 on a Date Picker and it does not seem to want to accept it manually, even with the Format at "ddmmyyyy"

  • Marczii007 Profile Picture
    Marczii007 39 on at
    Re: Datepicker validation - only numbers and dot in input field

    Sadly not. I dont want to type characters in the input of the datepicker. 

    The datepicker should handle exact like a normal input text field, where u cant type characters if u set the property format to

    TextFormat.Number

    the datepicker control seems to doesnt allow this behavior
  • WarrenBelz Profile Picture
    WarrenBelz 145,343 on at
    Re: Datepicker validation - only numbers and dot in input field

    Hi @Marczii007 ,

    You can set the Format of the Date Picker to

    "dd.mm.yyyy"

     if that is what you mean.

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    MVP (Business Applications)   Visit my blog Practical Power Apps

  • VishalJhaveri Profile Picture
    VishalJhaveri 1,162 on at
    Re: Datepicker validation - only numbers and dot in input field

    No, I don't think so it is possible. @Marczii007 

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

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,343

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,703

Leaderboard