0

We can't seem to get the ligthning:inputField to work with time type fields (NOT date\time). Does anyone know if it should work?

Other types such as picklists, checkboxes etc work just fine.

  • What do you observe while using it with a Time field? Can you post relevant code snippet/screenshot/issue details? – Jayant Das Jan 24 '19 at 18:15
  • 1
    <lightning:input> is documented to support Time fields, but it's not listed as supported for <lightning:inputField>. Because the list is otherwise comprehensive I would read that to mean it's unsupported. – David Reed Jan 24 '19 at 18:24
2

For time you need to use this ligthning:inputField only support below see here

 <lightning-input type="time"
                         label="Time"
                         name="time">
    </lightning-input>
  1. Address: Displays the input address fields, without Google address search capability.
  2. Checkbox: Displays a checkbox input.
  3. Currency: Displays an input field for entering monetary data. The user’s Salesforce locale determines the currency symbol and separator characters used to format the number. Specifying a different locale is currently not supported for currency.
  4. Date: Displays an input field for entering a date. The date format is automatically validated against the user’s Salesforce locale format. On mobile devices, fields of type date use native mobile date pickers.
  5. Date/Time: Displays input fields for entering a date and time. The date and time formats are automatically validated against the user’s Salesforce locale format. On mobile devices, fields of type datetime use native mobile date and time pickers.
  6. Email: Displays an input field for entering an email address. The email pattern is automatically validated.
  7. Geolocation: Displays input fields for entering latitude and longitude in decimal degrees. The latitude field accepts values within -90 and 90, and the longitude field accepts values within -180 and 180.
  8. Lookup: Displays an input field for creating a relationship between two objects, for example, the account associated to a contact record. The lookup type is supported in Lightning Experience only. Mobile lookups are not supported. When used in the mobile app, the lookup type is rendered as an input text field. The Owner, CreatedBy, and LastModifiedBy fields are not supported for lookups.
  9. Name: Displays one or more input fields for setting the name of a record. Input fields can include a single name field or multiple fields. For example, accounts might have a single name while contacts might have a salutation, first name, and last name.
  10. Number: Displays an input field for entering a number and formats it based on the user's locale.
  11. Password: Displays an input field for entering a password. Characters you enter are masked.
  12. Percent: Displays an input field for entering a percentage.
  13. Phone: Displays an input field for entering a phone number.
  14. Picklist and multi-select picklist: Displays a picklist or multi-select picklist. Dependent picklists must be defined in your org before you can use them with lightning:inputField. Both controlling and dependent fields must be included in your component. See the example below.
  15. Text: Displays text input, accepts up to 255 characters.
  16. Text (Encrypted): Displays the encrypted text input for up to 175 characters.
  17. Text Area: Displays multi-line text input for up to 255 characters.
  18. Text Area (Long): Displays multi-line text input for up to 131,072 characters.
  19. Text Area (Rich): Displays rich text input for bold or underline text, lists, and images for up to 131,072 characters including the formatting and HTML tags. Unsupported tags and attributes are removed and only their text content is displayed. For more information on supported tags, see Rich Text Editor in Salesforce Help.
  20. URL: Displays a URL input field which checks for a protocol such as http:// or ftp://
|improve this answer|||||
  • Its not a code block and is bit unreadble. Can you format it? – Pranay Jaiswal Jan 24 '19 at 19:41
0

the lightning-input code block in the selected answer doesn't work. The correct way of making time and date fields with lightning:input is as follows:

<lightning:input type="time" label="Time" name="time" />
<lightning:input type="date" label="Date" name="date" />

If you are trying to use lightning:inputField instead, per the support page, they support Date and DateTime fields.

|improve this answer|||||

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.