Discuss anything related to web development but no technical support questions


Post by lxxrxns »

Hi there,

Is it possible to have a Scheduler view that shows Tertials (i.e. T1 = jan-apr, T2 = may-aug and T3 = sept-dec) in stead of Quartiles (Q1, Q2, Q3, Q4) for every year?

Thanks in advance,

Laurens


Post by mats »

Yes sure, you can create any configuration you want. I just built a demo showing this, is this what you had in mind?

viewPreset : {
                displayDateFormat : 'H:mm',
                shiftIncrement    : 1,
                shiftUnit         : 'WEEK',
                timeResolution    : {
                    unit      : 'MINUTE',
                    increment : 10
                },
                headers : [
                    {
                        unit       : 'year',
                        dateFormat : 'YYYY'
                    },
                    {
                        unit      : 'month',
                        increment : 4,
                        renderer(start, end) {
                            return `${DateHelper.format(start, 'MMM')} - ${DateHelper.format(DateHelper.add(end,  -1, 'month'), 'MMM')}`;
                        }
                    },
                    {
                        unit       : 'month',
                        dateFormat : 'MMM'
                    }
                ]
            },
Attachments
Screenshot 2023-04-18 at 09.18.42.png
Screenshot 2023-04-18 at 09.18.42.png (225.78 KiB) Viewed 1853 times

Post by lxxrxns »

Hi mats,

Yes, thank you, that's amazing!
And I was able to get the "T1, T2, T3" formatting by changing this part of your code to:

...
renderer(start) {
    return `T${Math.ceil(DateHelper.format(start, 'M')/4)}`;
}
...

Thank you so much!


Post by marcio »

Hey lxxrxns,

Thanks for sharing your configuration! It'll help others in the future for sure. :)

Best regards,
Márcio


Post Reply