web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Modern DatePicker defa...
Power Apps
Suggested Answer

Modern DatePicker defaultDate doesn't show correct date.

(1) ShareShare
ReportReport
Posted on by 28
Hi,
 
has anyone experienced an issue with the modern DatePicker where it displays the wrong date set in the defaultDate property? I’m not sure whether the problem is in the rendering. I don’t understand what’s going on. Thanks for any advice on how to avoid this ambiguous behavior of the DatePicker.

I use Dataverse tables as source.
 
 
 
- datp_datum_pozadavky_vsa_5:
    Control: ModernDatePicker@1.0.0
    Properties:
      BorderStyle: =""
      DefaultDate: |-
        =//toto funguje pre klasicku tabulku
        //DataTable_aktivity_2.Selected.Datum
 
        //pre potreby prepnutia na modernTable
        //If(tgl_zobraz_modernTable.Checked; modernTable_aktivity.Selected.Datum;DataTable_aktivity_2.Selected.Datum)
 
        DataTable_aktivity_2.Selected.Datum
      EndDate: =Today()+10
      Font: =""
      FontWeight: =""
      Format: =DatePickerFormat.Short
      Height: =29
      IsEditable: =true
      OnChange: |
        =Select(btn_SaveControl_pred_ulozenim)
      Placeholder: ="Vyberte dátum…"
      Size: =12
      StartDate: "=If( \r\n    var_editovatelny_vsa = true,\r\n        Year(2024)\r\n        ,\r\n        Today()-4\r\n)      \r\n\r\n//funkcne - pracuje len s pracovnymi dnami\r\n/*\r\nIf( \r\n    var_editovatelny_vsa = true;\r\n        Year(2024)\r\n        ;\r\n\r\n        If(Weekday(Today()) in [\"2\";\"3\";\"4\";\"5\"];\r\n            Today()-6\r\n            ;\r\n            Today()-4\r\n        )\r\n        \r\n        \r\n*/"
      StartOfWeek: =StartOfWeek.Monday
      ValidationState: =If(IsBlank(Self.SelectedDate),"Error","None")
      Visible: |-
        =true
        //If (var_velkost_zobrazovanej_tabulky_polka = true And var_vykaz_do_buducna = false; true;false)
 
        //var_velkost_zobrazovanej_tabulky_polka
      Width: |+
        =150
      X: =lbl_datum_5.X+lbl_datum_5.Width
 
 
 
Thanks for any advice, Tom.
Categories:
I have the same question (0)
  • Suggested answer
    Haque Profile Picture
    1,390 on at
    Hi @TomGaz,
     
    Which time zone you are in? How it is wrong date set? Coul you please post the format you want.
    • The modern DatePicker control may interpret the date-time value differently than expected, especially if the field is configured as "Date Only" but the underlying data includes time.
    • Rendering quirks in the modern DatePicker can cause it to display a date off by one day if the time zone offset pushes the date backward or forward.
     

    Here are some suggestions to help you troubleshoot and fix the problem:

    Check the Dataverse field type: Confirm if Datum in your Dataverse table is configured as "Date Only" or "Date and Time." If it’s Date and Time, the time portion (often UTC) can cause the date to shift when displayed in the DatePicker.

    Strip the time portion explicitly: You can try to force the date value to ignore the time by using a formula like:
    DateValue(DataTable_aktivity_2.Selected.Datum) or DateValue(modernTable_aktivity.Selected.Datum) - 
    This extracts only the date part and can prevent off-by-one-day errors caused by time zone shifts.

    Test with a static date: Temporarily set DefaultDate to a fixed date like DateValue("2024-06-01") to verify if the control renders the date correctly. This helps isolate whether the issue is with the data or the control.

    Consider time zone adjustments: If your users are in different time zones, you might need to adjust the date value by adding or subtracting hours before passing it to the DatePicker.

     
     

    I am sure some clues I tried to give. If these clues help to resolve the issue brought you by here, please don't forget to check the box Does this answer your question? At the same time, I am pretty sure you have liked the response!
  • Suggested answer
    11manish Profile Picture
    781 on at
    Issue is not your formula
     
    It’s due to:
    • Timezone conversion
    • Rendering timing
    • Modern control quirks
    Best fix: use DateValue() + variable binding

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 519 Most Valuable Professional

#2
11manish Profile Picture

11manish 489

#3
Haque Profile Picture

Haque 327

Last 30 days Overall leaderboard