Set Datetime picker value on Microsoft Power-app Portal form
To set the value in Date time picker field, we need to convert the particular format.
Take an example, we have simple date value
var todayDate = new Date();
Use below code to set the date value, since dynamics supports standard UTC format for date.
$("logicalName").val(moment.utc(todayDate).format(‘YYYY-MM-DDTHH:mm:ss.0000000\\Z’));
It uses momentjs file, it comes build in with powerapp portal. The above code will set the value in date field but to display the value, we need to set in description. You can set different format to display the value in description.
$("logicalName_datepicker_description").val(moment.utc(todayDate).format(‘YYYY-MM-DDT’));
No comments:
Post a Comment
Write us your comment.