How do we format the Time in datatable like HH:MM:SS
in the LWC data table.
In my datatable column type is defined as Time, expecting the date only format HH:MM:SS.
{ label: "Start Time", fieldName: "Program_Start_Time__c", type: **"time"** },
I went through the LWC data table Documentation:
Displays a date and time based on the locale using lightning-formatted-date-time. Displaying Date and Time Using Type Attributes.
Type Attribute: day, era, hour, hour12, minute, month, second, timeZone, timeZoneName, weekday, year
typeAttributes: {
day: 'numeric',
month: 'short',
year: 'numeric',
hour: '2-digit',
minute: '2-digit',
second: '2-digit',
hour12: true
}
For displaying only the Time for type=time
i have tried the below,
{ label: "Start Time", fieldName: "Program_Start_Time__c", type: "time", typeAttributes: {
**hour: '2-digit',
minute: '2-digit',
second: '2-digit',
hour12: true**
} }
Unfortunately not getting the time for the field type Time. Can anyone help with this?