0

This issue has just appeared since Summer '19 rollout. It was working correctly before.

I have an LWC with a <lightning-record-edit-form> for creating a new appointment record (so no record-id is provided.) This component opens in a modal when the user clicks on a date on a calendar, so I know the date the user intends for the appointment. Therefore, I want to pre-populate the startDateTime field.

The html: <lightning-input-field field-name="StartDateTime__c" value={startDt} onchange={updateStartDt}></lightning-input-field>

The {startDt} value is an @api attribute, and I'm sure that value is being populated, as I can put {startDt} in the markup and it displays, but the actual dateTime input remains blank.

Anybody else experiencing this? Not sure where to report this issue.

enter image description here

2

Well at least they have introduced a new style / format attribute on lightning-input (which is used in the background). But your date format looks strange to me on the timezonepart. A datetime normally either ends on Z (and then its UTC) or +hh:mm or -hh:mm specifing an offset as per ISO8601.

That said i tried the format (YYYY-MM-DDThh:mm:ssTZD) they are using in their examples and a default to the current date in the user locale (new Date().toISOString()) and both are working fine and preopulate the fields for me. So maybe you want to check out where your date input comes from and check if that is somehow corrupted?

  • Thanks, it was working before, so I didn't think to check it. Standby for update... – PatMcClellan__c Jul 11 at 17:43
  • Thank you! You helped me isolate the issue. The actual dateTime (24 characters) is being supplied as the id in an iteration (different one for each day on the calendar). That data is 24 chars and displays that way. However, in a dblclick event, it is unexplainably appending a dash and 3 chars. I haven't figured out why, but I was able to pass the value along using event.target.id.substr(0,24) and it works. – PatMcClellan__c Jul 11 at 18:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.