Skip to main content

Notifications

Power Pages - General Discussions
Answered

Date and Time field in form

Posted on by 15
I have a requirement for a date and time field in a powerpages form.  It's not an automatic timestamp it's a field where the user enters the date and a particular time.  What's the best way to do this?  The corresponding DV field  where the data goes is a date/time field
Categories:
  • DBNL Profile Picture
    DBNL 15 on at
    Date and Time field in form
    Perfect thank you Fubar
  • Verified answer
    Fubar Profile Picture
    Fubar 7,351 on at
    Date and Time field in form
    If your dataverse Date is set to be Date Time (and is not set to Date only), then by default you should see the following, note the clock in red circle allows you to set Time.
     
     
    With JavaScript/JQuery you can also tell it to display the time side-by-side so rather than the button it appears to the right of the dates without a button click.
     
    $("#field_schemaname").next().data("DateTimePicker").sideBySide(true)
     
  • DL-05091419-0 Profile Picture
    DL-05091419-0 2 on at
    Date and Time field in form
    ok so  maybe I didn't explain it properly.
     
    My column in Dataverse is Date and Time.    At the Power Pages End I require the users to manually enter a date and a time.   The date picker only allows for date and automatically time stamps the time that they choose a date. I need them to be able to manually enter a specific time as well as date.
     
    In powerapps when I have requirement I just use drop downs with 24 and 60 items r..and then concatenate it with the date picker I just thought that maybe in Power Pages there maybe a better way to do it?
     
    thanks
     
     
  • Suggested answer
    GWham Profile Picture
    GWham 39 on at
    Date and Time field in form
    Place a date field on your form and the portal will render a date/time picker.
     
    if you want to set it to a specific date you can use:
    $("#your_fieldname").next().data("DateTimePicker").defaultDate(new Date("2020-01-01"));
     
     
     
  • Suggested answer
    Fubar Profile Picture
    Fubar 7,351 on at
    Date and Time field in form
    Not sure what you are actually after, if you want the portal user to enter a Date-time, then you have a Date field in Dataverse configured to not be Date only, add it to your form, and the portal will render a datetimepicker control for the user.
    Or do you want to populate it with data rather than the user entering the data (or default it to a value)?
    Or are you thinking you want 2 fields one for date one for time (this will be more difficult)?

Helpful resources

Quick Links

Welcome to the Power Platform…

We are thrilled to unveil the newly-launched Power Platform Communities!…

Community Update 9/9/24…

Power Platform Community Update…

Welcome to the new Power Platform Community!…

We are excited to announce our new Copilot Cookbook Gallery in the Community…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 140,690

#2
RandyHayes Profile Picture

RandyHayes 76,308

#3
Pstork1 Profile Picture

Pstork1 63,355

Leaderboard

Featured topics