function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
IKZIKZ 

Getting Intl.DateTimeFormat error when primary tab in console does not load correctly

In lightning tables we have below attributes to determine if field is datetime or just date:
"typeAttributes": {
               "includesTime" : true,
               "year": "numeric",
               "month": "short",
               "day": "numeric",
               "hour": "2-digit",
               "minute": "2-digit"
}
but sometimes, when the primary tab table won't load correctly (which looks like SF bug anyway) we get the [Value null out of range for Intl.DateTimeFormat options property hour] error . Sf support is saying that because our code below return null value which is a bad practice, as lightning:formattedDateTime does not expect nulls. They recommend to update this to a non-null value.
public class LightningTableTypeAttributes{ @AuraEnabled 
public Boolean includesTime;
@AuraEnabled
public String hour { get { return includesTime != null && includesTime ? '2-digit' : null; } }

But I don't understand what else can be used if that’s the IF condition to determine if it’s datetime field or just date field?

Any help would be grately appreciated