Notifications
Announcements
No record found.
How can we show only time in date and time field or provide functionality to enter only time.
Hi raki,
If you create a standard date and time field you can use JavaScript to extract the time from the field and set another field with the time value. Here is an example JavaScript function for this.
function getTime() { var date = Xrm.Page.getAttribute("date").getValue(); var hours = date.getHours(); var minutes = date.getMinutes(); var time = "" + hours + ":" + minutes; Xrm.Page.getAttribute("time").setValue(time); }
Hi partner,
1.Unfortunately, there is no OOB function to do this.
When we creating a datetime field, we could only choose the format to "date and time".
docs.microsoft.com/.../behavior-format-date-time-field
2.You could use js code to control the format of the datetime field.
Here is a sample for more steps.
https://community.dynamics.com/crm/b/mscrmcustomization/archive/2015/01/20/show-only-time-for-date-time-attribute
Hope it helps.
Best Regards,
Leo
Hi,
is there a solution for this without JS by now?
Thx
Hi, there is a built-in option to achieve the display of time only.
It is by using the "Time without Date" component control on the datetime field on the form
Christian K Pierre Andre Joubert
Yes, we have.
You can download a free control from the link below and import it into your Dynamics 365 instance.
marketplace.bevercrm.com/.../TimePicker
It has YouTube instructions on how to install it.
Regards,
Ruben
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.
Congratulations to a top community star!
In our never-ending quest to help the Dynamics 365 Community members get answers faster …
Welcome to the next edition of the Community Platform Update. This is a status …
Stay up to date on forum activity by subscribing.