Lime Web Components API Documentation - v7.4.0
    Preparing search index...

    Type Alias DateTimePropertyType

    DateTimePropertyType:
        | "time"
        | "timeofday"
        | "date"
        | "year"
        | "quarter"
        | "month"

    The subset of PropertyType values that represent date or time values.

    IMPORTANT NAMING CAVEAT: The naming of time-related types is counterintuitive for historical reasons:

    • time = Date AND time (full datetime/timestamp)
    • timeofday = A time of day. The value is still returned as a full ISO 8601 datetime string, not a bare time string; only the time portion is meaningful, the date portion should be ignored.

    Additional notes:

    • There is no dedicated "week" type. Week properties use the time type and are configured as "week" in the view configuration
    • All date/time values are typically stored as ISO 8601 strings
    import { PlatformServiceName, isDate } from '@limetech/lime-web-components';

    const repository = platform.get(PlatformServiceName.LimeTypeRepository);
    const property = repository.getLimeType('deal')?.getProperty('created');

    if (property && isDate(property)) {
    if (property.type === 'time') {
    // Full datetime, e.g. "2024-03-15T14:30:00Z"
    console.log('This is a datetime field');
    } else if (property.type === 'timeofday') {
    // Still a full ISO string, only the time part is meaningful
    console.log('This is a time-only field');
    } else if (property.type === 'date') {
    // Date only, e.g. "2024-03-15"
    console.log('This is a date-only field');
    }
    }