Our pure JavaScript Scheduler component


Post by eswachsman »

Can I use a hex color for resourceTimeRanges or only color names? My goal is to have different shading levels for different time ranges.

I would either want to set timeRangeColor to red and then set a different opacity for each time range or I would want to set an explicit hex color for each range.

resourceTimeRanges = [
            { id : 1, resourceId : '1', startDate : new Date(2022,4,8,11,30), endDate : new Date(2022,4,8,12,0), timeRangeColor : 'red' },
            { id : 2, resourceId : '3', startDate : new Date(2022,4,8,15,15), endDate : new Date(2022,4,8,16,30), timeRangeColor : 'red' },
        ];

Post by mats »

It's only the default named colors supported for now.

  
* red * pink * purple * violet * indigo * blue * cyan * teal * green * lime * yellow * orange * deep-orange * gray

You can use style instead:

        { id : 8, resourceId : 'r7', startDate : '2019-01-01T12:00', endDate : '2019-01-01T18:00', name : 'Afternoon off (custom style)', style : 'background: rgba(255,165,0,.3);color : orange' },

Post by eswachsman »

Awesome. Style works great.


Post Reply